ILIAS  release_8 Revision v8.24
ilIncomingMailInputGUI Class Reference

Class ilIncomingMailInputGUI. More...

+ Inheritance diagram for ilIncomingMailInputGUI:
+ Collaboration diagram for ilIncomingMailInputGUI:

Public Member Functions

 __construct (string $title='', string $post_var='', bool $freeOptionChoice=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 $freeOptionChoice)
 
- 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
 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 $freeOptionChoice = true
 
bool $optionsInitialized = 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

Constructor & Destructor Documentation

◆ __construct()

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

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

31 {
32 parent::__construct($title, $post_var);
34 }
setFreeOptionChoice(bool $freeOptionChoice)
__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 90 of file class.ilIncomingMailInputGUI.php.

90 : void
91 {
92 global $DIC;
93
94 $incomingLocal = new ilRadioOption(
95 $DIC->language()->txt('mail_incoming_local'),
97 );
98 $incomingLocal->setDisabled($this->getDisabled());
99
100 $incomingExternal = new ilRadioOption(
101 $DIC->language()->txt('mail_incoming_smtp'),
103 );
104 $incomingExternal->setDisabled($this->getDisabled());
105
106 $incomingBoth = new ilRadioOption(
107 $DIC->language()->txt('mail_incoming_both'),
109 );
110 $incomingBoth->setDisabled($this->getDisabled());
111
112 $this->addOption($incomingLocal);
113 $this->addOption($incomingExternal);
114 $this->addOption($incomingBoth);
115
116 $incomingExternalAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option');
117 $incomingExternalAddressChoice->setDisabled($this->getDisabled());
118
119 $sub_mail_opt1 = new ilRadioOption(
120 $DIC->language()->txt('mail_first_email'),
122 );
123 $sub_mail_opt1->setDisabled($this->getDisabled());
124
125 $sub_mail_opt2 = new ilRadioOption(
126 $DIC->language()->txt('mail_second_email'),
128 );
129 $sub_mail_opt2->setDisabled($this->getDisabled());
130 $sub_mail_opt3 = new ilRadioOption(
131 $DIC->language()->txt('mail_both_email'),
133 );
134 $sub_mail_opt3->setDisabled($this->getDisabled());
135
136 $incomingBothAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
137 $incomingBothAddressChoice->setDisabled($this->getDisabled());
138 $sub_both_opt1 = new ilRadioOption(
139 $DIC->language()->txt('mail_first_email'),
141 );
142 $sub_both_opt1->setDisabled($this->getDisabled());
143
144 $sub_both_opt2 = new ilRadioOption(
145 $DIC->language()->txt('mail_second_email'),
147 );
148 $sub_both_opt2->setDisabled($this->getDisabled());
149 $sub_both_opt3 = new ilRadioOption(
150 $DIC->language()->txt('mail_both_email'),
152 );
153 $sub_both_opt3->setDisabled($this->getDisabled());
154 if (!$this->isFreeOptionChoice()) {
155 $email_info = [];
156 if (
157 $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
158 $this->setDisabled(true);
159 }
160
161 if ($DIC->user()->getEmail() === '') {
162 $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
163 $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
164 $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
165 $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
166 } else {
167 $email_info[] = $DIC->user()->getEmail();
168 }
169 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
170 $sub_mail_opt1->setDisabled(true);
171 $sub_mail_opt3->setDisabled(true);
172 $sub_both_opt1->setDisabled(true);
173 $sub_both_opt3->setDisabled(true);
174 }
175
176 if ($DIC->user()->getSecondEmail() === '') {
177 $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
178 $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
179 $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
180 $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
181 } else {
182 $email_info[] = $DIC->user()->getSecondEmail();
183 }
184 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') === '1') {
185 $sub_mail_opt2->setDisabled(true);
186 $sub_mail_opt3->setDisabled(true);
187 $sub_both_opt2->setDisabled(true);
188 $sub_both_opt3->setDisabled(true);
189 }
190
191 if (count($email_info) > 1) {
192 $sub_mail_opt1->setInfo($email_info[0]);
193 $sub_both_opt1->setInfo($email_info[0]);
194 $sub_mail_opt2->setInfo($email_info[1]);
195 $sub_both_opt2->setInfo($email_info[1]);
196 $sub_mail_opt3->setInfo(implode(', ', $email_info));
197 $sub_both_opt3->setInfo(implode(', ', $email_info));
198 }
199
200 if (count($email_info) === 1) {
201 $incomingExternal->setInfo($email_info[0]);
202 $incomingBoth->setInfo($email_info[0]);
203 } else {
204 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
205 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
206 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
207
208 $incomingBothAddressChoice->addOption($sub_both_opt1);
209 $incomingBothAddressChoice->addOption($sub_both_opt2);
210 $incomingBothAddressChoice->addOption($sub_both_opt3);
211
212 $incomingExternal->addSubItem($incomingExternalAddressChoice);
213 $incomingBoth->addSubItem($incomingBothAddressChoice);
214 }
215 } else {
216 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
217 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
218 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
219 $incomingBothAddressChoice->addOption($sub_both_opt1);
220 $incomingBothAddressChoice->addOption($sub_both_opt2);
221 $incomingBothAddressChoice->addOption($sub_both_opt3);
222
223 $incomingExternal->addSubItem($incomingExternalAddressChoice);
224 $incomingBoth->addSubItem($incomingBothAddressChoice);
225 }
226 }
setDisabled(bool $a_disabled)
This class represents a property in a property form.
addOption(ilRadioOption $a_option)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

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

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

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

69 {
70 $this->initializeOptions();
71 return parent::getItemByPostVar($a_post_var);
72 }
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 44 of file class.ilIncomingMailInputGUI.php.

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

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

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

References initializeOptions().

+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

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

36 : void
37 {
38 if (!$this->optionsInitialized) {
39 $this->addSubOptions();
40 $this->optionsInitialized = true;
41 }
42 }

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

80 : bool
81 {
83 }

References $freeOptionChoice.

Referenced by addSubOptions().

+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

Reimplemented from ilRadioGroupInputGUI.

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

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

References initializeOptions().

+ Here is the call graph for this function:

◆ setFreeOptionChoice()

ilIncomingMailInputGUI::setFreeOptionChoice ( bool  $freeOptionChoice)

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

85 : void
86 {
87 $this->freeOptionChoice = $freeOptionChoice;
88 }

References $freeOptionChoice.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

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

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

References initializeOptions().

+ Here is the call graph for this function:

Field Documentation

◆ $freeOptionChoice

bool ilIncomingMailInputGUI::$freeOptionChoice = true
protected

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

Referenced by isFreeOptionChoice(), and setFreeOptionChoice().

◆ $optionsInitialized

bool ilIncomingMailInputGUI::$optionsInitialized = false
protected

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


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