ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 setValueByArray ($a_values)
 
 checkInput ()
 
 render ()
 
 getItemByPostVar ($a_post_var)
 
 getSubInputItemsRecursive ()
 
 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 ()
 
- 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
 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.

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, ilRadioOption\setDisabled(), and ilFormPropertyGUI\setDisabled().

Referenced by initializeOptions().

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($DIC->language()->txt('mail_incoming_smtp'),
105  $incomingExternal->setDisabled($this->getDisabled());
106 
107  $incomingBoth = new ilRadioOption($DIC->language()->txt('mail_incoming_both'), ilMailOptions::INCOMING_BOTH);
108  $incomingBoth->setDisabled($this->getDisabled());
109 
110  $this->addOption($incomingLocal);
111  $this->addOption($incomingExternal);
112  $this->addOption($incomingBoth);
113 
114  $incomingExternalAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option');
115  $incomingExternalAddressChoice->setDisabled($this->getDisabled());
116 
117  $sub_mail_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
118  $sub_mail_opt1->setDisabled($this->getDisabled());
119 
120  $sub_mail_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
121  $sub_mail_opt2->setDisabled($this->getDisabled());
122  $sub_mail_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
123  $sub_mail_opt3->setDisabled($this->getDisabled());
124 
125  $incomingBothAddressChoice = new ilRadioGroupInputGUI('', 'mail_address_option_both');
126  $incomingBothAddressChoice->setDisabled($this->getDisabled());
127  $sub_both_opt1 = new ilRadioOption($DIC->language()->txt('mail_first_email'), ilMailOptions::FIRST_EMAIL);
128  $sub_both_opt1->setDisabled($this->getDisabled());
129 
130  $sub_both_opt2 = new ilRadioOption($DIC->language()->txt('mail_second_email'), ilMailOptions::SECOND_EMAIL);
131  $sub_both_opt2->setDisabled($this->getDisabled());
132  $sub_both_opt3 = new ilRadioOption($DIC->language()->txt('mail_both_email'), ilMailOptions::BOTH_EMAIL);
133  $sub_both_opt3->setDisabled($this->getDisabled());
134  $email_info = array();
135  if (!$this->isFreeOptionChoice()) {
136  $email_info = array();
137  if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
138  $this->setDisabled(true);
139  }
140 
141  if (!strlen($DIC->user()->getEmail())) {
142  $sub_mail_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
143  $sub_mail_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
144  $sub_both_opt1->setInfo($DIC->language()->txt('first_email_missing_info'));
145  $sub_both_opt3->setInfo($DIC->language()->txt('first_email_missing_info'));
146  } else {
147  $email_info[] = $DIC->user()->getEmail();
148  }
149  if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
150  $sub_mail_opt1->setDisabled(true);
151  $sub_mail_opt3->setDisabled(true);
152  $sub_both_opt1->setDisabled(true);
153  $sub_both_opt3->setDisabled(true);
154  }
155 
156  if (!strlen($DIC->user()->getSecondEmail())) {
157  $sub_mail_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
158  $sub_mail_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
159  $sub_both_opt2->setInfo($DIC->language()->txt('second_email_missing_info'));
160  $sub_both_opt3->setInfo($DIC->language()->txt('second_email_missing_info'));
161  } else {
162  $email_info[] = $DIC->user()->getSecondEmail();
163  }
164  if ($DIC->settings()->get('usr_settings_disable_mail_incoming_mail') == '1') {
165  $sub_mail_opt2->setDisabled(true);
166  $sub_mail_opt3->setDisabled(true);
167  $sub_both_opt2->setDisabled(true);
168  $sub_both_opt3->setDisabled(true);
169  }
170 
171  if (count($email_info) > 1) {
172  $sub_mail_opt1->setInfo($email_info[0]);
173  $sub_both_opt1->setInfo($email_info[0]);
174  $sub_mail_opt2->setInfo($email_info[1]);
175  $sub_both_opt2->setInfo($email_info[1]);
176  $sub_mail_opt3->setInfo(implode(', ', $email_info));
177  $sub_both_opt3->setInfo(implode(', ', $email_info));
178  }
179 
180  if (count($email_info) == 1) {
181  $incomingExternal->setInfo($email_info[0]);
182  $incomingBoth->setInfo($email_info[0]);
183  } else {
184  $incomingExternalAddressChoice->addOption($sub_mail_opt1);
185  $incomingExternalAddressChoice->addOption($sub_mail_opt2);
186  $incomingExternalAddressChoice->addOption($sub_mail_opt3);
187 
188  $incomingBothAddressChoice->addOption($sub_both_opt1);
189  $incomingBothAddressChoice->addOption($sub_both_opt2);
190  $incomingBothAddressChoice->addOption($sub_both_opt3);
191 
192  $incomingExternal->addSubItem($incomingExternalAddressChoice);
193  $incomingBoth->addSubItem($incomingBothAddressChoice);
194  }
195  } else {
196  $incomingExternalAddressChoice->addOption($sub_mail_opt1);
197  $incomingExternalAddressChoice->addOption($sub_mail_opt2);
198  $incomingExternalAddressChoice->addOption($sub_mail_opt3);
199  $incomingBothAddressChoice->addOption($sub_both_opt1);
200  $incomingBothAddressChoice->addOption($sub_both_opt2);
201  $incomingBothAddressChoice->addOption($sub_both_opt3);
202 
203  $incomingExternal->addSubItem($incomingExternalAddressChoice);
204  $incomingBoth->addSubItem($incomingBothAddressChoice);
205  }
206  }
This class represents an option in a radio group.
This class represents a property in a property form.
addOption($a_option)
Add Option.
$DIC
Definition: xapitoken.php:46
setDisabled($a_disabled)
setDisabled($a_disabled)
Set Disabled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkInput()

ilIncomingMailInputGUI::checkInput ( )

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

References initializeOptions().

57  {
58  $this->initializeOptions();
59  return parent::checkInput();
60  }
+ Here is the call graph for this function:

◆ getItemByPostVar()

ilIncomingMailInputGUI::getItemByPostVar (   $a_post_var)

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

References initializeOptions().

69  {
70  $this->initializeOptions();
71  return parent::getItemByPostVar($a_post_var);
72  }
+ Here is the call graph for this function:

◆ getOptions()

ilIncomingMailInputGUI::getOptions ( )

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

References initializeOptions().

45  {
46  $this->initializeOptions();
47  return parent::getOptions();
48  }
+ Here is the call graph for this function:

◆ getSubInputItemsRecursive()

ilIncomingMailInputGUI::getSubInputItemsRecursive ( )

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

References initializeOptions().

75  {
76  $this->initializeOptions();
77  return parent::getSubInputItemsRecursive();
78  }
+ Here is the call graph for this function:

◆ initializeOptions()

ilIncomingMailInputGUI::initializeOptions ( )
protected

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

References addSubOptions().

Referenced by checkInput(), getItemByPostVar(), getOptions(), getSubInputItemsRecursive(), render(), and setValueByArray().

37  {
38  if (!$this->optionsInitialized) {
39  $this->addSubOptions();
40  $this->optionsInitialized = true;
41  }
42  }
+ 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.

References $freeOptionChoice.

Referenced by addSubOptions().

+ Here is the caller graph for this function:

◆ render()

ilIncomingMailInputGUI::render ( )

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

References initializeOptions().

63  {
64  $this->initializeOptions();
65  return parent::render();
66  }
+ Here is the call graph for this function:

◆ setFreeOptionChoice()

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

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

References $freeOptionChoice.

Referenced by __construct().

92  {
93  $this->freeOptionChoice = $freeOptionChoice;
94  }
+ Here is the caller graph for this function:

◆ setValueByArray()

ilIncomingMailInputGUI::setValueByArray (   $a_values)

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

References initializeOptions().

51  {
52  $this->initializeOptions();
53  parent::setValueByArray($a_values);
54  }
+ 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: