ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilMDOERSettingsGUI Class Reference
+ Collaboration diagram for ilMDOERSettingsGUI:

Public Member Functions

 __construct (ilObjMDSettingsGUI $parent_obj_gui)
 
 executeCommand ()
 
 showOERSettings (?ilPropertyFormGUI $form=null)
 
 saveOERSettings ()
 

Protected Member Functions

 initSettingsForm ()
 
 MDSettings ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilObjMDSettingsGUI $parent_obj_gui
 
ilMDSettingsAccessService $access_service
 
ilMDSettings $md_settings = null
 

Detailed Description

Definition at line 21 of file class.ilMDOERSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDOERSettingsGUI::__construct ( ilObjMDSettingsGUI  $parent_obj_gui)

Definition at line 31 of file class.ilMDOERSettingsGUI.php.

32 {
33 global $DIC;
34
35 $this->ctrl = $DIC->ctrl();
36 $this->lng = $DIC->language();
37 $this->tpl = $DIC->ui()->mainTemplate();
38
39 $this->parent_obj_gui = $parent_obj_gui;
40 $this->access_service = new ilMDSettingsAccessService(
41 $this->parent_obj_gui->getRefId(),
42 $DIC->access()
43 );
44
45 $this->lng->loadLanguageModule("meta");
46 }
ilObjMDSettingsGUI $parent_obj_gui
global $DIC
Definition: shib_login.php:26

References $DIC, $parent_obj_gui, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMDOERSettingsGUI::executeCommand ( )

Definition at line 48 of file class.ilMDOERSettingsGUI.php.

48 : void
49 {
50 $next_class = $this->ctrl->getNextClass($this);
51 $cmd = $this->ctrl->getCmd();
52
53 if (!$this->access_service->hasCurrentUserReadAccess()) {
54 throw new ilPermissionException($this->lng->txt('no_permission'));
55 }
56
57 switch ($next_class) {
58 default:
59 if (!$cmd || $cmd === 'view') {
60 $cmd = 'showOERSettings';
61 }
62
63 $this->$cmd();
64 break;
65 }
66 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilMDOERSettingsGUI::initSettingsForm ( )
protected

Definition at line 92 of file class.ilMDOERSettingsGUI.php.

93 {
94 $form = new ilPropertyFormGUI();
95 $form->setFormAction($this->ctrl->getFormAction($this));
96
97 if ($this->access_service->hasCurrentUserWriteAccess()) {
98 $form->addCommandButton('saveOERSettings', $this->lng->txt('save'));
99 }
100
101 $header = new ilFormSectionHeaderGUI();
102 $header->setTitle($this->lng->txt('md_settings_licence'));
103 $form->addItem($header);
104
105 $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'), 'active');
106 $check->setChecked($this->MDSettings()->isCopyrightSelectionActive());
107 $check->setValue('1');
108 $check->setInfo($this->lng->txt('md_copyright_enable_info'));
109 $form->addItem($check);
110
111 return $form;
112 }
$check
Definition: buildRTE.php:81
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a property form user interface.

References $check, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and MDSettings().

Referenced by saveOERSettings(), and showOERSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MDSettings()

ilMDOERSettingsGUI::MDSettings ( )
protected

Definition at line 114 of file class.ilMDOERSettingsGUI.php.

115 {
116 if (!isset($this->md_settings)) {
117 $this->md_settings = ilMDSettings::_getInstance();
118 }
119 return $this->md_settings;
120 }

References $md_settings, and ilMDSettings\_getInstance().

Referenced by initSettingsForm(), and saveOERSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOERSettings()

ilMDOERSettingsGUI::saveOERSettings ( )

Definition at line 76 of file class.ilMDOERSettingsGUI.php.

76 : void
77 {
78 if (!$this->access_service->hasCurrentUserWriteAccess()) {
79 $this->ctrl->redirect($this, "showOERSettings");
80 }
81 $form = $this->initSettingsForm();
82 if ($form->checkInput()) {
83 $this->MDSettings()->activateCopyrightSelection((bool) $form->getInput('active'));
84 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
85 $this->ctrl->redirect($this, 'showOERSettings');
86 }
87 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'), true);
88 $form->setValuesByPost();
89 $this->showOERSettings($form);
90 }
showOERSettings(?ilPropertyFormGUI $form=null)

References ILIAS\Repository\ctrl(), initSettingsForm(), ILIAS\Repository\lng(), MDSettings(), and showOERSettings().

+ Here is the call graph for this function:

◆ showOERSettings()

ilMDOERSettingsGUI::showOERSettings ( ?ilPropertyFormGUI  $form = null)

Definition at line 68 of file class.ilMDOERSettingsGUI.php.

68 : void
69 {
70 if (!$form instanceof ilPropertyFormGUI) {
71 $form = $this->initSettingsForm();
72 }
73 $this->tpl->setContent($form->getHTML());
74 }

References initSettingsForm().

Referenced by saveOERSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access_service

ilMDSettingsAccessService ilMDOERSettingsGUI::$access_service
protected

Definition at line 27 of file class.ilMDOERSettingsGUI.php.

◆ $ctrl

ilCtrl ilMDOERSettingsGUI::$ctrl
protected

Definition at line 23 of file class.ilMDOERSettingsGUI.php.

◆ $lng

ilLanguage ilMDOERSettingsGUI::$lng
protected

Definition at line 25 of file class.ilMDOERSettingsGUI.php.

◆ $md_settings

ilMDSettings ilMDOERSettingsGUI::$md_settings = null
protected

Definition at line 29 of file class.ilMDOERSettingsGUI.php.

Referenced by MDSettings().

◆ $parent_obj_gui

ilObjMDSettingsGUI ilMDOERSettingsGUI::$parent_obj_gui
protected

Definition at line 26 of file class.ilMDOERSettingsGUI.php.

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilMDOERSettingsGUI::$tpl
protected

Definition at line 24 of file class.ilMDOERSettingsGUI.php.


The documentation for this class was generated from the following file: