1 <?php declare(strict_types=1);
22 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
27 $this->ctrl = $DIC[
'ilCtrl'];
28 $this->rbacsystem = $DIC[
'rbacsystem'];
32 $this->ui_factory = $DIC[
'ui.factory'];
33 $this->ui_renderer = $DIC[
'ui.renderer'];
34 $this->refinery = $DIC[
'refinery'];
35 $this->request = $DIC->http()->request();
40 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT));
41 if ($this->rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
42 $this->tabs_gui->addTarget(
'perm_settings', $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'), array(),
'ilpermissiongui');
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
53 switch ($next_class) {
54 case 'ilpermissiongui':
55 $this->tabs_gui->setTabActive(
'perm_settings');
57 $this->ctrl->forwardCommand($perm_gui);
70 throw new Exception(__METHOD__ .
" :: Unknown command " . $cmd);
77 $target = $this->ctrl->getLinkTargetByClass(self::class, self::CMD_SAVE);
78 $poll_interval = $this->ui_factory->input()->field()->numeric(
79 $this->lng->txt(
"lso_admin_interval_label"),
80 $this->lng->txt(
"lso_admin_interval_byline")
82 ->withAdditionalTransformation(
83 $this->refinery->int()->isGreaterThan(0)
85 ->withAdditionalTransformation(
86 $this->refinery->custom()->transformation(
93 if (isset($values[self::F_POLL_INTERVAL])) {
94 $poll_interval = $poll_interval->withValue($values[self::F_POLL_INTERVAL]);
97 $section = $this->ui_factory->input()->field()->section(
98 [self::F_POLL_INTERVAL => $poll_interval],
99 $this->lng->txt(
"lso_admin_form_title"),
100 $this->lng->txt(
"lso_admin_form_byline")
102 $form = $this->ui_factory->input()->container()->form()
104 ->withAdditionalTransformation(
105 $this->refinery->custom()->transformation(
107 return array_shift(
$data);
117 $this->tpl->setContent(
118 $this->ui_renderer->render($form)
122 protected function edit() : void
125 self::F_POLL_INTERVAL => $this->settings_db->getSettings()->getPollingIntervalSeconds()
127 $form = $this->
getForm($values);
131 protected function save() : void
133 $form = $this->
getForm()->withRequest($this->request);
134 $data = $form->getData();
136 $settings = $this->settings_db->getSettings()
137 ->withPollingIntervalSeconds(
$data[self::F_POLL_INTERVAL]);
138 $this->settings_db->storeSettings(
$settings);
139 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
LearningSequence Administration Settings.
Repository for LSGlobalSettings over ILIAS global settings.
prepareOutput($a_show_subobjects=true)
prepare output
Class ilObjectGUI Basic methods of all Output classes.
__construct(Container $dic, ilPlugin $plugin)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
show(Input\Container\Form\Form $form)
getForm(array $values=[])