19declare(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();
53 if (!$this->access_service->hasCurrentUserReadAccess()) {
57 switch ($next_class) {
59 if (!$cmd || $cmd ===
'view') {
60 $cmd =
'showOERSettings';
73 $this->tpl->setContent($form->getHTML());
78 if (!$this->access_service->hasCurrentUserWriteAccess()) {
79 $this->
ctrl->redirect($this,
"showOERSettings");
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');
87 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'),
true);
88 $form->setValuesByPost();
95 $form->setFormAction($this->
ctrl->getFormAction($this));
97 if ($this->access_service->hasCurrentUserWriteAccess()) {
98 $form->addCommandButton(
'saveOERSettings', $this->
lng->txt(
'save'));
102 $header->setTitle($this->
lng->txt(
'md_settings_licence'));
103 $form->addItem($header);
108 $check->setInfo($this->
lng->txt(
'md_copyright_enable_info'));
116 if (!isset($this->md_settings)) {
Class ilCtrl provides processing control methods.
__construct(ilObjMDSettingsGUI $parent_obj_gui)
ilObjMDSettingsGUI $parent_obj_gui
ilMDSettingsAccessService $access_service
ilMDSettings $md_settings
showOERSettings(?ilPropertyFormGUI $form=null)
ilGlobalTemplateInterface $tpl