◆ __construct()
ilMailFormGUI::__construct |
( |
| ) |
|
Definition at line 27 of file class.ilMailFormGUI.php.
References $_GET, $_POST, $ilCtrl, $ilUser, $lng, and $tpl.
37 $this->mbox =
new ilMailBox($ilUser->getId());
41 $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
44 if(!(
int)
$_GET[
'mobj_id'])
46 $_GET[
'mobj_id'] = $this->mbox->getInboxFolder();
49 $this->ctrl->saveParameter($this,
'mobj_id');
This class handles all operations on files (attachments) in directory ilias_data/mail.
◆ cancelMail()
ilMailFormGUI::cancelMail |
( |
| ) |
|
◆ cancelSearch()
ilMailFormGUI::cancelSearch |
( |
| ) |
|
◆ decodeAttachmentFiles()
ilMailFormGUI::decodeAttachmentFiles |
( |
array |
$files | ) |
|
|
protected |
- Parameters
-
- Returns
- array
Definition at line 114 of file class.ilMailFormGUI.php.
References $GLOBALS, and array.
Referenced by saveDraft(), and sendMessage().
116 $decodedFiles =
array();
120 if(is_file($this->mfile->getMailPath() .
'/' .
$GLOBALS[
'DIC']->user()->getId() .
'_' . urldecode($value)))
122 $decodedFiles[] = urldecode($value);
126 return $decodedFiles;
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
◆ editAttachments()
ilMailFormGUI::editAttachments |
( |
| ) |
|
◆ executeCommand()
ilMailFormGUI::executeCommand |
( |
| ) |
|
Definition at line 52 of file class.ilMailFormGUI.php.
References $cmd.
54 $forward_class = $this->ctrl->getNextClass($this);
55 switch($forward_class)
57 case 'ilmailfoldergui':
58 include_once
'Services/Mail/classes/class.ilMailFolderGUI.php';
63 case 'ilmailattachmentgui':
64 include_once
'Services/Mail/classes/class.ilMailAttachmentGUI.php';
66 $this->ctrl->setReturn($this,
"returnFromAttachments");
70 case 'ilmailsearchgui':
71 include_once
'Services/Contact/classes/class.ilMailSearchGUI.php';
73 $this->ctrl->setReturn($this,
"searchResults");
77 case 'ilmailsearchcoursesgui':
78 include_once
'Services/Contact/classes/class.ilMailSearchCoursesGUI.php';
80 $this->ctrl->setReturn($this,
"searchResults");
84 case 'ilmailinglistsgui':
85 include_once
'Services/Contact/classes/class.ilMailingListsGUI.php';
87 $this->ctrl->setReturn($this,
'searchResults');
91 case 'ilmailsearchgroupsgui':
92 include_once
'Services/Contact/classes/class.ilMailSearchGroupsGUI.php';
94 $this->ctrl->setReturn($this,
"searchResults");
99 if (!(
$cmd = $this->ctrl->getCmd()))
◆ getAjaxPlaceholdersById()
ilMailFormGUI::getAjaxPlaceholdersById |
( |
| ) |
|
Definition at line 897 of file class.ilMailFormGUI.php.
References $_GET, exit, ilMailTemplateService\getTemplateContextById(), and ilUtil\stripSlashes().
900 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
901 require_once
'Services/Mail/classes/Form/class.ilManualPlaceholderInputGUI.php';
904 foreach($context->getPlaceholders() as $key => $value)
906 $placeholders->addPlaceholder($value[
'placeholder'], $value[
'label'] );
908 $placeholders->render(
true);
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getTemplateContextById($a_id)
◆ getTemplateDataById()
ilMailFormGUI::getTemplateDataById |
( |
| ) |
|
|
protected |
Called asynchronously when changing the template.
Definition at line 412 of file class.ilMailFormGUI.php.
References $_GET, $_POST, $_SESSION, $data, $error, $ilCtrl, $ilUser, $lng, $options, $size, $template_id, ilManualPlaceholderInputGUI\addPlaceholder(), array, ilButton\BUTTON_TYPE_SUBMIT, ilJsonUtil\encode(), exit, ilUtil\formatSize(), ilMailFormCall\getContextId(), ilButton\getInstance(), ilLoggerFactory\getLogger(), ilMailFormCall\getSignature(), ilMailTemplateService\getTemplateContextById(), ilMailFormCall\isRefererStored(), ilUtil\securePlainString(), ilUtil\sendInfo(), ilMailFormCall\setContextId(), ilMailFormCall\setContextParameters(), ilFormPropertyGUI\setInfo(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilTextAreaInputGUI\setValue().
414 require_once
'Services/JSON/classes/class.ilJsonUtil.php';
416 if(!isset(
$_GET[
'template_id']))
423 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
424 require_once
'Services/Mail/classes/class.ilMailTemplateDataProvider.php';
427 $template = $template_provider->getTemplateById(
$template_id);
430 'm_subject' => $template->getSubject(),
431 'm_message' => $template->getMessage()
Class ilMailTemplateDataProvider.
static encode($mixed, $suppress_native=false)
Create styles array
The data for the language used.
static getTemplateContextById($a_id)
◆ lookupRecipientAsync()
ilMailFormGUI::lookupRecipientAsync |
( |
| ) |
|
Definition at line 809 of file class.ilMailFormGUI.php.
References $_GET, $_POST, $result, array, exit, ilUtil\stripSlashes(), and ilStr\strLen().
811 include_once
'Services/JSON/classes/class.ilJsonUtil.php';
812 include_once
'Services/Mail/classes/class.ilMailForm.php';
814 if (isset(
$_GET[
"term"]) && is_string(
$_GET[
"term"])) {
815 $search =
$_GET[
"term"];
817 if (isset(
$_POST[
"term"]) && is_string(
$_POST[
"term"])) {
821 $search = trim($search);
825 require_once
'Services/Utilities/classes/class.ilStr.php';
833 $quoted = str_replace(
'%',
'\%', $quoted);
834 $quoted = str_replace(
'_',
'\_', $quoted);
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
◆ mailAttachment()
ilMailFormGUI::mailAttachment |
( |
| ) |
|
◆ mailRole()
ilMailFormGUI::mailRole |
( |
| ) |
|
◆ mailUser()
ilMailFormGUI::mailUser |
( |
| ) |
|
◆ replyMail()
ilMailFormGUI::replyMail |
( |
| ) |
|
◆ returnFromAttachments()
ilMailFormGUI::returnFromAttachments |
( |
| ) |
|
◆ saveDraft()
ilMailFormGUI::saveDraft |
( |
| ) |
|
Definition at line 173 of file class.ilMailFormGUI.php.
References $_POST, $_SESSION, $errors, $files, $GLOBALS, array, decodeAttachmentFiles(), ilMailFormCall\getContextId(), ilMailFormCall\getContextParameters(), ilMailFormCall\getRefererRedirectUrl(), ilMailFormCall\isRefererStored(), ilUtil\redirect(), ilUtil\securePlainString(), ilUtil\sendInfo(), showSubmissionErrors(), and user().
177 $_POST[
'm_subject'] =
'No title';
180 $draftFolderId = $this->mbox->getDraftsFolder();
183 if(
$errors = $this->umail->validateRecipients(
202 $draftId = $this->umail->getNewDraftId(
$GLOBALS[
'DIC']->
user()->getId(), $draftFolderId);
205 $this->umail->updateDraft($draftFolderId,
$files,
214 (
int)
$_POST[
'use_placeholders'],
224 $this->ctrl->redirectByClass(
"ilmailfoldergui");
static securePlainString($a_str)
Remove unsecure characters from a plain text string.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
static redirect($a_script)
http redirect to other script
◆ search()
ilMailFormGUI::search |
( |
| ) |
|
Definition at line 313 of file class.ilMailFormGUI.php.
References $_POST, $_SESSION, searchUsers(), and ilUtil\sendInfo().
316 if(strlen(trim(
$_SESSION[
"mail_search_search"])) == 0)
323 if(strlen(trim(
$_SESSION[
"mail_search_search"])) < 3)
325 $this->lng->loadLanguageModule(
'search');
331 $this->ctrl->setParameterByClass(
"ilmailsearchgui",
"search", urlencode(
$_SESSION[
"mail_search_search"]));
332 $this->ctrl->redirectByClass(
"ilmailsearchgui");
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
◆ searchCoursesTo()
ilMailFormGUI::searchCoursesTo |
( |
| ) |
|
Definition at line 289 of file class.ilMailFormGUI.php.
References $_SESSION.
291 $this->saveMailBeforeSearch();
295 $this->ctrl->setParameterByClass(
'ilmailsearchcoursesgui',
'cmd',
'showMembers');
298 $this->ctrl->setParameterByClass(
'ilmailsearchcoursesgui',
'ref',
'mail');
299 $this->ctrl->redirectByClass(
'ilmailsearchcoursesgui');
◆ searchGroupsTo()
ilMailFormGUI::searchGroupsTo |
( |
| ) |
|
Definition at line 305 of file class.ilMailFormGUI.php.
307 $this->saveMailBeforeSearch();
309 $this->ctrl->setParameterByClass(
'ilmailsearchgroupsgui',
'ref',
'mail');
310 $this->ctrl->redirectByClass(
'ilmailsearchgroupsgui');
◆ searchMailingListsTo()
ilMailFormGUI::searchMailingListsTo |
( |
| ) |
|
Definition at line 889 of file class.ilMailFormGUI.php.
891 $this->saveMailBeforeSearch();
893 $this->ctrl->setParameterByClass(
'ilmailinglistsgui',
'ref',
'mail');
894 $this->ctrl->redirectByClass(
'ilmailinglistsgui');
◆ searchResults()
ilMailFormGUI::searchResults |
( |
| ) |
|
◆ searchUsers()
ilMailFormGUI::searchUsers |
( |
|
$save = true | ) |
|
Definition at line 229 of file class.ilMailFormGUI.php.
References $_POST, $_SESSION, $files, $ilCtrl, $ilUser, array, ilMailFormCall\getContextId(), ilMailFormCall\getContextParameters(), ilUtil\prepareFormOutput(), ilUtil\securePlainString(), and ilTextInputGUI\setSize().
Referenced by search().
233 $this->tpl->setTitle($this->lng->txt(
"mail"));
239 if(is_array(
$_POST[
'attachments']))
241 foreach(
$_POST[
'attachments'] as $value)
243 $files[] = urldecode($value);
248 $this->umail->savePostData($ilUser->getId(),
262 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
264 $form->setId(
'search_rcp');
265 $form->setTitle($this->lng->txt(
'search_recipients'));
266 $form->setFormAction($ilCtrl->getFormAction($this,
'search'));
268 $inp =
new ilTextInputGUI($this->lng->txt(
"search_for"),
'search');
270 $dsDataLink = $ilCtrl->getLinkTarget($this,
'lookupRecipientAsync',
'',
true,
false);
271 $inp->setDataSource($dsDataLink);
273 if (strlen(trim(
$_SESSION[
"mail_search_search"])) > 0)
277 $form->addItem($inp);
279 $form->addCommandButton(
'search', $this->lng->txt(
"search"));
280 $form->addCommandButton(
'cancelSearch', $this->lng->txt(
"cancel"));
282 $this->tpl->setContent($form->getHtml());
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static securePlainString($a_str)
Remove unsecure characters from a plain text string.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
Create styles array
The data for the language used.
◆ sendMessage()
ilMailFormGUI::sendMessage |
( |
| ) |
|
Definition at line 129 of file class.ilMailFormGUI.php.
References $_POST, $errors, $files, $GLOBALS, array, decodeAttachmentFiles(), ilMailFormCall\getRefererRedirectUrl(), ilMailFormCall\isRefererStored(), ilUtil\redirect(), ilUtil\securePlainString(), ilUtil\sendInfo(), showSubmissionErrors(), ilUtil\stripSlashes(), and user().
134 $message = str_replace(
"\r",
'', $message);
136 $message = $this->umail->formatLinebreakMessage($message);
140 $this->umail->setSaveInSentbox(
true);
141 if(
$errors = $this->umail->sendMail(
148 (
int)
$_POST[
'use_placeholders']
152 $_POST[
'attachments'] =
$files;
157 $this->umail->savePostData(
$GLOBALS[
'DIC']->
user()->getId(),
array(),
"",
"",
"",
"",
"",
"",
"",
"");
159 $this->ctrl->setParameterByClass(
'ilmailgui',
'type',
'message_sent');
167 $this->ctrl->redirectByClass(
'ilmailgui');
static securePlainString($a_str)
Remove unsecure characters from a plain text string.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static redirect($a_script)
http redirect to other script
◆ showSubmissionErrors()
ilMailFormGUI::showSubmissionErrors |
( |
array |
$errors | ) |
|
|
protected |
- Parameters
-
Definition at line 915 of file class.ilMailFormGUI.php.
References $error, $tpl, array, ilUtil\prepareFormOutput(), and ilUtil\sendInfo().
Referenced by saveDraft(), and sendMessage().
917 $errors_to_display =
array();
921 $error = array_values($error);
922 $first_error = array_shift($error);
924 $translation = $this->lng->txt($first_error);
925 if($translation ==
'-' . $first_error .
'-')
927 $translation = $first_error;
930 if(count($error) == 0 || $translation == $first_error)
932 $errors_to_display[] = $translation;
937 $error = array_map(
function($address) {
941 array_unshift($error, $translation);
942 $errors_to_display[] = call_user_func_array(
'sprintf', $error);
946 if(count($errors_to_display) > 0)
948 $tpl =
new ilTemplate(
'tpl.mail_new_submission_errors.html',
true,
true,
'Services/Mail');
949 if(count($errors_to_display) == 1)
951 $tpl->setCurrentBlock(
'single_error');
952 $tpl->setVariable(
'SINGLE_ERROR', current($errors_to_display));
953 $tpl->parseCurrentBlock();
957 $first_error = array_shift($errors_to_display);
959 foreach($errors_to_display as $error)
961 $tpl->setCurrentBlock(
'error_loop');
962 $tpl->setVariable(
'ERROR', $error);
963 $tpl->parseCurrentBlock();
966 $tpl->setCurrentBlock(
'multiple_errors');
967 $tpl->setVariable(
'FIRST_ERROR', $first_error);
968 $tpl->parseCurrentBlock();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
◆ $ctrl
ilMailFormGUI::$ctrl = null |
|
private |
◆ $lng
ilMailFormGUI::$lng = null |
|
private |
◆ $mbox
ilMailFormGUI::$mbox = null |
|
private |
◆ $mfile
ilMailFormGUI::$mfile = null |
|
private |
◆ $tpl
ilMailFormGUI::$tpl = null |
|
private |
◆ $umail
ilMailFormGUI::$umail = null |
|
private |
The documentation for this class was generated from the following file: