ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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->hasCurrentUserReadAccess()
57 ) {
58 throw new ilPermissionException($this->lng->txt('no_permission'));
59 }
60
61 switch ($next_class) {
62 case strtolower(ilMDSettingsControllerGUI::class):
63 $this->tabs_gui->activateTab('md_copyright_oer');
64 $gui = new ilMDSettingsControllerGUI($this);
65 $this->ctrl->forwardCommand($gui);
66 break;
67
68 case strtolower(ilAdvancedMDSettingsGUI::class):
69 $this->tabs_gui->activateTab('md_advanced');
70 $adv_md = new ilAdvancedMDSettingsGUI(
72 $this->ref_id
73 );
74 $this->ctrl->forwardCommand($adv_md);
75 break;
76
77 case strtolower(ilPermissionGUI::class):
78 $this->tabs_gui->activateTab('perm_settings');
79 $perm_gui = new ilPermissionGUI($this);
80 $this->ctrl->forwardCommand($perm_gui);
81 break;
82
83 default:
84 $this->tabs_gui->activateTab('md_copyright_oer');
85 $this->ctrl->redirectByClass(
86 ilMDSettingsControllerGUI::class,
87 ''
88 );
89 break;
90 }
91 }
92
93 protected function getType(): string
94 {
95 return $this->type;
96 }
97
98 protected function getParentObjType(): string
99 {
100 return 'meta';
101 }
102
103 public function getAdminTabs(): void
104 {
105 if (
106 $this->access_service->hasCurrentUserReadAccess()
107 ) {
108 $this->tabs_gui->addTab(
109 'md_copyright_oer',
110 $this->lng->txt('md_copyright_admin_tab'),
111 $this->ctrl->getLinkTargetByClass(ilMDSettingsControllerGUI::class, 'esrdtfyghujk')
112 );
113
114 $this->tabs_gui->addTab(
115 'md_advanced',
116 $this->lng->txt('md_advanced'),
117 $this->ctrl->getLinkTargetByClass(ilAdvancedMDSettingsGUI::class, '')
118 );
119 }
120
121 if ($this->access_service->hasCurrentUserPermissionsAccess()) {
122 $this->tabs_gui->addTab(
123 'perm_settings',
124 $this->lng->txt('perm_settings'),
125 $this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
126 );
127 }
128 }
129
130 protected function MDSettings(): ilMDSettings
131 {
132 if (!isset($this->md_settings)) {
133 $this->md_settings = ilMDSettings::_getInstance();
134 }
135 return $this->md_settings;
136 }
137}
@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