19declare(strict_types=1);
47 $this->
ctrl = $DIC[
'ilCtrl'];
52 $this->ui_factory =
$DIC[
'ui.factory'];
53 $this->ui_renderer =
$DIC[
'ui.renderer'];
55 $this->request =
$DIC->http()->request();
60 $this->tabs_gui->addTarget(
'settings', $this->
ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT));
61 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
62 $this->tabs_gui->addTarget(
'perm_settings', $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'), array(),
'ilpermissiongui');
69 $next_class = $this->
ctrl->getNextClass($this);
70 $cmd = $this->
ctrl->getCmd();
73 switch ($next_class) {
74 case 'ilpermissiongui':
75 $this->tabs_gui->setTabActive(
'perm_settings');
77 $this->
ctrl->forwardCommand($perm_gui);
90 throw new Exception(__METHOD__ .
" :: Unknown command " . $cmd);
97 $target = $this->
ctrl->getLinkTargetByClass(self::class, self::CMD_SAVE);
98 $poll_interval = $this->ui_factory->input()->field()->numeric(
99 $this->
lng->txt(
"lso_admin_interval_label"),
100 $this->lng->txt(
"lso_admin_interval_byline")
102 ->withAdditionalTransformation(
103 $this->
refinery->int()->isGreaterThan(0)
105 ->withAdditionalTransformation(
106 $this->
refinery->custom()->transformation(
111 $poll_interval = $poll_interval->withDisabled(
true);
114 if (isset($values[self::F_POLL_INTERVAL])) {
115 $poll_interval = $poll_interval->withValue($values[self::F_POLL_INTERVAL]);
118 $section = $this->ui_factory->input()->field()->section(
119 [self::F_POLL_INTERVAL => $poll_interval],
120 $this->
lng->txt(
"lso_admin_form_title"),
121 $this->lng->txt(
"lso_admin_form_byline")
124 return $this->ui_factory->input()->container()->form()
125 ->standard($target, [$section])
126 ->withAdditionalTransformation(
127 $this->
refinery->custom()->transformation(
135 $this->tpl->setContent(
136 $this->ui_renderer->render($form)
140 protected function edit(): void
143 self::F_POLL_INTERVAL => $this->settings_db->getSettings()->getPollingIntervalSeconds()
145 $form = $this->
getForm($values);
149 protected function save(): void
152 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'));
156 $form = $this->
getForm()->withRequest($this->request);
157 $data = $form->getData();
159 $settings = $this->settings_db->getSettings()
160 ->withPollingIntervalSeconds(
$data[self::F_POLL_INTERVAL]);
161 $this->settings_db->storeSettings(
$settings);
162 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
168 return $this->rbac_system->checkAccess($permission, $this->
object->getRefId());
Builds a Color from either hex- or rgb values.
Repository for LSGlobalSettings over ILIAS global settings.
LearningSequence Administration Settings.
__construct($data, int $id, bool $call_by_reference=true, bool $prepare_output=true)
show(Input\Container\Form\Form $form)
ilLSGlobalSettingsDB $settings_db
_checkPermission(string $permission)
ILIAS Refinery Factory $refinery
getAdminTabs()
administration tabs show only permissions and trash folder
getForm(array $values=[])
Class ilObjectGUI Basic methods of all Output classes.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
An entity that renders components to a string output.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc