ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilObjCourseAdministrationGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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.
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-...
Membership Administration Settings.