ILIAS  release_7 Revision v7.30-3-g800a261c036
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. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Insert property html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively 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, ILIAS\GlobalScreen\Provider\__construct(), and setFreeOptionChoice().

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubOptions()

ilIncomingMailInputGUI::addSubOptions ( )
private

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

97 {
98 global $DIC;
99
100 $incomingLocal = new ilRadioOption($DIC->language()->txt('mail_incoming_local'), ilMailOptions::INCOMING_LOCAL);
101 $incomingLocal->setDisabled($this->getDisabled());
102
103 $incomingExternal = new ilRadioOption(
104 $DIC->language()->txt('mail_incoming_smtp'),
106 );
107 $incomingExternal->setDisabled($this->getDisabled());
108
109 $incomingBoth = new ilRadioOption($DIC->language()->txt('mail_incoming_both'), ilMailOptions::INCOMING_BOTH);
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($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
120 $sub_mail_opt1->setDisabled($this->getDisabled());
121
122 $sub_mail_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
123 $sub_mail_opt2->setDisabled($this->getDisabled());
124 $sub_mail_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
125 $sub_mail_opt3->setDisabled($this->getDisabled());
126
127 $incomingBothAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
128 $incomingBothAddressChoice->setDisabled($this->getDisabled());
129 $sub_both_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
130 $sub_both_opt1->setDisabled($this->getDisabled());
131
132 $sub_both_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
133 $sub_both_opt2->setDisabled($this->getDisabled());
134 $sub_both_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
135 $sub_both_opt3->setDisabled($this->getDisabled());
136 $email_info = array();
137 if (!$this->isFreeOptionChoice()) {
138 $email_info = array();
139 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
140 $this->setDisabled(true);
141 }
142
143 if (!strlen($DIC->user()->getEmail())) {
144 $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
145 $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
146 $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
147 $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
148 } else {
149 $email_info[] = $DIC->user()->getEmail();
150 }
151 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
152 $sub_mail_opt1->setDisabled(true);
153 $sub_mail_opt3->setDisabled(true);
154 $sub_both_opt1->setDisabled(true);
155 $sub_both_opt3->setDisabled(true);
156 }
157
158 if (!strlen($DIC->user()->getSecondEmail())) {
159 $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
160 $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
161 $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
162 $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
163 } else {
164 $email_info[] = $DIC->user()->getSecondEmail();
165 }
166 if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
167 $sub_mail_opt2->setDisabled(true);
168 $sub_mail_opt3->setDisabled(true);
169 $sub_both_opt2->setDisabled(true);
170 $sub_both_opt3->setDisabled(true);
171 }
172
173 if (count($email_info) > 1) {
174 $sub_mail_opt1->setInfo($email_info[0]);
175 $sub_both_opt1->setInfo($email_info[0]);
176 $sub_mail_opt2->setInfo($email_info[1]);
177 $sub_both_opt2->setInfo($email_info[1]);
178 $sub_mail_opt3->setInfo(implode(', ', $email_info));
179 $sub_both_opt3->setInfo(implode(', ', $email_info));
180 }
181
182 if (count($email_info) == 1) {
183 $incomingExternal->setInfo($email_info[0]);
184 $incomingBoth->setInfo($email_info[0]);
185 } else {
186 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
187 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
188 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
189
190 $incomingBothAddressChoice->addOption($sub_both_opt1);
191 $incomingBothAddressChoice->addOption($sub_both_opt2);
192 $incomingBothAddressChoice->addOption($sub_both_opt3);
193
194 $incomingExternal->addSubItem($incomingExternalAddressChoice);
195 $incomingBoth->addSubItem($incomingBothAddressChoice);
196 }
197 } else {
198 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
199 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
200 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
201 $incomingBothAddressChoice->addOption($sub_both_opt1);
202 $incomingBothAddressChoice->addOption($sub_both_opt2);
203 $incomingBothAddressChoice->addOption($sub_both_opt3);
204
205 $incomingExternal->addSubItem($incomingExternalAddressChoice);
206 $incomingBoth->addSubItem($incomingBothAddressChoice);
207 }
208 }
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: goto.php:24

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

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

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

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

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

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

Returns
array

Reimplemented from ilSubEnabledFormPropertyGUI.

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

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.

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

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

84 {
86 }

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

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

References initializeOptions().

+ Here is the call graph for this function:

◆ setFreeOptionChoice()

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

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

92 {
93 $this->freeOptionChoice = $freeOptionChoice;
94 }

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

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

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: