ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjMDSettingsGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 protected ?ilMDSettings $md_settings = null;
30
31 public function __construct(
32 $data,
33 int $id = 0,
34 bool $call_by_reference = true,
35 bool $prepare_output = true
36 ) {
38
39 $this->access_service = new ilMDSettingsAccessService(
40 $this->object->getRefId(),
41 $this->access
42 );
43
44 $this->type = 'mds';
45 $this->lng->loadLanguageModule("meta");
46 }
47
48 public function executeCommand(): void
49 {
50 $next_class = $this->ctrl->getNextClass($this);
51 $cmd = $this->ctrl->getCmd();
52
53 $this->prepareOutput();
54
55 if (
56 !$this->access_service->hasCurrentUserVisibleAccess() ||
57 !$this->access_service->hasCurrentUserReadAccess()
58 ) {
59 throw new ilPermissionException($this->lng->txt('no_permission'));
60 }
61
62 switch ($next_class) {
63 case strtolower(ilMDSettingsControllerGUI::class):
64 $this->tabs_gui->activateTab('md_copyright_oer');
65 $gui = new ilMDSettingsControllerGUI($this);
66 $this->ctrl->forwardCommand($gui);
67 break;
68
69 case strtolower(ilAdvancedMDSettingsGUI::class):
70 $this->tabs_gui->activateTab('md_advanced');
71 $adv_md = new ilAdvancedMDSettingsGUI(
73 $this->ref_id
74 );
75 $this->ctrl->forwardCommand($adv_md);
76 break;
77
78 case strtolower(ilPermissionGUI::class):
79 $this->tabs_gui->activateTab('perm_settings');
80 $perm_gui = new ilPermissionGUI($this);
81 $this->ctrl->forwardCommand($perm_gui);
82 break;
83
84 default:
85 $this->tabs_gui->activateTab('md_copyright_oer');
86 $this->ctrl->redirectByClass(
87 ilMDSettingsControllerGUI::class,
88 ''
89 );
90 break;
91 }
92 }
93
94 protected function getType(): string
95 {
96 return $this->type;
97 }
98
99 protected function getParentObjType(): string
100 {
101 return 'meta';
102 }
103
104 public function getAdminTabs(): void
105 {
106 if (
107 $this->access_service->hasCurrentUserVisibleAccess() &&
108 $this->access_service->hasCurrentUserReadAccess()
109 ) {
110 $this->tabs_gui->addTab(
111 'md_copyright_oer',
112 $this->lng->txt('md_copyright_admin_tab'),
113 $this->ctrl->getLinkTargetByClass(ilMDSettingsControllerGUI::class, 'esrdtfyghujk')
114 );
115
116 $this->tabs_gui->addTab(
117 'md_advanced',
118 $this->lng->txt('md_advanced'),
119 $this->ctrl->getLinkTargetByClass(ilAdvancedMDSettingsGUI::class, '')
120 );
121 }
122
123 if ($this->access_service->hasCurrentUserPermissionsAccess()) {
124 $this->tabs_gui->addTab(
125 'perm_settings',
126 $this->lng->txt('perm_settings'),
127 $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
128 );
129 }
130 }
131
132 protected function MDSettings(): ilMDSettings
133 {
134 if (!isset($this->md_settings)) {
135 $this->md_settings = ilMDSettings::_getInstance();
136 }
137 return $this->md_settings;
138 }
139}
@ilCtrl_Calls ilMDSettingsControllerGUI: ilMDCopyrightConfigurationGUI, ilMDOERSettingsGUI,...
getAdminTabs()
administration tabs show only permissions and trash folder
__construct( $data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
ilMDSettingsAccessService $access_service
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput(bool $show_sub_objects=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc