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'];
29 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
32 $this->ui_factory = $DIC[
'ui.factory'];
33 $this->ui_renderer = $DIC[
'ui.renderer'];
34 $this->request = $DIC->http()->request();
35 $this->validation_factory = new \ILIAS\Validation\Factory(
39 $this->transformation_factory = new \ILIAS\Transformation\Factory();
44 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT));
45 if ($this->rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
46 $this->tabs_gui->addTarget(
'perm_settings', $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
'perm'), array(),
'ilpermissiongui');
53 $next_class = $this->ctrl->getNextClass($this);
54 $cmd = $this->ctrl->getCmd();
57 switch ($next_class) {
58 case 'ilpermissiongui':
59 $this->tabs_gui->setTabActive(
'perm_settings');
61 $this->ctrl->forwardCommand($perm_gui);
74 throw new Exception(__METHOD__ .
" :: Unknown command " . $cmd);
81 $target = $this->ctrl->getLinkTargetByClass(self::class, self::CMD_SAVE);
82 $poll_interval = $this->ui_factory->input()->field()->numeric(
83 $this->lng->txt(
"lso_admin_interval_label"),
84 $this->lng->txt(
"lso_admin_interval_byline")
86 ->withAdditionalConstraint($this->validation_factory->greaterThan(0))
87 ->withAdditionalTransformation(
88 $this->transformation_factory->custom(
95 if (isset(
$values[self::F_POLL_INTERVAL])) {
96 $poll_interval = $poll_interval->withValue(
$values[self::F_POLL_INTERVAL]);
99 $section = $this->ui_factory->input()->field()->section(
100 [self::F_POLL_INTERVAL => $poll_interval],
101 $this->lng->txt(
"lso_admin_form_title"),
102 $this->lng->txt(
"lso_admin_form_byline")
104 $form = $this->ui_factory->input()->container()->form()
106 ->withAdditionalTransformation(
107 $this->transformation_factory->custom(
109 return array_shift(
$data);
117 protected function show(Input\Container\Form\Form
$form)
119 $this->tpl->setContent(
120 $this->ui_renderer->render($form)
127 self::F_POLL_INTERVAL => $this->settings_db->getSettings()->getPollingIntervalSeconds()
138 $settings = $this->settings_db->getSettings()
139 ->withPollingIntervalSeconds(
$data[self::F_POLL_INTERVAL]);
140 $this->settings_db->storeSettings(
$settings);
LearningSequence Administration Settings.
Repository for LSGlobalSettings over ILIAS global settings.
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
Class ilObjectGUI Basic methods of all Output classes.
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=[])