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();
138 $incomingExternalAddressChoice->setDisabled($this->
getDisabled());
149 $incomingBothAddressChoice->setDisabled($this->
getDisabled());
157 $email_info = array();
159 $email_info = array();
162 $DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ==
'1') {
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'));
176 $email_info[] = $DIC->user()->getEmail();
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'));
189 $email_info[] = $DIC->user()->getSecondEmail();
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));
201 if (count($email_info) == 1) {
202 $incomingExternal->setInfo($email_info[0]);
203 $incomingBoth->setInfo($email_info[0]);
205 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
206 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
207 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
209 $incomingBothAddressChoice->addOption($sub_both_opt1);
210 $incomingBothAddressChoice->addOption($sub_both_opt2);
211 $incomingBothAddressChoice->addOption($sub_both_opt3);
213 $incomingExternal->addSubItem($incomingExternalAddressChoice);
214 $incomingBoth->addSubItem($incomingBothAddressChoice);
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);
224 $incomingExternal->addSubItem($incomingExternalAddressChoice);
225 $incomingBoth->addSubItem($incomingBothAddressChoice);
This class represents an option in a radio group.