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';
38 if (!$this->optionsInitialized) {
40 $this->optionsInitialized =
true;
47 return parent::getOptions();
53 parent::setValueByArray($a_values);
59 return parent::checkInput();
65 return parent::render();
71 return parent::getItemByPostVar($a_post_var);
77 return parent::getSubInputItemsRecursive();
104 $DIC->language()->txt(
'mail_incoming_smtp'),
117 $incomingExternalAddressChoice->setDisabled($this->
getDisabled());
128 $incomingBothAddressChoice->setDisabled($this->
getDisabled());
136 $email_info = array();
138 $email_info = array();
139 if ($DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ==
'1') {
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'));
149 $email_info[] = $DIC->user()->getEmail();
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);
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'));
164 $email_info[] = $DIC->user()->getSecondEmail();
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);
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));
182 if (count($email_info) == 1) {
183 $incomingExternal->setInfo($email_info[0]);
184 $incomingBoth->setInfo($email_info[0]);
186 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
187 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
188 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
190 $incomingBothAddressChoice->addOption($sub_both_opt1);
191 $incomingBothAddressChoice->addOption($sub_both_opt2);
192 $incomingBothAddressChoice->addOption($sub_both_opt3);
194 $incomingExternal->addSubItem($incomingExternalAddressChoice);
195 $incomingBoth->addSubItem($incomingBothAddressChoice);
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);
205 $incomingExternal->addSubItem($incomingExternalAddressChoice);
206 $incomingBoth->addSubItem($incomingBothAddressChoice);
This class represents an option in a radio group.
__construct(Container $dic, ilPlugin $plugin)