ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 Check input, strip slashes etc. More...
 
 render ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 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 ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 insert (ilTemplate $a_tpl)
 
 render ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
- 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)
 Get item by post var. More...
 
- 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
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 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 23 of file class.ilIncomingMailInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

29 {
30 parent::__construct($title, $post_var);
32 }
setFreeOptionChoice(bool $free_option_choice)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubOptions()

ilIncomingMailInputGUI::addSubOptions ( )
private

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

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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkInput()

ilIncomingMailInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Reimplemented from ilRadioGroupInputGUI.

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

54 : bool
55 {
56 $this->initializeOptions();
57 return parent::checkInput();
58 }

References initializeOptions().

+ Here is the call graph for this function:

◆ getItemByPostVar()

ilIncomingMailInputGUI::getItemByPostVar ( string  $a_post_var)

Get item by post var.

Reimplemented from ilRadioGroupInputGUI.

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

67 {
68 $this->initializeOptions();
69 return parent::getItemByPostVar($a_post_var);
70 }
This class represents a property in a property form.

References initializeOptions().

+ Here is the call graph for this function:

◆ getOptions()

ilIncomingMailInputGUI::getOptions ( )

Reimplemented from ilRadioGroupInputGUI.

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

42 : array
43 {
44 $this->initializeOptions();
45 return parent::getOptions();
46 }

References initializeOptions().

+ Here is the call graph for this function:

◆ getSubInputItemsRecursive()

ilIncomingMailInputGUI::getSubInputItemsRecursive ( )

returns a flat array of possibly existing subitems recursively

Reimplemented from ilSubEnabledFormPropertyGUI.

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

72 : array
73 {
74 $this->initializeOptions();
75 return parent::getSubInputItemsRecursive();
76 }

References initializeOptions().

+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

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

34 : void
35 {
36 if (!$this->options_initialized) {
37 $this->addSubOptions();
38 $this->options_initialized = true;
39 }
40 }

References addSubOptions().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFreeOptionChoice()

ilIncomingMailInputGUI::isFreeOptionChoice ( )

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

78 : bool
79 {
81 }

References $free_option_choice.

Referenced by addSubOptions().

+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

Reimplemented from ilRadioGroupInputGUI.

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

60 : string
61 {
62 $this->initializeOptions();
63 return parent::render();
64 }

References initializeOptions().

+ Here is the call graph for this function:

◆ setFreeOptionChoice()

ilIncomingMailInputGUI::setFreeOptionChoice ( bool  $free_option_choice)

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

83 : void
84 {
85 $this->free_option_choice = $free_option_choice;
86 }

References $free_option_choice.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

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

48 : void
49 {
50 $this->initializeOptions();
51 parent::setValueByArray($a_values);
52 }

References initializeOptions().

+ Here is the call graph for this function:

Field Documentation

◆ $free_option_choice

bool ilIncomingMailInputGUI::$free_option_choice = true
protected

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

Referenced by isFreeOptionChoice(), and setFreeOptionChoice().

◆ $options_initialized

bool ilIncomingMailInputGUI::$options_initialized = false
protected

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


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