ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilIncomingMailInputGUI Class Reference
+ Inheritance diagram for ilIncomingMailInputGUI:
+ Collaboration diagram for ilIncomingMailInputGUI:

Public Member Functions

 __construct (string $title='', string $post_var='', bool $free_option_choice=true)
 
 getOptions ()
 
 setValueByArray ($a_values)
 
 checkInput ()
 
 render ()
 
 getItemByPostVar (string $a_post_var)
 
 getSubInputItemsRecursive ()
 
 isFreeOptionChoice ()
 
 setFreeOptionChoice (bool $free_option_choice)
 
- Public Member Functions inherited from ilRadioGroupInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 addOption (ilRadioOption $a_option)
 
 getOptions ()
 
 setValue (string $a_value)
 
 getValue ()
 
 setValueByArray (array $a_values)
 
 checkInput ()
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 render ()
 
 getItemByPostVar (string $a_post_var)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getFormLabelFor ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 

Protected Member Functions

 initializeOptions ()
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

bool $free_option_choice = true
 
bool $options_initialized = false
 
- Protected Attributes inherited from ilRadioGroupInputGUI
array $options = array()
 
string $value = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Private Member Functions

 addSubOptions ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilIncomingMailInputGUI::__construct ( string  $title = '',
string  $post_var = '',
bool  $free_option_choice = true 
)

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

References ilFormPropertyGUI\$title, ILIAS\GlobalScreen\Provider\__construct(), and setFreeOptionChoice().

27  {
28  parent::__construct($title, $post_var);
30  }
setFreeOptionChoice(bool $free_option_choice)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addSubOptions()

ilIncomingMailInputGUI::addSubOptions ( )
private

Definition at line 86 of file class.ilIncomingMailInputGUI.php.

References $DIC, ilRadioGroupInputGUI\addOption(), ilMailOptions\BOTH_EMAIL, ilMailOptions\FIRST_EMAIL, ilFormPropertyGUI\getDisabled(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, ilMailOptions\INCOMING_LOCAL, isFreeOptionChoice(), ilMailOptions\SECOND_EMAIL, and ilFormPropertyGUI\setDisabled().

Referenced by initializeOptions().

86  : void
87  {
88  global $DIC;
89 
90  $incoming_local = new ilRadioOption(
91  $DIC->language()->txt('mail_incoming_local'),
93  );
94  $incoming_local->setDisabled($this->getDisabled());
95 
96  $incoming_external = new ilRadioOption(
97  $DIC->language()->txt('mail_incoming_smtp'),
99  );
100  $incoming_external->setDisabled($this->getDisabled());
101 
102  $incoming_both = new ilRadioOption(
103  $DIC->language()->txt('mail_incoming_both'),
105  );
106  $incoming_both->setDisabled($this->getDisabled());
107 
108  $this->addOption($incoming_local);
109  $this->addOption($incoming_external);
110  $this->addOption($incoming_both);
111 
112  $incoming_external_address_choice = new ilRadioGroupInputGUI('', 'mail_address_option');
113  $incoming_external_address_choice->setDisabled($this->getDisabled());
114 
115  $sub_mail_opt1 = new ilRadioOption(
116  $DIC->language()->txt('mail_first_email'),
118  );
119  $sub_mail_opt1->setDisabled($this->getDisabled());
120 
121  $sub_mail_opt2 = new ilRadioOption(
122  $DIC->language()->txt('mail_second_email'),
124  );
125  $sub_mail_opt2->setDisabled($this->getDisabled());
126  $sub_mail_opt3 = new ilRadioOption(
127  $DIC->language()->txt('mail_both_email'),
129  );
130  $sub_mail_opt3->setDisabled($this->getDisabled());
131 
132  $incoming_both_address_choice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
133  $incoming_both_address_choice->setDisabled($this->getDisabled());
134  $sub_both_opt1 = new ilRadioOption(
135  $DIC->language()->txt('mail_first_email'),
137  );
138  $sub_both_opt1->setDisabled($this->getDisabled());
139 
140  $sub_both_opt2 = new ilRadioOption(
141  $DIC->language()->txt('mail_second_email'),
143  );
144  $sub_both_opt2->setDisabled($this->getDisabled());
145  $sub_both_opt3 = new ilRadioOption(
146  $DIC->language()->txt('mail_both_email'),
148  );
149  $sub_both_opt3->setDisabled($this->getDisabled());
150  if ($this->isFreeOptionChoice()) {
151  $incoming_external_address_choice->addOption($sub_mail_opt1);
152  $incoming_external_address_choice->addOption($sub_mail_opt2);
153  $incoming_external_address_choice->addOption($sub_mail_opt3);
154  $incoming_both_address_choice->addOption($sub_both_opt1);
155  $incoming_both_address_choice->addOption($sub_both_opt2);
156  $incoming_both_address_choice->addOption($sub_both_opt3);
157 
158  $incoming_external->addSubItem($incoming_external_address_choice);
159  $incoming_both->addSubItem($incoming_both_address_choice);
160  } else {
161  $email_info = [];
162  if (
163  $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
164  $this->setDisabled(true);
165  }
166 
167  if ($DIC->user()->getEmail() === '') {
168  $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
169  $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
170  $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
171  $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
172  } else {
173  $email_info[] = $DIC->user()->getEmail();
174  }
175  if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
176  $sub_mail_opt1->setDisabled(true);
177  $sub_mail_opt3->setDisabled(true);
178  $sub_both_opt1->setDisabled(true);
179  $sub_both_opt3->setDisabled(true);
180  }
181 
182  if ($DIC->user()->getSecondEmail() === '') {
183  $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
184  $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
185  $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
186  $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
187  } else {
188  $email_info[] = $DIC->user()->getSecondEmail();
189  }
190  if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
191  $sub_mail_opt2->setDisabled(true);
192  $sub_mail_opt3->setDisabled(true);
193  $sub_both_opt2->setDisabled(true);
194  $sub_both_opt3->setDisabled(true);
195  }
196 
197  if (count($email_info) > 1) {
198  $sub_mail_opt1->setInfo($email_info[0]);
199  $sub_both_opt1->setInfo($email_info[0]);
200  $sub_mail_opt2->setInfo($email_info[1]);
201  $sub_both_opt2->setInfo($email_info[1]);
202  $sub_mail_opt3->setInfo(implode(', ', $email_info));
203  $sub_both_opt3->setInfo(implode(', ', $email_info));
204  }
205 
206  if (count($email_info) === 1) {
207  $incoming_external->setInfo($email_info[0]);
208  $incoming_both->setInfo($email_info[0]);
209  } else {
210  $incoming_external_address_choice->addOption($sub_mail_opt1);
211  $incoming_external_address_choice->addOption($sub_mail_opt2);
212  $incoming_external_address_choice->addOption($sub_mail_opt3);
213 
214  $incoming_both_address_choice->addOption($sub_both_opt1);
215  $incoming_both_address_choice->addOption($sub_both_opt2);
216  $incoming_both_address_choice->addOption($sub_both_opt3);
217 
218  $incoming_external->addSubItem($incoming_external_address_choice);
219  $incoming_both->addSubItem($incoming_both_address_choice);
220  }
221  }
222  }
This class represents an option in a radio group.
final const int SECOND_EMAIL
final const int INCOMING_BOTH
final const int INCOMING_LOCAL
final const int INCOMING_EMAIL
addOption(ilRadioOption $a_option)
This class represents a property in a property form.
global $DIC
Definition: shib_login.php:26
final const int BOTH_EMAIL
setDisabled(bool $a_disabled)
final const int FIRST_EMAIL
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkInput()

ilIncomingMailInputGUI::checkInput ( )

Definition at line 52 of file class.ilIncomingMailInputGUI.php.

References initializeOptions().

52  : bool
53  {
54  $this->initializeOptions();
55  return parent::checkInput();
56  }
+ Here is the call graph for this function:

◆ getItemByPostVar()

ilIncomingMailInputGUI::getItemByPostVar ( string  $a_post_var)

Definition at line 64 of file class.ilIncomingMailInputGUI.php.

References initializeOptions().

65  {
66  $this->initializeOptions();
67  return parent::getItemByPostVar($a_post_var);
68  }
+ Here is the call graph for this function:

◆ getOptions()

ilIncomingMailInputGUI::getOptions ( )

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

References initializeOptions().

40  : array
41  {
42  $this->initializeOptions();
43  return parent::getOptions();
44  }
+ Here is the call graph for this function:

◆ getSubInputItemsRecursive()

ilIncomingMailInputGUI::getSubInputItemsRecursive ( )

Definition at line 70 of file class.ilIncomingMailInputGUI.php.

References initializeOptions().

70  : array
71  {
72  $this->initializeOptions();
73  return parent::getSubInputItemsRecursive();
74  }
+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

Definition at line 32 of file class.ilIncomingMailInputGUI.php.

References addSubOptions().

Referenced by checkInput(), getItemByPostVar(), getOptions(), getSubInputItemsRecursive(), render(), and setValueByArray().

32  : void
33  {
34  if (!$this->options_initialized) {
35  $this->addSubOptions();
36  $this->options_initialized = true;
37  }
38  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFreeOptionChoice()

ilIncomingMailInputGUI::isFreeOptionChoice ( )

Definition at line 76 of file class.ilIncomingMailInputGUI.php.

References $free_option_choice.

Referenced by addSubOptions().

76  : bool
77  {
79  }
+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

Definition at line 58 of file class.ilIncomingMailInputGUI.php.

References initializeOptions().

58  : string
59  {
60  $this->initializeOptions();
61  return parent::render();
62  }
+ Here is the call graph for this function:

◆ setFreeOptionChoice()

ilIncomingMailInputGUI::setFreeOptionChoice ( bool  $free_option_choice)

Definition at line 81 of file class.ilIncomingMailInputGUI.php.

References $free_option_choice.

Referenced by __construct().

81  : void
82  {
83  $this->free_option_choice = $free_option_choice;
84  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

Definition at line 46 of file class.ilIncomingMailInputGUI.php.

References initializeOptions().

46  : void
47  {
48  $this->initializeOptions();
49  parent::setValueByArray($a_values);
50  }
+ Here is the call graph for this function:

Field Documentation

◆ $free_option_choice

bool ilIncomingMailInputGUI::$free_option_choice = true
protected

Definition at line 23 of file class.ilIncomingMailInputGUI.php.

Referenced by isFreeOptionChoice(), and setFreeOptionChoice().

◆ $options_initialized

bool ilIncomingMailInputGUI::$options_initialized = false
protected

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


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