ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilIncomingMailInputGUI Class Reference

Class ilIncomingMailInputGUI. More...

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

Public Member Functions

 __construct ($title='', $post_var='', $freeOptionChoice=true)
 ilIncomingMailInputGUI constructor. More...
 
 getOptions ()
 Get Options.
Returns
array Array of RadioOption objects
More...
 
 setValueByArray ($a_values)
 Set value by array.
Parameters
array$a_valuesvalue array
More...
 
 checkInput ()
 Check input, strip slashes etc.set alert, if input is not ok.
Returns
boolean Input ok, true/false
More...
 
 render ()
 Insert property html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var.
Returns
mixed false or item object
More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
Returns
array
More...
 
 isFreeOptionChoice ()
 
 setFreeOptionChoice ($freeOptionChoice)
 
- Public Member Functions inherited from ilRadioGroupInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 addOption ($a_option)
 Add Option. More...
 
 getOptions ()
 Get Options. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 render ()
 Insert property html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getFormLabelFor ()
 @inheritDoc More...
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($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...
 
- 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 ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $freeOptionChoice = true
 
 $optionsInitialized = false
 
- Protected Attributes inherited from ilRadioGroupInputGUI
 $options = array()
 
 $value
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Private Member Functions

 addSubOptions ()
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

ilIncomingMailInputGUI constructor.

Parameters
string$title
string$post_var
bool$freeOptionChoice

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

References $freeOptionChoice, ilFormPropertyGUI\$title, and setFreeOptionChoice().

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubOptions()

ilIncomingMailInputGUI::addSubOptions ( )
private

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

121 {
122 global $DIC;
123
124 $incomingLocal = new ilRadioOption($DIC->language()->txt('mail_incoming_local'), ilMailOptions::INCOMING_LOCAL);
125 $incomingLocal->setDisabled($this->getDisabled());
126
127 $incomingExternal = new ilRadioOption($DIC->language()->txt('mail_incoming_smtp'), ilMailOptions::INCOMING_EMAIL);
128 $incomingExternal->setDisabled($this->getDisabled());
129
130 $incomingBoth = new ilRadioOption($DIC->language()->txt('mail_incoming_both'), ilMailOptions::INCOMING_BOTH);
131 $incomingBoth->setDisabled($this->getDisabled());
132
133 $this->addOption($incomingLocal);
134 $this->addOption($incomingExternal);
135 $this->addOption($incomingBoth);
136
137 $incomingExternalAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option');
138 $incomingExternalAddressChoice->setDisabled($this->getDisabled());
139
140 $sub_mail_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
141 $sub_mail_opt1->setDisabled($this->getDisabled());
142
143 $sub_mail_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
144 $sub_mail_opt2->setDisabled($this->getDisabled());
145 $sub_mail_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
146 $sub_mail_opt3->setDisabled($this->getDisabled());
147
148 $incomingBothAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
149 $incomingBothAddressChoice->setDisabled($this->getDisabled());
150 $sub_both_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
151 $sub_both_opt1->setDisabled($this->getDisabled());
152
153 $sub_both_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
154 $sub_both_opt2->setDisabled($this->getDisabled());
155 $sub_both_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
156 $sub_both_opt3->setDisabled($this->getDisabled());
157 $email_info = array();
158 if (!$this->isFreeOptionChoice()) {
159 $email_info = array();
160 if (
161// !strlen(ilObjUser::_lookupEmail($DIC->user()->getId())) ||
162 $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
163 $this->setDisabled(true);
164 }
165
166 if (!strlen($DIC->user()->getEmail()) || $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
167 $sub_mail_opt1->setDisabled(true);
168 $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
169 $sub_mail_opt3->setDisabled(true);
170 $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
171 $sub_both_opt1->setDisabled(true);
172 $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
173 $sub_both_opt3->setDisabled(true);
174 $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
175 } else {
176 $email_info[] = $DIC->user()->getEmail();
177 }
178
179 if (!strlen($DIC->user()->getSecondEmail()) || $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
180 $sub_mail_opt2->setDisabled(true);
181 $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
182 $sub_mail_opt3->setDisabled(true);
183 $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
184 $sub_both_opt2->setDisabled(true);
185 $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
186 $sub_both_opt3->setDisabled(true);
187 $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
188 } else {
189 $email_info[] = $DIC->user()->getSecondEmail();
190 }
191
192 if (count($email_info) > 1) {
193 $sub_mail_opt1->setInfo($email_info[0]);
194 $sub_both_opt1->setInfo($email_info[0]);
195 $sub_mail_opt2->setInfo($email_info[1]);
196 $sub_both_opt2->setInfo($email_info[1]);
197 $sub_mail_opt3->setInfo(implode(', ', $email_info));
198 $sub_both_opt3->setInfo(implode(', ', $email_info));
199 }
200
201 if (count($email_info) == 1) {
202 $incomingExternal->setInfo($email_info[0]);
203 $incomingBoth->setInfo($email_info[0]);
204 } else {
205 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
206 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
207 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
208
209 $incomingBothAddressChoice->addOption($sub_both_opt1);
210 $incomingBothAddressChoice->addOption($sub_both_opt2);
211 $incomingBothAddressChoice->addOption($sub_both_opt3);
212
213 $incomingExternal->addSubItem($incomingExternalAddressChoice);
214 $incomingBoth->addSubItem($incomingBothAddressChoice);
215 }
216 } else {
217 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
218 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
219 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
220 $incomingBothAddressChoice->addOption($sub_both_opt1);
221 $incomingBothAddressChoice->addOption($sub_both_opt2);
222 $incomingBothAddressChoice->addOption($sub_both_opt3);
223
224 $incomingExternal->addSubItem($incomingExternalAddressChoice);
225 $incomingBoth->addSubItem($incomingBothAddressChoice);
226 }
227 }
setDisabled($a_disabled)
Set Disabled.
This class represents a property in a property form.
addOption($a_option)
Add Option.
This class represents an option in a radio group.
global $DIC
Definition: saml.php:7

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.

Returns
boolean Input ok, true/false

Reimplemented from ilRadioGroupInputGUI.

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

69 {
70 $this->initializeOptions();
71 return parent::checkInput();
72 }

References initializeOptions().

+ Here is the call graph for this function:

◆ getItemByPostVar()

ilIncomingMailInputGUI::getItemByPostVar (   $a_post_var)

Get item by post var.

Returns
mixed false or item object

Reimplemented from ilRadioGroupInputGUI.

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

87 {
88 $this->initializeOptions();
89 return parent::getItemByPostVar($a_post_var);
90 }

References initializeOptions().

+ Here is the call graph for this function:

◆ getOptions()

ilIncomingMailInputGUI::getOptions ( )

Get Options.

Returns
array Array of RadioOption objects

Reimplemented from ilRadioGroupInputGUI.

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

51 {
52 $this->initializeOptions();
53 return parent::getOptions();
54 }

References initializeOptions().

+ Here is the call graph for this function:

◆ getSubInputItemsRecursive()

ilIncomingMailInputGUI::getSubInputItemsRecursive ( )

returns a flat array of possibly existing subitems recursively

Returns
array

Reimplemented from ilSubEnabledFormPropertyGUI.

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

96 {
97 $this->initializeOptions();
98 return parent::getSubInputItemsRecursive();
99 }

References initializeOptions().

+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

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

40 {
41 if (!$this->optionsInitialized) {
42 $this->addSubOptions();
43 $this->optionsInitialized = true;
44 }
45 }

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 ( )
Returns
bool

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

105 {
107 }

References $freeOptionChoice.

Referenced by addSubOptions().

+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

Insert property html.

Reimplemented from ilRadioGroupInputGUI.

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

78 {
79 $this->initializeOptions();
80 return parent::render();
81 }

References initializeOptions().

+ Here is the call graph for this function:

◆ setFreeOptionChoice()

ilIncomingMailInputGUI::setFreeOptionChoice (   $freeOptionChoice)
Parameters
bool$freeOptionChoice

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

113 {
114 $this->freeOptionChoice = $freeOptionChoice;
115 }

References $freeOptionChoice.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Reimplemented from ilRadioGroupInputGUI.

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

60 {
61 $this->initializeOptions();
62 parent::setValueByArray($a_values);
63 }

References initializeOptions().

+ Here is the call graph for this function:

Field Documentation

◆ $freeOptionChoice

ilIncomingMailInputGUI::$freeOptionChoice = true
protected

◆ $optionsInitialized

ilIncomingMailInputGUI::$optionsInitialized = false
protected

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


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