ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
- 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...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. 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'),
126 $incomingLocal->setDisabled($this->getDisabled());
127
128 $incomingExternal = new ilRadioOption($DIC->language()->txt('mail_incoming_smtp'),
130 $incomingExternal->setDisabled($this->getDisabled());
131
132 $incomingBoth = new ilRadioOption($DIC->language()->txt('mail_incoming_both'),
134 $incomingBoth->setDisabled($this->getDisabled());
135
136 $this->addOption($incomingLocal);
137 $this->addOption($incomingExternal);
138 $this->addOption($incomingBoth);
139
140 $incomingExternalAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option');
141 $incomingExternalAddressChoice->setDisabled($this->getDisabled());
142
143 $sub_mail_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
144 $sub_mail_opt1->setDisabled($this->getDisabled());
145
146 $sub_mail_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
147 $sub_mail_opt2->setDisabled($this->getDisabled());
148 $sub_mail_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
149 $sub_mail_opt3->setDisabled($this->getDisabled());
150
151 $incomingBothAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
152 $incomingBothAddressChoice->setDisabled($this->getDisabled());
153 $sub_both_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
154 $sub_both_opt1->setDisabled($this->getDisabled());
155
156 $sub_both_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
157 $sub_both_opt2->setDisabled($this->getDisabled());
158 $sub_both_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
159 $sub_both_opt3->setDisabled($this->getDisabled());
160 $email_info = array();
161 if (!$this->isFreeOptionChoice()) {
162 $email_info = array();
163 if (
164// !strlen(ilObjUser::_lookupEmail($DIC->user()->getId())) ||
165 $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
166 $this->setDisabled(true);
167 }
168
169 if (!strlen($DIC->user()->getEmail()) || $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
170 $sub_mail_opt1->setDisabled(true);
171 $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
172 $sub_mail_opt3->setDisabled(true);
173 $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
174 $sub_both_opt1->setDisabled(true);
175 $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
176 $sub_both_opt3->setDisabled(true);
177 $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
178 } else {
179 $email_info[] = $DIC->user()->getEmail();
180 }
181
182 if (!strlen($DIC->user()->getSecondEmail()) || $DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
183 $sub_mail_opt2->setDisabled(true);
184 $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
185 $sub_mail_opt3->setDisabled(true);
186 $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
187 $sub_both_opt2->setDisabled(true);
188 $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
189 $sub_both_opt3->setDisabled(true);
190 $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
191 } else {
192 $email_info[] = $DIC->user()->getSecondEmail();
193 }
194
195 if (count($email_info) > 1) {
196 $sub_mail_opt1->setInfo($email_info[0]);
197 $sub_both_opt1->setInfo($email_info[0]);
198 $sub_mail_opt2->setInfo($email_info[1]);
199 $sub_both_opt2->setInfo($email_info[1]);
200 $sub_mail_opt3->setInfo(implode(', ', $email_info));
201 $sub_both_opt3->setInfo(implode(', ', $email_info));
202 }
203
204 if (count($email_info) == 1) {
205 $incomingExternal->setInfo($email_info[0]);
206 $incomingBoth->setInfo($email_info[0]);
207 } else {
208 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
209 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
210 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
211
212 $incomingBothAddressChoice->addOption($sub_both_opt1);
213 $incomingBothAddressChoice->addOption($sub_both_opt2);
214 $incomingBothAddressChoice->addOption($sub_both_opt3);
215
216 $incomingExternal->addSubItem($incomingExternalAddressChoice);
217 $incomingBoth->addSubItem($incomingBothAddressChoice);
218 }
219 } else {
220 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
221 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
222 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
223 $incomingBothAddressChoice->addOption($sub_both_opt1);
224 $incomingBothAddressChoice->addOption($sub_both_opt2);
225 $incomingBothAddressChoice->addOption($sub_both_opt3);
226
227 $incomingExternal->addSubItem($incomingExternalAddressChoice);
228 $incomingBoth->addSubItem($incomingBothAddressChoice);
229 }
230 }
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: