ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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)
 
 setUser (?ilObjUser $user)
 
- 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)
 

Private Member Functions

 addSubOptions ()
 

Private Attributes

bool $free_option_choice = true
 
bool $options_initialized = false
 
ilObjUser $user = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- 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
 

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 27 of file class.ilIncomingMailInputGUI.php.

28 {
29 parent::__construct($title, $post_var);
31 }
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 92 of file class.ilIncomingMailInputGUI.php.

92 : void
93 {
94 global $DIC;
95
96 $incoming_local = new ilRadioOption(
97 $DIC->language()->txt('mail_incoming_local'),
99 );
100 $incoming_local->setDisabled($this->getDisabled());
101
102 $incoming_external = new ilRadioOption(
103 $DIC->language()->txt('mail_incoming_smtp'),
105 );
106 $incoming_external->setDisabled($this->getDisabled());
107
108 $incoming_both = new ilRadioOption(
109 $DIC->language()->txt('mail_incoming_both'),
111 );
112 $incoming_both->setDisabled($this->getDisabled());
113
114 $this->addOption($incoming_local);
115 $this->addOption($incoming_external);
116 $this->addOption($incoming_both);
117
118 $incoming_external_address_choice = new ilRadioGroupInputGUI('', 'mail_address_option');
119 $incoming_external_address_choice->setDisabled($this->getDisabled());
120
121 $sub_mail_opt1 = new ilRadioOption(
122 $DIC->language()->txt('mail_first_email'),
124 );
125 $sub_mail_opt1->setDisabled($this->getDisabled());
126
127 $sub_mail_opt2 = new ilRadioOption(
128 $DIC->language()->txt('mail_second_email'),
130 );
131 $sub_mail_opt2->setDisabled($this->getDisabled());
132 $sub_mail_opt3 = new ilRadioOption(
133 $DIC->language()->txt('mail_both_email'),
135 );
136 $sub_mail_opt3->setDisabled($this->getDisabled());
137
138 $incoming_both_address_choice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
139 $incoming_both_address_choice->setDisabled($this->getDisabled());
140 $sub_both_opt1 = new ilRadioOption(
141 $DIC->language()->txt('mail_first_email'),
143 );
144 $sub_both_opt1->setDisabled($this->getDisabled());
145
146 $sub_both_opt2 = new ilRadioOption(
147 $DIC->language()->txt('mail_second_email'),
149 );
150 $sub_both_opt2->setDisabled($this->getDisabled());
151 $sub_both_opt3 = new ilRadioOption(
152 $DIC->language()->txt('mail_both_email'),
154 );
155 $sub_both_opt3->setDisabled($this->getDisabled());
156 if ($this->isFreeOptionChoice()) {
157 $incoming_external_address_choice->addOption($sub_mail_opt1);
158 $incoming_external_address_choice->addOption($sub_mail_opt2);
159 $incoming_external_address_choice->addOption($sub_mail_opt3);
160 $incoming_both_address_choice->addOption($sub_both_opt1);
161 $incoming_both_address_choice->addOption($sub_both_opt2);
162 $incoming_both_address_choice->addOption($sub_both_opt3);
163
164 $incoming_external->addSubItem($incoming_external_address_choice);
165 $incoming_both->addSubItem($incoming_both_address_choice);
166 } else {
167 $email_info = [];
168 if (
169 $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
170 $this->setDisabled(true);
171 }
172
173 $email = $this->user !== null
174 ? $this->user->getEmail()
175 : $DIC->user()->getEmail();
176 if (empty($email)) {
177 $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
178 $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
179 $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
180 $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
181 } else {
182 $email_info[] = $email;
183 }
184 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
185 $sub_mail_opt1->setDisabled(true);
186 $sub_mail_opt3->setDisabled(true);
187 $sub_both_opt1->setDisabled(true);
188 $sub_both_opt3->setDisabled(true);
189 }
190
191 $second_email = $this->user !== null
192 ? $this->user->getSecondEmail()
193 : $DIC->user()->getSecondEmail();
194 if (empty($second_email)) {
195 $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
196 $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
197 $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
198 $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
199 } else {
200 $email_info[] = $second_email;
201 }
202 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
203 $sub_mail_opt2->setDisabled(true);
204 $sub_mail_opt3->setDisabled(true);
205 $sub_both_opt2->setDisabled(true);
206 $sub_both_opt3->setDisabled(true);
207 }
208
209 if (count($email_info) > 1) {
210 $sub_mail_opt1->setInfo($email_info[0]);
211 $sub_both_opt1->setInfo($email_info[0]);
212 $sub_mail_opt2->setInfo($email_info[1]);
213 $sub_both_opt2->setInfo($email_info[1]);
214 $sub_mail_opt3->setInfo(implode(', ', $email_info));
215 $sub_both_opt3->setInfo(implode(', ', $email_info));
216 }
217
218 if (count($email_info) === 1) {
219 $incoming_external->setInfo($email_info[0]);
220 $incoming_both->setInfo($email_info[0]);
221 } else {
222 $incoming_external_address_choice->addOption($sub_mail_opt1);
223 $incoming_external_address_choice->addOption($sub_mail_opt2);
224 $incoming_external_address_choice->addOption($sub_mail_opt3);
225
226 $incoming_both_address_choice->addOption($sub_both_opt1);
227 $incoming_both_address_choice->addOption($sub_both_opt2);
228 $incoming_both_address_choice->addOption($sub_both_opt3);
229
230 $incoming_external->addSubItem($incoming_external_address_choice);
231 $incoming_both->addSubItem($incoming_both_address_choice);
232 }
233 }
234 }
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, ilFormPropertyGUI\setDisabled(), and ILIAS\Repository\user().

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 53 of file class.ilIncomingMailInputGUI.php.

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

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 65 of file class.ilIncomingMailInputGUI.php.

66 {
67 $this->initializeOptions();
68 return parent::getItemByPostVar($a_post_var);
69 }
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 41 of file class.ilIncomingMailInputGUI.php.

References ILIAS\UI\Implementation\Component\Input\Field\getOptions(), and 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 71 of file class.ilIncomingMailInputGUI.php.

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

References initializeOptions().

+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

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

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

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 77 of file class.ilIncomingMailInputGUI.php.

77 : bool
78 {
80 }

References $free_option_choice.

Referenced by addSubOptions().

+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

Reimplemented from ilRadioGroupInputGUI.

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

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

References initializeOptions().

+ Here is the call graph for this function:

◆ setFreeOptionChoice()

ilIncomingMailInputGUI::setFreeOptionChoice ( bool  $free_option_choice)

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

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

References $free_option_choice.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setUser()

ilIncomingMailInputGUI::setUser ( ?ilObjUser  $user)

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

87 : void
88 {
89 $this->user = $user;
90 }

References $user, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

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

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

References initializeOptions().

+ Here is the call graph for this function:

Field Documentation

◆ $free_option_choice

bool ilIncomingMailInputGUI::$free_option_choice = true
private

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

Referenced by isFreeOptionChoice(), and setFreeOptionChoice().

◆ $options_initialized

bool ilIncomingMailInputGUI::$options_initialized = false
private

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

◆ $user

ilObjUser ilIncomingMailInputGUI::$user = null
private

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

Referenced by setUser().


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