ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjMailGUI Class Reference
+ Inheritance diagram for ilObjMailGUI:
+ Collaboration diagram for ilObjMailGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 ilObjMailGUI constructor. More...
 
 executeCommand ()
 
 getAdminTabs ()
 
 viewObject ()
 
 saveObject ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

const SETTINGS_SUB_TAB_ID_GENERAL = 1
 
const SETTINGS_SUB_TAB_ID_EXTERNAL = 2
 
const PASSWORD_PLACE_HOLDER = '***********************'
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 getTabs ()
 
 buildSettingsSubTabs ($activeSubTab)
 
 showGeneralSettingsForm (ilPropertyFormGUI $form=null)
 
 getGeneralSettingsForm ()
 
 populateGeneralSettingsForm (ilPropertyFormGUI $form)
 
 showExternalSettingsFormObject (ilPropertyFormGUI $form=null)
 
 sendTestUserMailObject ()
 
 sendTestSystemMailObject ()
 
 sendTestMail ($is_manual_mail=false)
 
 getExternalSettingsForm ()
 
 populateExternalSettingsForm (ilPropertyFormGUI $form)
 
 saveExternalSettingsFormObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
 $rbacsystem
 
 $settings
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Private Member Functions

 isEditingAllowed ()
 
 isViewAllowed ()
 
 isPermissionChangeAllowed ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMailGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

ilObjMailGUI constructor.

Parameters
$a_data
int$a_id
bool$a_call_by_reference

Definition at line 37 of file class.ilObjMailGUI.php.

References $DIC, and settings().

38  {
39  global $DIC;
40 
41  $this->type = 'mail';
42  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
43 
44  $this->tabs = $DIC->tabs();
45  $this->rbacsystem = $DIC->rbac()->system();
46  $this->settings = $DIC['ilSetting'];
47 
48  $this->lng->loadLanguageModule('mail');
49  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMailGUI::_goto (   $a_target)
static
Parameters
string$a_target

Definition at line 641 of file class.ilObjMailGUI.php.

References $_GET, $DIC, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\redirect(), and ilUtil\sendFailure().

642  {
643  global $DIC;
644 
645  $mail = new ilMail($DIC->user()->getId());
646 
647  if ($DIC->rbac()->system()->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
648  ilUtil::redirect('ilias.php?baseClass=ilMailGUI');
649  } else {
650  if ($DIC->access()->checkAccess('read', '', ROOT_FOLDER_ID)) {
651  $_GET['cmd'] = 'frameset';
652  $_GET['target'] = '';
653  $_GET['ref_id'] = ROOT_FOLDER_ID;
654  $_GET['baseClass'] = 'ilRepositoryGUI';
656  sprintf(
657  $DIC->language()->txt('msg_no_perm_read_item'),
659  ),
660  true
661  );
662 
663  include 'ilias.php';
664  exit();
665  }
666  }
667 
668  $DIC['ilErr']->raiseError($DIC->language()->txt('msg_no_perm_read'), $DIC['ilErr']->FATAL);
669  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: backend.php:16
static redirect($a_script)
+ Here is the call graph for this function:

◆ buildSettingsSubTabs()

ilObjMailGUI::buildSettingsSubTabs (   $activeSubTab)
protected
Parameters
int$activeSubTab

Definition at line 163 of file class.ilObjMailGUI.php.

References isViewAllowed(), and settings().

Referenced by showExternalSettingsFormObject(), and showGeneralSettingsForm().

164  {
165  if ($this->isViewAllowed()) {
166  $this->tabs->addSubTab(
167  self::SETTINGS_SUB_TAB_ID_GENERAL,
168  $this->lng->txt('mail_settings_general_tab'),
169  $this->ctrl->getLinkTarget($this, 'view')
170  );
171 
172  if ($this->settings->get('mail_allow_external')) {
173  $this->tabs->addSubTab(
174  self::SETTINGS_SUB_TAB_ID_EXTERNAL,
175  $this->lng->txt('mail_settings_external_tab'),
176  $this->ctrl->getLinkTarget($this, 'showExternalSettingsForm')
177  );
178  }
179 
180  $this->tabs->activateSubTab($activeSubTab);
181  }
182  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjMailGUI::executeCommand ( )

Definition at line 54 of file class.ilObjMailGUI.php.

References isViewAllowed(), and ilObjectGUI\prepareOutput().

55  {
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58  $this->prepareOutput();
59 
60  switch ($next_class) {
61  case 'ilpermissiongui':
62  $perm_gui = new ilPermissionGUI($this);
63  $this->ctrl->forwardCommand($perm_gui);
64  break;
65 
66  case 'ilmailtemplategui':
67  if (!$this->isViewAllowed()) {
68  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
69  }
70 
71  $this->ctrl->forwardCommand(new ilMailTemplateGUI($this->object));
72  break;
73 
74  default:
75  if (!$cmd) {
76  $cmd = 'view';
77  }
78  $cmd .= 'Object';
79  $this->$cmd();
80  break;
81  }
82 
83  return true;
84  }
Class ilMailTemplateGUI.
prepareOutput($a_show_subobjects=true)
prepare output
redirection script todo: (a better solution should control the processing via a xml file) ...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjMailGUI::getAdminTabs ( )

Definition at line 113 of file class.ilObjMailGUI.php.

References getTabs().

114  {
115  $this->getTabs();
116  }
+ Here is the call graph for this function:

◆ getExternalSettingsForm()

ilObjMailGUI::getExternalSettingsForm ( )
protected
Returns
ilPropertyFormGUI

Definition at line 408 of file class.ilObjMailGUI.php.

References $form, $key, $password, ilObjectGUI\$user, isEditingAllowed(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextAreaInputGUI\setRows(), and ilTextInputGUI\setSize().

Referenced by saveExternalSettingsFormObject(), and showExternalSettingsFormObject().

409  {
410  $form = new ilPropertyFormGUI();
411 
412  $form->setFormAction($this->ctrl->getFormAction($this, 'saveExternalSettingsForm'));
413  $form->setTitle($this->lng->txt('mail_settings_external_frm_head'));
414 
415  $smtp = new ilCheckboxInputGUI($this->lng->txt('mail_smtp_status'), 'mail_smtp_status');
416  $smtp->setInfo($this->lng->txt('mail_smtp_status_info'));
417  $smtp->setValue(1);
418  $smtp->setDisabled(!$this->isEditingAllowed());
419  $form->addItem($smtp);
420 
421  $host = new ilTextInputGUI($this->lng->txt('mail_smtp_host'), 'mail_smtp_host');
422  $host->setInfo($this->lng->txt('mail_smtp_host_info'));
423  $host->setRequired(true);
424  $host->setDisabled(!$this->isEditingAllowed());
425  $smtp->addSubItem($host);
426 
427  $port = new ilNumberInputGUI($this->lng->txt('mail_smtp_port'), 'mail_smtp_port');
428  $port->setInfo($this->lng->txt('mail_smtp_port_info'));
429  $port->allowDecimals(false);
430  $port->setMinValue(0);
431  $port->setMinValue(0);
432  $port->setRequired(true);
433  $port->setDisabled(!$this->isEditingAllowed());
434  $smtp->addSubItem($port);
435 
436  $encryption = new ilSelectInputGUI($this->lng->txt('mail_smtp_encryption'), 'mail_smtp_encryption');
437  $encryptionOptions = array(
438  '' => $this->lng->txt('please_choose'),
439  'tls' => $this->lng->txt('mail_smtp_encryption_tls'),
440  'ssl' => $this->lng->txt('mail_smtp_encryption_ssl')
441  );
442 
443  $encryption->setOptions($encryptionOptions);
444  $encryption->setDisabled(!$this->isEditingAllowed());
445  $smtp->addSubItem($encryption);
446 
447  $user = new ilTextInputGUI($this->lng->txt('mail_smtp_user'), 'mail_smtp_user');
448  $user->setDisabled(!$this->isEditingAllowed());
449  $smtp->addSubItem($user);
450 
451  $password = new ilPasswordInputGUI($this->lng->txt('mail_smtp_password'), 'mail_smtp_password');
452  $password->setRetype(false);
453  $password->setSkipSyntaxCheck(true);
454  $password->setDisabled(!$this->isEditingAllowed());
455  $smtp->addSubItem($password);
456 
457  $pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'), 'mail_subject_prefix');
458  $pre->setSize(12);
459  $pre->setMaxLength(32);
460  $pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
461  $pre->setDisabled(!$this->isEditingAllowed());
462  $form->addItem($pre);
463 
464  $send_html = new ilCheckboxInputGUI($this->lng->txt('mail_send_html'), 'mail_send_html');
465  $send_html->setInfo($this->lng->txt('mail_send_html_info'));
466  $send_html->setValue(1);
467  $send_html->setDisabled(!$this->isEditingAllowed());
468  $form->addItem($send_html);
469 
470  $sh = new ilFormSectionHeaderGUI();
471  $sh->setTitle($this->lng->txt('mail_settings_user_frm_head'));
472  $form->addItem($sh);
473 
474  $user_from_address = new ilEMailInputGUI(
475  $this->lng->txt('mail_system_usr_from_addr'),
476  'mail_system_usr_from_addr'
477  );
478  $user_from_address->setInfo($this->lng->txt('mail_system_usr_from_addr_info'));
479  $user_from_address->setRequired(true);
480  $user_from_address->setDisabled(!$this->isEditingAllowed());
481  $form->addItem($user_from_address);
482 
483  $user_from_name = new ilTextInputGUI($this->lng->txt('mail_system_usr_from_name'), 'mail_system_usr_from_name');
484  $user_from_name->setInfo($this->lng->txt('mail_system_usr_from_name_info'));
485  $user_from_name->setRequired(true);
486  $user_from_name->setDisabled(!$this->isEditingAllowed());
487  $form->addItem($user_from_name);
488 
489  $user_envelope_from_addr = new ilEMailInputGUI(
490  $this->lng->txt('mail_system_usr_env_from_addr'),
491  'mail_system_usr_env_from_addr'
492  );
493  $user_envelope_from_addr->setInfo($this->lng->txt('mail_system_usr_env_from_addr_info'));
494  $user_envelope_from_addr->setDisabled(!$this->isEditingAllowed());
495  $form->addItem($user_envelope_from_addr);
496 
497  $sh = new ilFormSectionHeaderGUI();
498  $sh->setTitle($this->lng->txt('mail_settings_system_frm_head'));
499  $form->addItem($sh);
500 
501  $system_from_addr = new ilEMailInputGUI(
502  $this->lng->txt('mail_system_sys_from_addr'),
503  'mail_system_sys_from_addr'
504  );
505  $system_from_addr->setInfo($this->lng->txt('mail_system_sys_from_addr_info'));
506  $system_from_addr->setRequired(true);
507  $system_from_addr->setDisabled(!$this->isEditingAllowed());
508  $form->addItem($system_from_addr);
509 
510  $system_from_name = new ilTextInputGUI(
511  $this->lng->txt('mail_system_sys_from_name'),
512  'mail_system_sys_from_name'
513  );
514  $system_from_name->setRequired(true);
515  $system_from_name->setDisabled(!$this->isEditingAllowed());
516  $form->addItem($system_from_name);
517 
518  $system_reply_to_addr = new ilEMailInputGUI(
519  $this->lng->txt('mail_system_sys_reply_to_addr'),
520  'mail_system_sys_reply_to_addr'
521  );
522  $system_reply_to_addr->setRequired(true);
523  $system_reply_to_addr->setDisabled(!$this->isEditingAllowed());
524  $form->addItem($system_reply_to_addr);
525 
526  $system_return_path = new ilEMailInputGUI(
527  $this->lng->txt('mail_system_sys_env_from_addr'),
528  'mail_system_sys_env_from_addr'
529  );
530  $system_return_path->setInfo($this->lng->txt('mail_system_sys_env_from_addr_info'));
531  $system_return_path->setDisabled(!$this->isEditingAllowed());
532  $form->addItem($system_return_path);
533 
534  $signature = new ilTextAreaInputGUI($this->lng->txt('mail_system_sys_signature'), 'mail_system_sys_signature');
535  $signature->setRows(8);
536  $signature->setDisabled(!$this->isEditingAllowed());
537  $form->addItem($signature);
538 
539  $placeholders = new ilManualPlaceholderInputGUI('mail_system_sys_signature');
540  foreach (array(
541  array('placeholder' => 'CLIENT_NAME', 'label' => $this->lng->txt('mail_nacc_client_name')),
542  array('placeholder' => 'CLIENT_DESC', 'label' => $this->lng->txt('mail_nacc_client_desc')),
543  array('placeholder' => 'CLIENT_URL', 'label' => $this->lng->txt('mail_nacc_ilias_url'))
544  ) as $key => $value) {
545  $placeholders->addPlaceholder($value['placeholder'], $value['label']);
546  }
547  $placeholders->setDisabled(!$this->isEditingAllowed());
548  $form->addItem($placeholders);
549 
550  if ($this->isEditingAllowed()) {
551  $form->addCommandButton('saveExternalSettingsForm', $this->lng->txt('save'));
552  }
553 
554  return $form;
555  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
This class represents a email property in a property form.
Class ilManualPlaceholderInputGUI.
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a password property in a property form.
setOptions($a_options)
Set Options.
$password
Definition: cron.php:14
This class represents a text area property in a property form.
$key
Definition: croninfo.php:18
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGeneralSettingsForm()

ilObjMailGUI::getGeneralSettingsForm ( )
protected
Returns

Definition at line 214 of file class.ilObjMailGUI.php.

References $form, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilAdministrationSettingsFormHandler\FORM_MAIL, isEditingAllowed(), ilFormPropertyGUI\setDisabled(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilNumberInputGUI\setSuffix(), and USER_FOLDER_ID.

Referenced by saveObject(), and showGeneralSettingsForm().

215  {
216  $form = new ilPropertyFormGUI();
217 
218  $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
219  $form->setTitle($this->lng->txt('general_settings'));
220 
221  $cb = new ilCheckboxInputGUI($this->lng->txt('mail_allow_external'), 'mail_allow_external');
222  $cb->setInfo($this->lng->txt('mail_allow_external_info'));
223  $cb->setValue(1);
224  $cb->setDisabled(!$this->isEditingAllowed());
225  $form->addItem($cb);
226 
227  include_once 'Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php';
228  $incoming_mail_gui = new ilIncomingMailInputGUI($this->lng->txt('mail_incoming'), 'incoming_type');
229  $incoming_mail_gui->setDisabled(!$this->isEditingAllowed());
230  $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
231  $incoming_mail_gui->setInfo(sprintf(
232  $this->lng->txt('mail_settings_incoming_type_see_also'),
233  $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')
234  ));
235  $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
236  $form->addItem($incoming_mail_gui);
237 
238  $show_mail_settings_gui = new ilCheckboxInputGUI($this->lng->txt('show_mail_settings'), 'show_mail_settings');
239  $show_mail_settings_gui->setInfo($this->lng->txt('show_mail_settings_info'));
240  $show_mail_settings_gui->setValue(1);
241  $form->addItem($show_mail_settings_gui);
242 
243  $ti = new ilNumberInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
244  $ti->setSuffix($this->lng->txt('kb'));
245  $ti->setInfo($this->lng->txt('mail_max_size_attachments_total'));
246  $ti->setMaxLength(10);
247  $ti->setSize(10);
248  $ti->setDisabled(!$this->isEditingAllowed());
249  $form->addItem($ti);
250 
251  $mn = new ilFormSectionHeaderGUI();
252  $mn->setTitle($this->lng->txt('mail_member_notification'));
253  $form->addItem($mn);
254 
255  $cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
256  $cron_options = array(
257  0 => $this->lng->txt('cron_mail_notification_never'),
258  1 => $this->lng->txt('cron_mail_notification_cron')
259  );
260  $cron_mail->setOptions($cron_options);
261  $cron_mail->setInfo(sprintf(
262  $this->lng->txt('cron_mail_notification_desc'),
263  $this->lng->txt('mail_allow_external')
264  ));
265  $cron_mail->setDisabled(!$this->isEditingAllowed());
266  $form->addItem($cron_mail);
267 
270  $form,
271  $this
272  );
273 
274  if ($this->isEditingAllowed()) {
275  $form->addCommandButton('save', $this->lng->txt('save'));
276  }
277 
278  return $form;
279  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setInfo($a_info)
Set Information Text.
setSuffix($a_value)
Set suffix.
if(isset($_POST['submit'])) $form
This class represents a number property in a property form.
setOptions($a_options)
Set Options.
const USER_FOLDER_ID
Class ilObjUserFolder.
setDisabled($a_disabled)
Set Disabled.
Class ilIncomingMailInputGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjMailGUI::getTabs ( )
protected

Definition at line 121 of file class.ilObjMailGUI.php.

References isPermissionChangeAllowed(), and isViewAllowed().

Referenced by getAdminTabs().

122  {
123  if ($this->isViewAllowed()) {
124  $this->tabs->addTarget(
125  'settings',
126  $this->ctrl->getLinkTarget($this, 'view'),
127  array(
128  'view',
129  'save',
130  '',
131  'showExternalSettingsForm',
132  'saveExternalSettingsForm',
133  'sendTestUserMail',
134  'sendTestSystemMail'
135  ),
136  '',
137  ''
138  );
139  }
140 
141  if ($this->isViewAllowed()) {
142  $this->tabs->addTarget(
143  'mail_templates',
144  $this->ctrl->getLinkTargetByClass('ilmailtemplategui', 'showTemplates'),
145  '',
146  'ilmailtemplategui'
147  );
148  }
149 
150  if ($this->isPermissionChangeAllowed()) {
151  $this->tabs->addTarget(
152  'perm_settings',
153  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'),
154  array('perm', 'info', 'owner'),
155  'ilpermissiongui'
156  );
157  }
158  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isEditingAllowed()

ilObjMailGUI::isEditingAllowed ( )
private
Returns
bool

Definition at line 89 of file class.ilObjMailGUI.php.

Referenced by getExternalSettingsForm(), getGeneralSettingsForm(), saveExternalSettingsFormObject(), and saveObject().

90  {
91  return $this->rbacsystem->checkAccess('write', $this->object->getRefId());
92  }
+ Here is the caller graph for this function:

◆ isPermissionChangeAllowed()

ilObjMailGUI::isPermissionChangeAllowed ( )
private
Returns
bool

Definition at line 105 of file class.ilObjMailGUI.php.

Referenced by getTabs().

106  {
107  return $this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId());
108  }
+ Here is the caller graph for this function:

◆ isViewAllowed()

ilObjMailGUI::isViewAllowed ( )
private
Returns
bool

Definition at line 97 of file class.ilObjMailGUI.php.

Referenced by buildSettingsSubTabs(), executeCommand(), getTabs(), sendTestMail(), showExternalSettingsFormObject(), and showGeneralSettingsForm().

98  {
99  return $this->rbacsystem->checkAccess('read', $this->object->getRefId());
100  }
+ Here is the caller graph for this function:

◆ populateExternalSettingsForm()

ilObjMailGUI::populateExternalSettingsForm ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 560 of file class.ilObjMailGUI.php.

References ilMail\MAIL_SUBJECT_PREFIX, settings(), and ilPropertyFormGUI\setValuesByArray().

Referenced by showExternalSettingsFormObject().

561  {
562  $subjectPrefix = $this->settings->get('mail_subject_prefix');
563  if (false === $subjectPrefix) {
564  $subjectPrefix = ilMail::MAIL_SUBJECT_PREFIX;
565  }
566 
567  $form->setValuesByArray(array(
568  'mail_smtp_status' => (bool) $this->settings->get('mail_smtp_status'),
569  'mail_smtp_host' => $this->settings->get('mail_smtp_host'),
570  'mail_smtp_port' => (int) $this->settings->get('mail_smtp_port'),
571  'mail_smtp_user' => $this->settings->get('mail_smtp_user'),
572  'mail_smtp_password' => strlen($this->settings->get('mail_smtp_password')) > 0 ? self::PASSWORD_PLACE_HOLDER : '',
573  'mail_smtp_encryption' => $this->settings->get('mail_smtp_encryption'),
574  'mail_subject_prefix' => $subjectPrefix,
575  'mail_send_html' => (int) $this->settings->get('mail_send_html'),
576  'mail_system_usr_from_addr' => $this->settings->get('mail_system_usr_from_addr'),
577  'mail_system_usr_from_name' => $this->settings->get('mail_system_usr_from_name'),
578  'mail_system_usr_env_from_addr' => $this->settings->get('mail_system_usr_env_from_addr'),
579  'mail_system_sys_from_addr' => $this->settings->get('mail_system_sys_from_addr'),
580  'mail_system_sys_from_name' => $this->settings->get('mail_system_sys_from_name'),
581  'mail_system_sys_reply_to_addr' => $this->settings->get('mail_system_sys_reply_to_addr'),
582  'mail_system_sys_env_from_addr' => $this->settings->get('mail_system_sys_env_from_addr'),
583  'mail_system_sys_signature' => $this->settings->get('mail_system_sys_signature')
584  ));
585  }
settings()
Definition: settings.php:2
const MAIL_SUBJECT_PREFIX
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateGeneralSettingsForm()

ilObjMailGUI::populateGeneralSettingsForm ( ilPropertyFormGUI  $form)
protected
Parameters
ilPropertyFormGUI$form

Definition at line 284 of file class.ilObjMailGUI.php.

References ilMailOptions\FIRST_EMAIL, settings(), and ilPropertyFormGUI\setValuesByArray().

Referenced by showGeneralSettingsForm().

285  {
286  $form->setValuesByArray(array(
287  'mail_allow_external' => $this->settings->get('mail_allow_external'),
288  'incoming_type' => (int) $this->settings->get('mail_incoming_mail'),
289  'mail_address_option' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
290  'mail_address_option_both' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
291  'show_mail_settings' => $this->settings->get('show_mail_settings', 1),
292  'mail_maxsize_attach' => $this->settings->get('mail_maxsize_attach'),
293  'mail_notification' => $this->settings->get('mail_notification')
294  ));
295  }
settings()
Definition: settings.php:2
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveExternalSettingsFormObject()

ilObjMailGUI::saveExternalSettingsFormObject ( )
protected

Definition at line 590 of file class.ilObjMailGUI.php.

References $form, getExternalSettingsForm(), isEditingAllowed(), settings(), and showExternalSettingsFormObject().

591  {
592  if (!$this->isEditingAllowed()) {
593  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
594  }
595 
596  $form = $this->getExternalSettingsForm();
597  $isFormValid = $form->checkInput();
598 
599  if (!$isFormValid) {
600  $form->setValuesByPost();
602  return;
603  }
604 
605  $isSmtpEnabled = (bool) $form->getInput('mail_smtp_status');
606  if ($isSmtpEnabled && $form->getInput('mail_smtp_user') && !$form->getInput('mail_smtp_password')) {
607  $form->getItemByPostVar('mail_smtp_password')->setRequired(true);
608  $form->getItemByPostVar('mail_smtp_password')->setAlert($this->lng->txt('mail_smtp_password_req'));
609  $form->setValuesByPost();
611  return;
612  }
613 
614  $this->settings->set('mail_smtp_status', (int) $form->getInput('mail_smtp_status'));
615  $this->settings->set('mail_smtp_host', $form->getInput('mail_smtp_host'));
616  $this->settings->set('mail_smtp_port', (int) $form->getInput('mail_smtp_port'));
617  $this->settings->set('mail_smtp_user', $form->getInput('mail_smtp_user'));
618  if ($form->getInput('mail_smtp_password') != self::PASSWORD_PLACE_HOLDER) {
619  $this->settings->set('mail_smtp_password', $form->getInput('mail_smtp_password'));
620  }
621  $this->settings->set('mail_smtp_encryption', $form->getInput('mail_smtp_encryption'));
622 
623  $this->settings->set('mail_send_html', $form->getInput('mail_send_html'));
624  $this->settings->set('mail_subject_prefix', $form->getInput('mail_subject_prefix'));
625  $this->settings->set('mail_system_usr_from_addr', $form->getInput('mail_system_usr_from_addr'));
626  $this->settings->set('mail_system_usr_from_name', $form->getInput('mail_system_usr_from_name'));
627  $this->settings->set('mail_system_usr_env_from_addr', $form->getInput('mail_system_usr_env_from_addr'));
628  $this->settings->set('mail_system_sys_from_addr', $form->getInput('mail_system_sys_from_addr'));
629  $this->settings->set('mail_system_sys_from_name', $form->getInput('mail_system_sys_from_name'));
630  $this->settings->set('mail_system_sys_reply_to_addr', $form->getInput('mail_system_sys_reply_to_addr'));
631  $this->settings->set('mail_system_sys_env_from_addr', $form->getInput('mail_system_sys_env_from_addr'));
632  $this->settings->set('mail_system_sys_signature', $form->getInput('mail_system_sys_signature'));
633 
634  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
635  $this->ctrl->redirect($this, 'showExternalSettingsForm');
636  }
settings()
Definition: settings.php:2
showExternalSettingsFormObject(ilPropertyFormGUI $form=null)
if(isset($_POST['submit'])) $form
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ saveObject()

ilObjMailGUI::saveObject ( )

Definition at line 300 of file class.ilObjMailGUI.php.

References $form, ilMailOptions\FIRST_EMAIL, getGeneralSettingsForm(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, isEditingAllowed(), settings(), and showGeneralSettingsForm().

301  {
302  if (!$this->isEditingAllowed()) {
303  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
304  }
305 
306  $form = $this->getGeneralSettingsForm();
307  if ($form->checkInput()) {
308  $incoming_type = (int) $form->getInput('incoming_type');
309 
310  $mail_address_option = ilMailOptions::FIRST_EMAIL;
311  if ($incoming_type == ilMailOptions::INCOMING_EMAIL) {
312  $mail_address_option = (int) $form->getInput('mail_address_option');
313  } else {
314  if ($incoming_type == ilMailOptions::INCOMING_BOTH) {
315  $mail_address_option = (int) $form->getInput('mail_address_option_both');
316  }
317  }
318 
319  $this->settings->set('mail_allow_external', (int) $form->getInput('mail_allow_external'));
320  $this->settings->set('mail_incoming_mail', $incoming_type);
321  $this->settings->set('show_mail_settings', (int) $form->getInput('show_mail_settings'));
322 
323  $this->settings->set('mail_address_option', $mail_address_option);
324  $this->settings->set('mail_maxsize_attach', $form->getInput('mail_maxsize_attach'));
325  $this->settings->set('mail_notification', (int) $form->getInput('mail_notification'));
326 
327  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
328  $this->ctrl->redirect($this);
329  }
330 
331  $form->setValuesByPost();
333  }
settings()
Definition: settings.php:2
if(isset($_POST['submit'])) $form
redirection script todo: (a better solution should control the processing via a xml file) ...
showGeneralSettingsForm(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ sendTestMail()

ilObjMailGUI::sendTestMail (   $is_manual_mail = false)
protected
Parameters
bool$is_manual_mail

Definition at line 379 of file class.ilObjMailGUI.php.

References $GLOBALS, $type, isViewAllowed(), showExternalSettingsFormObject(), and user().

Referenced by sendTestSystemMailObject(), and sendTestUserMailObject().

380  {
381  if (!$this->isViewAllowed()) {
382  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
383  }
384 
385  if (strlen($GLOBALS['DIC']->user()->getEmail()) == 0) {
386  return $this->showExternalSettingsFormObject();
387  }
388 
389  if ($is_manual_mail) {
390  $mail = new ilMail($GLOBALS['DIC']->user()->getId());
391  $type = array('normal');
392  } else {
393  $mail = new ilMail(ANONYMOUS_USER_ID);
394  $type = array('system');
395  }
396 
397  $mail->setSaveInSentbox(false);
398  $mail->appendInstallationSignature(true);
399  $mail->sendMail($GLOBALS['DIC']->user()->getEmail(), '', '', 'Test Subject', 'Test Body', array(), $type);
400 
401  ilUtil::sendSuccess($this->lng->txt('mail_external_test_sent'));
403  }
$type
user()
Definition: user.php:4
showExternalSettingsFormObject(ilPropertyFormGUI $form=null)
redirection script todo: (a better solution should control the processing via a xml file) ...
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendTestSystemMailObject()

ilObjMailGUI::sendTestSystemMailObject ( )
protected

Definition at line 371 of file class.ilObjMailGUI.php.

References sendTestMail().

372  {
373  $this->sendTestMail();
374  }
sendTestMail($is_manual_mail=false)
+ Here is the call graph for this function:

◆ sendTestUserMailObject()

ilObjMailGUI::sendTestUserMailObject ( )
protected

Definition at line 366 of file class.ilObjMailGUI.php.

References sendTestMail().

367  {
368  $this->sendTestMail(true);
369  }
sendTestMail($is_manual_mail=false)
+ Here is the call graph for this function:

◆ showExternalSettingsFormObject()

ilObjMailGUI::showExternalSettingsFormObject ( ilPropertyFormGUI  $form = null)
protected
Parameters
ilPropertyFormGUI | null$form

Definition at line 338 of file class.ilObjMailGUI.php.

References $form, $GLOBALS, buildSettingsSubTabs(), getExternalSettingsForm(), ilLinkButton\getInstance(), isViewAllowed(), populateExternalSettingsForm(), and user().

Referenced by saveExternalSettingsFormObject(), and sendTestMail().

339  {
340  if (!$this->isViewAllowed()) {
341  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
342  }
343 
344  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_EXTERNAL);
345 
346  if ($form === null) {
347  $form = $this->getExternalSettingsForm();
348  $this->populateExternalSettingsForm($form);
349  }
350 
351  if (strlen($GLOBALS['DIC']->user()->getEmail()) > 0) {
352  $btn = ilLinkButton::getInstance();
353  $btn->setUrl($this->ctrl->getLinkTarget($this, 'sendTestUserMail'));
354  $btn->setCaption('mail_external_send_test_usr');
355  $GLOBALS['DIC']->toolbar()->addButtonInstance($btn);
356 
357  $btn = ilLinkButton::getInstance();
358  $btn->setUrl($this->ctrl->getLinkTarget($this, 'sendTestSystemMail'));
359  $btn->setCaption('mail_external_send_test_sys');
360  $GLOBALS['DIC']->toolbar()->addButtonInstance($btn);
361  }
362 
363  $this->tpl->setContent($form->getHTML());
364  }
user()
Definition: user.php:4
buildSettingsSubTabs($activeSubTab)
redirection script todo: (a better solution should control the processing via a xml file) ...
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
populateExternalSettingsForm(ilPropertyFormGUI $form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGeneralSettingsForm()

ilObjMailGUI::showGeneralSettingsForm ( ilPropertyFormGUI  $form = null)
protected
Parameters
ilPropertyFormGUI | null$form

Definition at line 195 of file class.ilObjMailGUI.php.

References $form, buildSettingsSubTabs(), getGeneralSettingsForm(), isViewAllowed(), and populateGeneralSettingsForm().

Referenced by saveObject(), and viewObject().

196  {
197  if (!$this->isViewAllowed()) {
198  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
199  }
200 
201  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_GENERAL);
202 
203  if ($form === null) {
204  $form = $this->getGeneralSettingsForm();
205  $this->populateGeneralSettingsForm($form);
206  }
207 
208  $this->tpl->setContent($form->getHTML());
209  }
populateGeneralSettingsForm(ilPropertyFormGUI $form)
buildSettingsSubTabs($activeSubTab)
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewObject()

ilObjMailGUI::viewObject ( )

Definition at line 187 of file class.ilObjMailGUI.php.

References showGeneralSettingsForm().

188  {
189  $this->showGeneralSettingsForm();
190  }
showGeneralSettingsForm(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

Field Documentation

◆ $rbacsystem

ilObjMailGUI::$rbacsystem
protected

Definition at line 24 of file class.ilObjMailGUI.php.

◆ $settings

ilObjMailGUI::$settings
protected

Definition at line 29 of file class.ilObjMailGUI.php.

◆ $tabs

ilObjMailGUI::$tabs
protected

Definition at line 19 of file class.ilObjMailGUI.php.

◆ PASSWORD_PLACE_HOLDER

const ilObjMailGUI::PASSWORD_PLACE_HOLDER = '***********************'

Definition at line 14 of file class.ilObjMailGUI.php.

◆ SETTINGS_SUB_TAB_ID_EXTERNAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_EXTERNAL = 2

Definition at line 12 of file class.ilObjMailGUI.php.

◆ SETTINGS_SUB_TAB_ID_GENERAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_GENERAL = 1

Definition at line 11 of file class.ilObjMailGUI.php.


The documentation for this class was generated from the following file: