ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 getAdministrationFormId ()
 

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.

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

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:22
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMDOERSettingsGUI::executeCommand ( )

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

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

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

◆ getAdministrationFormId()

ilMDOERSettingsGUI::getAdministrationFormId ( )
protected

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

References ilAdministrationSettingsFormHandler\FORM_META_COPYRIGHT.

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilMDOERSettingsGUI::initSettingsForm ( )
protected

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

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

Referenced by saveOERSettings(), and showOERSettings().

100  {
101  $form = new ilPropertyFormGUI();
102  $form->setFormAction($this->ctrl->getFormAction($this));
103 
104  if ($this->access_service->hasCurrentUserWriteAccess()) {
105  $form->addCommandButton('saveOERSettings', $this->lng->txt('save'));
106  }
107 
108  $header = new ilFormSectionHeaderGUI();
109  $header->setTitle($this->lng->txt('md_settings_licence'));
110  $form->addItem($header);
111 
112  $check = new ilCheckboxInputGUI($this->lng->txt('md_copyright_enabled'), 'active');
113  $check->setChecked($this->MDSettings()->isCopyrightSelectionActive());
114  $check->setValue('1');
115  $check->setInfo($this->lng->txt('md_copyright_enable_info'));
116  $form->addItem($check);
117 
118  $header = new ilFormSectionHeaderGUI();
119  $header->setTitle($this->lng->txt('md_settings_harvester'));
120  $form->addItem($header);
121 
123  $this->getAdministrationFormId(),
124  $form,
125  $this->parent_obj_gui
126  );
127 
128  $header = new ilFormSectionHeaderGUI();
129  $header->setTitle($this->lng->txt('md_settings_publishing'));
130  $form->addItem($header);
131 
132  $oai_check = new ilCheckboxInputGUI($this->lng->txt('md_oai_pmh_enabled'), 'oai_active');
133  $oai_check->setChecked($this->MDSettings()->isOAIPMHActive());
134  $oai_check->setValue('1');
135  $oai_check->setInfo($this->lng->txt('md_oai_pmh_enabled_info'));
136  $form->addItem($oai_check);
137 
138  $oai_repo_name = new ilTextInputGUI($this->lng->txt('md_oai_repository_name'), 'oai_repository_name');
139  $oai_repo_name->setValue($this->MDSettings()->getOAIRepositoryName());
140  $oai_repo_name->setInfo($this->lng->txt('md_oai_repository_name_info'));
141  $oai_repo_name->setRequired(true);
142  $oai_check->addSubItem($oai_repo_name);
143 
144  $oai_id_prefix = new ilTextInputGUI($this->lng->txt('md_oai_identifier_prefix'), 'oai_identifier_prefix');
145  $oai_id_prefix->setValue($this->MDSettings()->getOAIIdentifierPrefix());
146  $oai_id_prefix->setInfo($this->lng->txt('md_oai_identifier_prefix_info'));
147  $oai_id_prefix->setRequired(true);
148  $oai_check->addSubItem($oai_id_prefix);
149 
150  $oai_contact_mail = new ilTextInputGUI($this->lng->txt('md_oai_contact_mail'), 'oai_contact_mail');
151  $oai_contact_mail->setValue($this->MDSettings()->getOAIContactMail());
152  $oai_contact_mail->setRequired(true);
153  $oai_check->addSubItem($oai_contact_mail);
154 
155  return $form;
156  }
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MDSettings()

ilMDOERSettingsGUI::MDSettings ( )
protected

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

References $md_settings, and ilMDSettings\_getInstance().

Referenced by initSettingsForm(), and saveOERSettings().

158  : ilMDSettings
159  {
160  if (!isset($this->md_settings)) {
161  $this->md_settings = ilMDSettings::_getInstance();
162  }
163  return $this->md_settings;
164  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOERSettings()

ilMDOERSettingsGUI::saveOERSettings ( )

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

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

79  : void
80  {
81  if (!$this->access_service->hasCurrentUserWriteAccess()) {
82  $this->ctrl->redirect($this, "showOERSettings");
83  }
84  $form = $this->initSettingsForm();
85  if ($form->checkInput()) {
86  $this->MDSettings()->activateCopyrightSelection((bool) $form->getInput('active'));
87  $this->MDSettings()->activateOAIPMH((bool) $form->getInput('oai_active'));
88  $this->MDSettings()->saveOAIRepositoryName((string) $form->getInput('oai_repository_name'));
89  $this->MDSettings()->saveOAIIdentifierPrefix((string) $form->getInput('oai_identifier_prefix'));
90  $this->MDSettings()->saveOAIContactMail((string) $form->getInput('oai_contact_mail'));
91  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
92  $this->ctrl->redirect($this, 'showOERSettings');
93  }
94  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'), true);
95  $form->setValuesByPost();
96  $this->showOERSettings($form);
97  }
showOERSettings(?ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ showOERSettings()

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

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

References initSettingsForm().

Referenced by saveOERSettings().

71  : void
72  {
73  if (!$form instanceof ilPropertyFormGUI) {
74  $form = $this->initSettingsForm();
75  }
76  $this->tpl->setContent($form->getHTML());
77  }
+ 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: