4 require_once
'Services/Mail/classes/class.ilMailOptions.php';
5 require_once
'Services/Form/classes/class.ilRadioGroupInputGUI.php';
6 require_once
'Services/Form/classes/class.ilRadioOption.php';
32 parent::__construct(
$title, $post_var);
41 if (!$this->optionsInitialized) {
43 $this->optionsInitialized =
true;
53 return parent::getOptions();
62 parent::setValueByArray($a_values);
71 return parent::checkInput();
80 return parent::render();
89 return parent::getItemByPostVar($a_post_var);
98 return parent::getSubInputItemsRecursive();
124 $incomingLocal =
new ilRadioOption($DIC->language()->txt(
'mail_incoming_local'),
128 $incomingExternal =
new ilRadioOption($DIC->language()->txt(
'mail_incoming_smtp'),
132 $incomingBoth =
new ilRadioOption($DIC->language()->txt(
'mail_incoming_both'),
141 $incomingExternalAddressChoice->setDisabled($this->
getDisabled());
152 $incomingBothAddressChoice->setDisabled($this->
getDisabled());
160 $email_info =
array();
162 $email_info =
array();
165 $DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ==
'1') {
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'));
179 $email_info[] = $DIC->user()->getEmail();
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'));
192 $email_info[] = $DIC->user()->getSecondEmail();
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));
204 if (count($email_info) == 1) {
205 $incomingExternal->setInfo($email_info[0]);
206 $incomingBoth->setInfo($email_info[0]);
208 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
209 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
210 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
212 $incomingBothAddressChoice->addOption($sub_both_opt1);
213 $incomingBothAddressChoice->addOption($sub_both_opt2);
214 $incomingBothAddressChoice->addOption($sub_both_opt3);
216 $incomingExternal->addSubItem($incomingExternalAddressChoice);
217 $incomingBoth->addSubItem($incomingBothAddressChoice);
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);
227 $incomingExternal->addSubItem($incomingExternalAddressChoice);
228 $incomingBoth->addSubItem($incomingBothAddressChoice);
This class represents an option in a radio group.
Create styles array
The data for the language used.