19 declare(strict_types=1);
35 $this->
ctrl = $DIC->ctrl();
36 $this->
lng = $DIC->language();
37 $this->tpl = $DIC->ui()->mainTemplate();
41 $this->parent_obj_gui->getRefId(),
45 $this->
lng->loadLanguageModule(
"meta");
50 $next_class = $this->
ctrl->getNextClass($this);
51 $cmd = $this->
ctrl->getCmd();
54 !$this->access_service->hasCurrentUserVisibleAccess() ||
55 !$this->access_service->hasCurrentUserReadAccess()
60 switch ($next_class) {
62 if (!$cmd || $cmd ===
'view') {
63 $cmd =
'showOERSettings';
76 $this->tpl->setContent($form->getHTML());
81 if (!$this->access_service->hasCurrentUserWriteAccess()) {
82 $this->
ctrl->redirect($this,
"showOERSettings");
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');
94 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'),
true);
95 $form->setValuesByPost();
102 $form->setFormAction($this->
ctrl->getFormAction($this));
104 if ($this->access_service->hasCurrentUserWriteAccess()) {
105 $form->addCommandButton(
'saveOERSettings', $this->
lng->txt(
'save'));
109 $header->setTitle($this->
lng->txt(
'md_settings_licence'));
110 $form->addItem($header);
115 $check->setInfo($this->
lng->txt(
'md_copyright_enable_info'));
119 $header->setTitle($this->
lng->txt(
'md_settings_harvester'));
120 $form->addItem($header);
125 $this->parent_obj_gui
129 $header->setTitle($this->
lng->txt(
'md_settings_publishing'));
130 $form->addItem($header);
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);
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);
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);
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);
160 if (!isset($this->md_settings)) {
getAdministrationFormId()
ilObjMDSettingsGUI $parent_obj_gui
ilMDSettingsAccessService $access_service
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilMDSettings $md_settings
ilGlobalTemplateInterface $tpl
showOERSettings(?ilPropertyFormGUI $form=null)
__construct(ilObjMDSettingsGUI $parent_obj_gui)