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();
103 $incomingExternal =
new ilRadioOption($DIC->language()->txt(
'mail_incoming_smtp'),
115 $incomingExternalAddressChoice->setDisabled($this->
getDisabled());
126 $incomingBothAddressChoice->setDisabled($this->
getDisabled());
134 $email_info = array();
136 $email_info = array();
137 if ($DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ==
'1') {
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'));
147 $email_info[] = $DIC->user()->getEmail();
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);
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'));
162 $email_info[] = $DIC->user()->getSecondEmail();
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);
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));
180 if (count($email_info) == 1) {
181 $incomingExternal->setInfo($email_info[0]);
182 $incomingBoth->setInfo($email_info[0]);
184 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
185 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
186 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
188 $incomingBothAddressChoice->addOption($sub_both_opt1);
189 $incomingBothAddressChoice->addOption($sub_both_opt2);
190 $incomingBothAddressChoice->addOption($sub_both_opt3);
192 $incomingExternal->addSubItem($incomingExternalAddressChoice);
193 $incomingBoth->addSubItem($incomingBothAddressChoice);
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);
203 $incomingExternal->addSubItem($incomingExternalAddressChoice);
204 $incomingBoth->addSubItem($incomingBothAddressChoice);
This class represents an option in a radio group.
__construct(Container $dic, ilPlugin $plugin)