ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailOptionsFormGUI Class Reference

Class ilMailOptionsFormGUI. More...

+ Inheritance diagram for ilMailOptionsFormGUI:
+ Collaboration diagram for ilMailOptionsFormGUI:

Public Member Functions

 __construct (ilMailOptions $options, $parentGui, $positiveCmd)
 ilMailOptionsFormGUI constructor. More...
 
 save ()
 
 populate ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var, $a_remove_unused_headers=false)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ( $a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Protected Member Functions

 init ()
 
- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

Protected Attributes

 $lng
 
 $settings
 
 $user
 
 $ctrl
 
 $parentGui
 
 $positiveCmd = ''
 
 $options
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

Class ilMailOptionsFormGUI.

Definition at line 10 of file class.ilMailOptionsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailOptionsFormGUI::__construct ( ilMailOptions  $options,
  $parentGui,
  $positiveCmd 
)

ilMailOptionsFormGUI constructor.

Parameters
ilMailOptions$options
$parentGui
string$positiveCmd
Exceptions

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

References $DIC, $options, $parentGui, $positiveCmd, init(), settings(), and user().

55  {
56  global $DIC;
57 
58  if (!method_exists($parentGui, 'executeCommand')) {
59  throw new \InvalidArgumentException(sprintf(
60  'Parameter $parentGui must be ilCtrl enabled by implementing executeCommand(), %s given.',
61  is_object($parentGui) ? get_class($parentGui) : var_export($parentGui, 1)
62  ));
63  }
64 
65  parent::__construct();
66 
67  $this->ctrl = $DIC->ctrl();
68  $this->settings = $DIC->settings();
69  $this->lng = $DIC->language();
70  $this->user = $DIC->user();
71 
72  $this->options = $options;
73  $this->parentGui = $parentGui;
74  $this->positiveCmd = $positiveCmd;
75 
76  $this->init();
77  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ init()

ilMailOptionsFormGUI::init ( )
protected

Definition at line 82 of file class.ilMailOptionsFormGUI.php.

References $i, $options, $si, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), array, ilFormGUI\setFormAction(), ilFormPropertyGUI\setInfo(), ilTextAreaInputGUI\setRows(), settings(), and ilPropertyFormGUI\setTitle().

Referenced by __construct().

83  {
84  $this->setTitle($this->lng->txt('mail_settings'));
85  $this->setFormAction($this->ctrl->getFormAction($this->parentGui, $this->positiveCmd));
86 
87  if ($this->settings->get('usr_settings_hide_mail_incoming_mail') != '1') {
88  require_once 'Services/Mail/classes/Form/class.ilIncomingMailInputGUI.php';
89  $incoming_mail_gui = new ilIncomingMailInputGUI($this->lng->txt('mail_incoming'), 'incoming_type', false);
90  $this->addItem($incoming_mail_gui);
91  }
92 
93  $options = array();
94  for ($i = 50; $i <= 80; $i++) {
95  $options[$i] = $i;
96  }
97  $si = new ilSelectInputGUI($this->lng->txt('linebreak'), 'linebreak');
98  $si->setOptions($options);
99  $this->addItem($si);
100 
101  $ta = new ilTextAreaInputGUI($this->lng->txt('signature'), 'signature');
102  $ta->setRows(10);
103  $ta->setCols(60);
104  $this->addItem($ta);
105 
106  if ($this->settings->get('mail_notification')) {
107  $cb = new ilCheckboxInputGUI($this->lng->txt('cron_mail_notification'), 'cronjob_notification');
108  $cb->setInfo($this->lng->txt('mail_cronjob_notification_info'));
109  $cb->setValue(1);
110  $this->addItem($cb);
111  }
112 
113  $this->addCommandButton($this->positiveCmd, $this->lng->txt('save'));
114  }
This class represents a selection list property in a property form.
This class represents a checkbox property in a property form.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
setInfo($a_info)
Set Information Text.
setTitle($a_title)
Set Title.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
Create styles array
The data for the language used.
settings()
Definition: settings.php:2
This class represents a text area property in a property form.
$i
Definition: disco.tpl.php:19
Class ilIncomingMailInputGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populate()

ilMailOptionsFormGUI::populate ( )

Definition at line 160 of file class.ilMailOptionsFormGUI.php.

References $data, array, settings(), and ilPropertyFormGUI\setValuesByArray().

161  {
162  $data = array(
163  'linebreak' => $this->options->getLinebreak(),
164  'signature' => $this->options->getSignature(),
165  'cronjob_notification' => $this->options->getCronjobNotification()
166  );
167 
168  if ($this->settings->get('usr_settings_hide_mail_incoming_mail') != '1') {
169  $data['incoming_type'] = $this->options->getIncomingType();
170 
171  $mail_address_option = $this->options->getMailAddressOption();
172 
173  $data['mail_address_option'] = $mail_address_option;
174  $data['mail_address_option_both'] = $mail_address_option;
175  }
176 
177  $this->setValuesByArray($data);
178  }
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:

◆ save()

ilMailOptionsFormGUI::save ( )
Returns
bool

Definition at line 119 of file class.ilMailOptionsFormGUI.php.

References ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, and settings().

120  {
121  if (!$this->checkInput()) {
122  return false;
123  }
124 
125  if (
126  $this->settings->get('usr_settings_hide_mail_incoming_mail') != '1' &&
127  $this->settings->get('usr_settings_disable_mail_incoming_mail') != '1'
128  ) {
129  $incoming_type = (int) $this->getInput('incoming_type');
130 
131  $mail_address_option = $this->options->getMailAddressOption();
132  switch ($incoming_type) {
134  $mail_address_option = (int) $this->getInput('mail_address_option');
135  break;
136 
138  $mail_address_option = (int) $this->getInput('mail_address_option_both');
139  break;
140  }
141  } else {
142  $incoming_type = $this->options->getIncomingType();
143  $mail_address_option = $this->options->getMailAddressOption();
144  }
145 
146  $this->options->setLinebreak((int) $this->getInput('linebreak'));
147  $this->options->setSignature($this->getInput('signature'));
148  $this->options->setCronjobNotification((int) $this->getInput('cronjob_notification'));
149  $this->options->setIncomingType($incoming_type);
150  $this->options->setMailAddressOption($mail_address_option);
151 
152  $this->options->updateOptions();
153 
154  return true;
155  }
checkInput()
Check Post Input.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilMailOptionsFormGUI::$ctrl
protected

Definition at line 30 of file class.ilMailOptionsFormGUI.php.

◆ $lng

ilMailOptionsFormGUI::$lng
protected

Definition at line 15 of file class.ilMailOptionsFormGUI.php.

◆ $options

ilMailOptionsFormGUI::$options
protected

Definition at line 45 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct(), and init().

◆ $parentGui

ilMailOptionsFormGUI::$parentGui
protected

Definition at line 35 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct().

◆ $positiveCmd

ilMailOptionsFormGUI::$positiveCmd = ''
protected

Definition at line 40 of file class.ilMailOptionsFormGUI.php.

Referenced by __construct().

◆ $settings

ilMailOptionsFormGUI::$settings
protected

Definition at line 20 of file class.ilMailOptionsFormGUI.php.

◆ $user

ilMailOptionsFormGUI::$user
protected

Definition at line 25 of file class.ilMailOptionsFormGUI.php.


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