19 declare(strict_types=1);
38 public function __construct($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
45 $this->
lng->loadLanguageModule(
'notifications_adm');
51 $this->tabs_gui->activateTab(
'view');
53 switch (strtolower($this->
ctrl->getNextClass())) {
54 case strtolower(ilPermissionGUI::class):
56 $this->
ctrl->forwardCommand($perm_gui);
59 switch ($this->
ctrl->getCmd()) {
60 case 'saveOSDSettings':
78 $value[
'enable_osd'] = null;
80 $value[
'enable_osd'] = [
84 'osd_play_sound' => (bool)
$settings->
get(
'osd_play_sound'),
90 $this->tpl->setContent($this->dic->ui()->renderer()->render($form));
100 $form = $this->
getForm()->withRequest($this->dic->http()->request());
101 $data = $form->getData();
102 if (isset(
$data[
'osd']) && is_array(
$data[
'osd'])) {
103 if (!isset(
$data[
'osd'][
'enable_osd'])) {
105 $DIC->notifications()->system()->clear(
'osd');
113 $settings->
set(
'osd_interval', ((
string)
$data[
'osd'][
'enable_osd'][
'osd_interval']));
114 $settings->
set(
'osd_vanish', ((
string) $data[
'osd'][
'enable_osd'][
'osd_vanish']));
115 $settings->
set(
'osd_delay', ((
string) $data[
'osd'][
'enable_osd'][
'osd_delay']));
116 $settings->
set(
'osd_play_sound', ($data[
'osd'][
'enable_osd'][
'osd_play_sound']) ?
'1' :
'0');
128 $enable_osd = $this->dic->ui()->factory()->input()->field()->optionalGroup(
130 'osd_interval' => $this->dic->ui()->factory()->input()->field()->numeric(
131 $this->
lng->txt(
'osd_interval'),
132 $this->
lng->txt(
'osd_interval_desc')
136 ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint(
137 static function ($value) {
138 return $value >= 3000;
140 $this->
lng->txt(
'osd_error_refresh_interval_too_small')
142 'osd_vanish' => $this->dic->ui()->factory()->input()->field()->numeric(
143 $this->
lng->txt(
'osd_vanish'),
144 $this->
lng->txt(
'osd_vanish_desc')
148 ->withAdditionalTransformation($this->dic->refinery()->custom()->constraint(
149 static function ($value) {
150 return $value >= 1000;
152 $this->
lng->txt(
'osd_error_presentation_time_too_small')
154 'osd_delay' => $this->dic->ui()->factory()->input()->field()->numeric(
155 $this->
lng->txt(
'osd_delay'),
156 $this->
lng->txt(
'osd_delay_desc')
160 'osd_play_sound' => $this->dic->ui()->factory()->input()->field()->checkbox(
161 $this->
lng->txt(
'osd_play_sound'),
162 $this->
lng->txt(
'osd_play_sound_desc')
165 $this->
lng->txt(
'enable_osd')
167 $this->
lng->txt(
'enable_osd_desc')
169 static function ($value) {
170 return $value === null || ($value[
'osd_interval'] > $value[
'osd_delay'] + $value[
'osd_vanish']);
172 $this->
lng->txt(
'osd_error_refresh_interval_smaller_than_delay_and_vanish_combined')
175 if ($value !== null) {
176 $enable_osd = $enable_osd->withValue($value[
'enable_osd'] ?? null);
179 return $this->dic->ui()->factory()->input()->container()->form()->standard(
180 $this->
ctrl->getFormAction($this,
'saveOSDSettings'),
182 'osd' => $this->dic->ui()->factory()->input()->field()->section(
183 [
'enable_osd' => $enable_osd],
184 $this->
lng->txt(
'osd_settings')
delete(string $a_keyword)
get(string $a_keyword, ?string $a_default_value=null)
get setting
prepareOutput(bool $show_sub_objects=true)
set(string $a_key, string $a_val)
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Customizing of pimple-DIC for ILIAS.
Class ilObjectGUI Basic methods of all Output classes.
showOSDSettings(?Form $form=null)
__construct(Container $dic, ilPlugin $plugin)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
getForm(array $value=null)