ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 

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
 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
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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 39 of file class.ilObjMailGUI.php.

References $DIC, and settings().

40  {
41  global $DIC;
42 
43  $this->type = 'mail';
44  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
45 
46  $this->tabs = $DIC->tabs();
47  $this->rbacsystem = $DIC->rbac()->system();
48  $this->settings = $DIC['ilSetting'];
49 
50  $this->lng->loadLanguageModule('mail');
51  }
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2
+ 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 644 of file class.ilObjMailGUI.php.

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

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

◆ buildSettingsSubTabs()

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

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

References isViewAllowed(), and settings().

Referenced by showExternalSettingsFormObject(), and showGeneralSettingsForm().

168  {
169  if ($this->isViewAllowed()) {
170  $this->tabs->addSubTab(
171  self::SETTINGS_SUB_TAB_ID_GENERAL,
172  $this->lng->txt('mail_settings_general_tab'),
173  $this->ctrl->getLinkTarget($this, 'view')
174  );
175 
176  if ($this->settings->get('mail_allow_external')) {
177  $this->tabs->addSubTab(
178  self::SETTINGS_SUB_TAB_ID_EXTERNAL,
179  $this->lng->txt('mail_settings_external_tab'),
180  $this->ctrl->getLinkTarget($this, 'showExternalSettingsForm')
181  );
182  }
183 
184  $this->tabs->activateSubTab($activeSubTab);
185  }
186  }
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 56 of file class.ilObjMailGUI.php.

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

57  {
58  $next_class = $this->ctrl->getNextClass($this);
59  $cmd = $this->ctrl->getCmd();
60  $this->prepareOutput();
61 
62  switch ($next_class) {
63  case 'ilpermissiongui':
64  require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
65  $perm_gui = new ilPermissionGUI($this);
66  $this->ctrl->forwardCommand($perm_gui);
67  break;
68 
69  case 'ilmailtemplategui':
70  if (!$this->isViewAllowed()) {
71  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
72  }
73 
74  require_once 'Services/Mail/classes/class.ilMailTemplateGUI.php';
75  $this->ctrl->forwardCommand(new ilMailTemplateGUI($this->object));
76  break;
77 
78  default:
79  if (!$cmd) {
80  $cmd = 'view';
81  }
82  $cmd .= 'Object';
83  $this->$cmd();
84  break;
85  }
86 
87  return true;
88  }
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 117 of file class.ilObjMailGUI.php.

References getTabs().

118  {
119  $this->getTabs();
120  }
+ Here is the call graph for this function:

◆ getExternalSettingsForm()

ilObjMailGUI::getExternalSettingsForm ( )
protected
Returns
ilPropertyFormGUI

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

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

Referenced by saveExternalSettingsFormObject(), and showExternalSettingsFormObject().

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

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

Referenced by saveObject(), and showGeneralSettingsForm().

219  {
220  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
221  $form = new ilPropertyFormGUI();
222 
223  $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
224  $form->setTitle($this->lng->txt('general_settings'));
225 
226  $cb = new ilCheckboxInputGUI($this->lng->txt('mail_allow_external'), 'mail_allow_external');
227  $cb->setInfo($this->lng->txt('mail_allow_external_info'));
228  $cb->setValue(1);
229  $cb->setDisabled(!$this->isEditingAllowed());
230  $form->addItem($cb);
231 
232  include_once 'Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php';
233  $incoming_mail_gui = new ilIncomingMailInputGUI($this->lng->txt('mail_incoming'), 'incoming_type');
234  $incoming_mail_gui->setDisabled(!$this->isEditingAllowed());
235  $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
236  $incoming_mail_gui->setInfo(sprintf(
237  $this->lng->txt('mail_settings_incoming_type_see_also'),
238  $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')
239  ));
240  $this->ctrl->clearParametersByClass('ilobjuserfoldergui');
241  $form->addItem($incoming_mail_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 
268  require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
271  $form,
272  $this
273  );
274 
275  if ($this->isEditingAllowed()) {
276  $form->addCommandButton('save', $this->lng->txt('save'));
277  }
278 
279  return $form;
280  }
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.
Create styles array
The data for the language used.
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 125 of file class.ilObjMailGUI.php.

References array, isPermissionChangeAllowed(), and isViewAllowed().

Referenced by getAdminTabs().

126  {
127  if ($this->isViewAllowed()) {
128  $this->tabs->addTarget(
129  'settings',
130  $this->ctrl->getLinkTarget($this, 'view'),
131  array(
132  'view',
133  'save',
134  '',
135  'showExternalSettingsForm',
136  'saveExternalSettingsForm',
137  'sendTestUserMail',
138  'sendTestSystemMail'
139  ),
140  '',
141  ''
142  );
143  }
144 
145  if ($this->isViewAllowed()) {
146  $this->tabs->addTarget(
147  'mail_templates',
148  $this->ctrl->getLinkTargetByClass('ilmailtemplategui', 'showTemplates'),
149  '',
150  'ilmailtemplategui'
151  );
152  }
153 
154  if ($this->isPermissionChangeAllowed()) {
155  $this->tabs->addTarget(
156  'perm_settings',
157  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'),
158  array('perm', 'info', 'owner'),
159  'ilpermissiongui'
160  );
161  }
162  }
Create styles array
The data for the language used.
+ 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 93 of file class.ilObjMailGUI.php.

References object.

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

94  {
95  return $this->rbacsystem->checkAccess('write', $this->object->getRefId());
96  }
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ isPermissionChangeAllowed()

ilObjMailGUI::isPermissionChangeAllowed ( )
private
Returns
bool

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

References object.

Referenced by getTabs().

110  {
111  return $this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId());
112  }
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ isViewAllowed()

ilObjMailGUI::isViewAllowed ( )
private
Returns
bool

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

References object.

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

102  {
103  return $this->rbacsystem->checkAccess('read', $this->object->getRefId());
104  }
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ populateExternalSettingsForm()

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

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

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

Referenced by showExternalSettingsFormObject().

564  {
565  $subjectPrefix = $this->settings->get('mail_subject_prefix');
566  if (false === $subjectPrefix) {
567  $subjectPrefix = ilMail::MAIL_SUBJECT_PREFIX;
568  }
569 
570  $form->setValuesByArray(array(
571  'mail_smtp_status' => (bool) $this->settings->get('mail_smtp_status'),
572  'mail_smtp_host' => $this->settings->get('mail_smtp_host'),
573  'mail_smtp_port' => (int) $this->settings->get('mail_smtp_port'),
574  'mail_smtp_user' => $this->settings->get('mail_smtp_user'),
575  'mail_smtp_password' => strlen($this->settings->get('mail_smtp_password')) > 0 ? self::PASSWORD_PLACE_HOLDER : '',
576  'mail_smtp_encryption' => $this->settings->get('mail_smtp_encryption'),
577  'mail_subject_prefix' => $subjectPrefix,
578  'mail_send_html' => (int) $this->settings->get('mail_send_html'),
579  'mail_system_usr_from_addr' => $this->settings->get('mail_system_usr_from_addr'),
580  'mail_system_usr_from_name' => $this->settings->get('mail_system_usr_from_name'),
581  'mail_system_usr_env_from_addr' => $this->settings->get('mail_system_usr_env_from_addr'),
582  'mail_system_sys_from_addr' => $this->settings->get('mail_system_sys_from_addr'),
583  'mail_system_sys_from_name' => $this->settings->get('mail_system_sys_from_name'),
584  'mail_system_sys_reply_to_addr' => $this->settings->get('mail_system_sys_reply_to_addr'),
585  'mail_system_sys_env_from_addr' => $this->settings->get('mail_system_sys_env_from_addr'),
586  'mail_system_sys_signature' => $this->settings->get('mail_system_sys_signature')
587  ));
588  }
const MAIL_SUBJECT_PREFIX
Create styles array
The data for the language used.
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:

◆ populateGeneralSettingsForm()

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

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

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

Referenced by showGeneralSettingsForm().

286  {
287  $form->setValuesByArray(array(
288  'mail_allow_external' => $this->settings->get('mail_allow_external'),
289  'incoming_type' => (int) $this->settings->get('mail_incoming_mail'),
290  'mail_address_option' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
291  'mail_address_option_both' => strlen($this->settings->get('mail_address_option')) ? $this->settings->get('mail_address_option') : ilMailOptions::FIRST_EMAIL,
292  'mail_maxsize_attach' => $this->settings->get('mail_maxsize_attach'),
293  'mail_notification' => $this->settings->get('mail_notification')
294  ));
295  }
Create styles array
The data for the language used.
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 593 of file class.ilObjMailGUI.php.

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

594  {
595  if (!$this->isEditingAllowed()) {
596  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
597  }
598 
599  $form = $this->getExternalSettingsForm();
600  $isFormValid = $form->checkInput();
601 
602  if (!$isFormValid) {
603  $form->setValuesByPost();
605  return;
606  }
607 
608  $isSmtpEnabled = (bool) $form->getInput('mail_smtp_status');
609  if ($isSmtpEnabled && $form->getInput('mail_smtp_user') && !$form->getInput('mail_smtp_password')) {
610  $form->getItemByPostVar('mail_smtp_password')->setRequired(true);
611  $form->getItemByPostVar('mail_smtp_password')->setAlert($this->lng->txt('mail_smtp_password_req'));
612  $form->setValuesByPost();
614  return;
615  }
616 
617  $this->settings->set('mail_smtp_status', (int) $form->getInput('mail_smtp_status'));
618  $this->settings->set('mail_smtp_host', $form->getInput('mail_smtp_host'));
619  $this->settings->set('mail_smtp_port', (int) $form->getInput('mail_smtp_port'));
620  $this->settings->set('mail_smtp_user', $form->getInput('mail_smtp_user'));
621  if ($form->getInput('mail_smtp_password') != self::PASSWORD_PLACE_HOLDER) {
622  $this->settings->set('mail_smtp_password', $form->getInput('mail_smtp_password'));
623  }
624  $this->settings->set('mail_smtp_encryption', $form->getInput('mail_smtp_encryption'));
625 
626  $this->settings->set('mail_send_html', $form->getInput('mail_send_html'));
627  $this->settings->set('mail_subject_prefix', $form->getInput('mail_subject_prefix'));
628  $this->settings->set('mail_system_usr_from_addr', $form->getInput('mail_system_usr_from_addr'));
629  $this->settings->set('mail_system_usr_from_name', $form->getInput('mail_system_usr_from_name'));
630  $this->settings->set('mail_system_usr_env_from_addr', $form->getInput('mail_system_usr_env_from_addr'));
631  $this->settings->set('mail_system_sys_from_addr', $form->getInput('mail_system_sys_from_addr'));
632  $this->settings->set('mail_system_sys_from_name', $form->getInput('mail_system_sys_from_name'));
633  $this->settings->set('mail_system_sys_reply_to_addr', $form->getInput('mail_system_sys_reply_to_addr'));
634  $this->settings->set('mail_system_sys_env_from_addr', $form->getInput('mail_system_sys_env_from_addr'));
635  $this->settings->set('mail_system_sys_signature', $form->getInput('mail_system_sys_signature'));
636 
637  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
638  $this->ctrl->redirect($this, 'showExternalSettingsForm');
639  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showExternalSettingsFormObject(ilPropertyFormGUI $form=null)
if(isset($_POST['submit'])) $form
redirection script todo: (a better solution should control the processing via a xml file) ...
settings()
Definition: settings.php:2
+ 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(), ilUtil\sendSuccess(), 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('mail_address_option', $mail_address_option);
322  $this->settings->set('mail_maxsize_attach', $form->getInput('mail_maxsize_attach'));
323  $this->settings->set('mail_notification', (int) $form->getInput('mail_notification'));
324 
325  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
326  $this->ctrl->redirect($this);
327  }
328 
329  $form->setValuesByPost();
331  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(isset($_POST['submit'])) $form
redirection script todo: (a better solution should control the processing via a xml file) ...
showGeneralSettingsForm(ilPropertyFormGUI $form=null)
settings()
Definition: settings.php:2
+ 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, array, isViewAllowed(), ilUtil\sendSuccess(), 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  require_once 'Services/Mail/classes/class.ilMail.php';
390  if ($is_manual_mail) {
391  $mail = new ilMail($GLOBALS['DIC']->user()->getId());
392  $type = array('normal');
393  } else {
394  $mail = new ilMail(ANONYMOUS_USER_ID);
395  $type = array('system');
396  }
397 
398  $mail->setSaveInSentbox(false);
399  $mail->appendInstallationSignature(true);
400  $mail->sendMail($GLOBALS['DIC']->user()->getEmail(), '', '', 'Test Subject', 'Test Body', array(), $type);
401 
402  ilUtil::sendSuccess($this->lng->txt('mail_external_test_sent'));
404  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$type
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
user()
Definition: user.php:4
showExternalSettingsFormObject(ilPropertyFormGUI $form=null)
This class handles base functions for mail handling.
redirection script todo: (a better solution should control the processing via a xml file) ...
Create styles array
The data for the language used.
+ 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 336 of file class.ilObjMailGUI.php.

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

Referenced by saveExternalSettingsFormObject(), and sendTestMail().

337  {
338  if (!$this->isViewAllowed()) {
339  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
340  }
341 
342  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_EXTERNAL);
343 
344  if ($form === null) {
345  $form = $this->getExternalSettingsForm();
346  $this->populateExternalSettingsForm($form);
347  }
348 
349  if (strlen($GLOBALS['DIC']->user()->getEmail()) > 0) {
350  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
351 
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  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
user()
Definition: user.php:4
buildSettingsSubTabs($activeSubTab)
redirection script todo: (a better solution should control the processing via a xml file) ...
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 199 of file class.ilObjMailGUI.php.

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

Referenced by saveObject(), and viewObject().

200  {
201  if (!$this->isViewAllowed()) {
202  $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
203  }
204 
205  $this->buildSettingsSubTabs(self::SETTINGS_SUB_TAB_ID_GENERAL);
206 
207  if ($form === null) {
208  $form = $this->getGeneralSettingsForm();
209  $this->populateGeneralSettingsForm($form);
210  }
211 
212  $this->tpl->setContent($form->getHTML());
213  }
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 191 of file class.ilObjMailGUI.php.

References showGeneralSettingsForm().

192  {
193  $this->showGeneralSettingsForm();
194  }
showGeneralSettingsForm(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

Field Documentation

◆ $rbacsystem

ilObjMailGUI::$rbacsystem
protected

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

◆ $settings

ilObjMailGUI::$settings
protected

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

◆ $tabs

ilObjMailGUI::$tabs
protected

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

◆ PASSWORD_PLACE_HOLDER

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

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

◆ SETTINGS_SUB_TAB_ID_EXTERNAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_EXTERNAL = 2

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

◆ SETTINGS_SUB_TAB_ID_GENERAL

const ilObjMailGUI::SETTINGS_SUB_TAB_ID_GENERAL = 1

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


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