19 declare(strict_types=1);
30 public function __construct(
string $title =
'',
string $post_var =
'',
bool $freeOptionChoice =
true)
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();
95 $DIC->language()->txt(
'mail_incoming_local'),
101 $DIC->language()->txt(
'mail_incoming_smtp'),
104 $incomingExternal->setDisabled($this->
getDisabled());
107 $DIC->language()->txt(
'mail_incoming_both'),
117 $incomingExternalAddressChoice->setDisabled($this->
getDisabled());
120 $DIC->language()->txt(
'mail_first_email'),
126 $DIC->language()->txt(
'mail_second_email'),
131 $DIC->language()->txt(
'mail_both_email'),
137 $incomingBothAddressChoice->setDisabled($this->
getDisabled());
139 $DIC->language()->txt(
'mail_first_email'),
145 $DIC->language()->txt(
'mail_second_email'),
150 $DIC->language()->txt(
'mail_both_email'),
157 $DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ===
'1') {
161 if ($DIC->user()->getEmail() ===
'') {
162 $sub_mail_opt1->setInfo($DIC->language()->txt(
'first_email_missing_info'));
163 $sub_mail_opt3->setInfo($DIC->language()->txt(
'first_email_missing_info'));
164 $sub_both_opt1->setInfo($DIC->language()->txt(
'first_email_missing_info'));
165 $sub_both_opt3->setInfo($DIC->language()->txt(
'first_email_missing_info'));
167 $email_info[] = $DIC->user()->getEmail();
169 if ($DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ===
'1') {
170 $sub_mail_opt1->setDisabled(
true);
171 $sub_mail_opt3->setDisabled(
true);
172 $sub_both_opt1->setDisabled(
true);
173 $sub_both_opt3->setDisabled(
true);
176 if ($DIC->user()->getSecondEmail() ===
'') {
177 $sub_mail_opt2->setInfo($DIC->language()->txt(
'second_email_missing_info'));
178 $sub_mail_opt3->setInfo($DIC->language()->txt(
'second_email_missing_info'));
179 $sub_both_opt2->setInfo($DIC->language()->txt(
'second_email_missing_info'));
180 $sub_both_opt3->setInfo($DIC->language()->txt(
'second_email_missing_info'));
182 $email_info[] = $DIC->user()->getSecondEmail();
184 if ($DIC->settings()->get(
'usr_settings_disable_mail_incoming_mail') ===
'1') {
185 $sub_mail_opt2->setDisabled(
true);
186 $sub_mail_opt3->setDisabled(
true);
187 $sub_both_opt2->setDisabled(
true);
188 $sub_both_opt3->setDisabled(
true);
191 if (count($email_info) > 1) {
192 $sub_mail_opt1->setInfo($email_info[0]);
193 $sub_both_opt1->setInfo($email_info[0]);
194 $sub_mail_opt2->setInfo($email_info[1]);
195 $sub_both_opt2->setInfo($email_info[1]);
196 $sub_mail_opt3->setInfo(implode(
', ', $email_info));
197 $sub_both_opt3->setInfo(implode(
', ', $email_info));
200 if (count($email_info) === 1) {
201 $incomingExternal->setInfo($email_info[0]);
202 $incomingBoth->setInfo($email_info[0]);
204 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
205 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
206 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
208 $incomingBothAddressChoice->addOption($sub_both_opt1);
209 $incomingBothAddressChoice->addOption($sub_both_opt2);
210 $incomingBothAddressChoice->addOption($sub_both_opt3);
212 $incomingExternal->addSubItem($incomingExternalAddressChoice);
213 $incomingBoth->addSubItem($incomingBothAddressChoice);
216 $incomingExternalAddressChoice->addOption($sub_mail_opt1);
217 $incomingExternalAddressChoice->addOption($sub_mail_opt2);
218 $incomingExternalAddressChoice->addOption($sub_mail_opt3);
219 $incomingBothAddressChoice->addOption($sub_both_opt1);
220 $incomingBothAddressChoice->addOption($sub_both_opt2);
221 $incomingBothAddressChoice->addOption($sub_both_opt3);
223 $incomingExternal->addSubItem($incomingExternalAddressChoice);
224 $incomingBoth->addSubItem($incomingBothAddressChoice);
This class represents an option in a radio group.
final const INCOMING_LOCAL
final const INCOMING_EMAIL
__construct(Container $dic, ilPlugin $plugin)
final const INCOMING_BOTH