ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjCourseAdministrationGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=0);
20
28{
29 private const SETTING_COURSES_AND_GROUPS_ENABLED = 'mmbr_my_crs_grp';
30
31 protected function getType(): string
32 {
33 return "crss";
34 }
35
36 protected function getParentObjType(): string
37 {
38 return "crs";
39 }
40
41 protected function getAdministrationFormId(): int
42 {
44 }
45
47 {
48 $checkBox = new ilCheckboxInputGUI($this->lng->txt('crs_my_courses_groups_enabled'), self::SETTING_COURSES_AND_GROUPS_ENABLED);
49 $checkBox->setInfo($this->lng->txt('crs_my_courses_groups_enabled_info'));
50 $checkBox->setChecked((bool) $this->settings->get(self::SETTING_COURSES_AND_GROUPS_ENABLED, 1));
51 $form->addItem($checkBox);
52 return $form;
53 }
54
55 protected function saveChildSettings(ilPropertyFormGUI $form): void
56 {
57 $this->settings->set(self::SETTING_COURSES_AND_GROUPS_ENABLED, (int) $form->getInput(self::SETTING_COURSES_AND_GROUPS_ENABLED));
58 }
59
60 protected function getChildSettingsInfo(int $a_form_id): array
61 {
62 switch ($a_form_id) {
64 $this->lng->loadLanguageModule("crs");
65 $fields = [
66 'crs_my_courses_groups_enabled' => [ (bool) $this->settings->get(self::SETTING_COURSES_AND_GROUPS_ENABLED, 1), ilAdministrationSettingsFormHandler::VALUE_BOOL ]
67 ];
68 return [ [ "editSettings", $fields ] ];
69 }
70 return [];
71 }
72}
This class represents a checkbox property in a property form.
This class represents a property form user interface.
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...