ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilObjTalkTemplateAdministrationGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
33{
34 public function __construct()
35 {
39 $container = $GLOBALS['DIC'];
40 $language = $container->language();
42 ->http()
43 ->wrapper()
44 ->query()
45 ->retrieve("ref_id", $container->refinery()->kindlyTo()->int());
46 parent::__construct([], $refId, true, false);
47
48 $this->type = 'tala';
49
50 $language->loadLanguageModule("tala");
51 $language->loadLanguageModule('etal');
52 }
53
54 protected function supportsPageEditor(): bool
55 {
56 return false;
57 }
58
59 public function isActiveAdministrationPanel(): bool
60 {
61 return false;
62 }
63
64 public function setContentSubTabs(): void
65 {
66 }
67
68 public function executeCommand(): void
69 {
70 $cmd = $this->ctrl->getCmd();
71 $next_class = $this->ctrl->getNextClass($this);
72
73
74 switch ($next_class) {
75 case 'ilpermissiongui':
76 parent::prepareOutput();
77 $this->tabs_gui->activateTab('perm_settings');
78 $ilPermissionGUI = new ilPermissionGUI($this);
79 $this->ctrl->forwardCommand($ilPermissionGUI);
80 break;
81 case 'ilinfoscreengui':
82 parent::prepareOutput();
83 $this->tabs_gui->activateTab('info_short');
84 $ilInfoScreenGUI = new ilInfoScreenGUI($this);
85 $this->ctrl->forwardCommand($ilInfoScreenGUI);
86 break;
87 case strtolower(ilObjTalkTemplateGUI::class):
88 $ilTalkTemplateGUI = new ilObjTalkTemplateGUI();
89 $ilTalkTemplateGUI->setAdminMode($this->admin_mode);
90 $this->ctrl->setParameter(
91 $this,
92 'ref_id',
94 );
95 $this->tabs->setBackTarget(
96 $this->lng->txt('obj_tala'),
97 $this->ctrl->getLinkTarget($this, 'view')
98 );
99 $this->ctrl->clearParameters($this);
100 $this->ctrl->forwardCommand($ilTalkTemplateGUI);
101 break;
102 default:
103 parent::executeCommand();
104 }
105 }
106
110 protected function setTitleAndDescription(): void
111 {
112 # all possible create permissions
113 parent::setTitleAndDescription();
114 $this->tpl->setTitle($this->lng->txt("objs_tala"));
115 $this->tpl->setDescription($this->lng->txt("objs_tala"));
116
117 $this->tpl->setTitleIcon("", $this->lng->txt("obj_" . $this->object->getType()));
118 }
119
120 protected function showPossibleSubObjects(): void
121 {
122 $subtypes = $this->getCreatableObjectTypes();
123 if (empty($subtypes)) {
124 return;
125 }
127 [$this->buildGroup(
128 self::class,
129 array_keys($subtypes),
130 $this->lng->txt('other'),
131 $subtypes
132 )]
133 );
134 $gui->render();
135 }
136
137 protected function getCreatableObjectTypes(): array
138 {
139 $subtypes = $this->obj_definition->getCreatableSubObjects(
140 $this->object->getType(),
142 $this->object->getRefId()
143 );
144 unset($subtypes[ilObjEmployeeTalkSeries::TYPE]);
145
146 return array_filter(
147 $subtypes,
148 fn($key) => $this->access->checkAccess('create_' . $key, '', $this->ref_id, $this->type),
149 ARRAY_FILTER_USE_KEY
150 );
151 }
152
153 public function viewObject(): void
154 {
155 $this->tabs_gui->activateTab('view_content');
156
157 if (!$this->rbacsystem->checkAccess("read", $this->getRefId())) {
158 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->WARNING);
159 }
160
165 if (!in_array(SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->user->getId()), true)) {
166 $this->tpl->setOnScreenMessage(
168 $this->lng->txt("tala_no_content_without_admin_info")
169 );
170 }
171
172 parent::renderObject();
173 }
174
182 {
183 $this->container_user_filter = new ilContainerUserFilter([
185 ]);
187 $this,
188 $this->getItemPresentation()
189 );
190 }
191
196 public function returnObject(): void
197 {
198 $this->viewObject();
199 }
200
201 protected function getTabs(): void
202 {
203 $read_access_ref_id = $this->rbacsystem->checkAccess('read', $this->object->getRefId());
204 if ($read_access_ref_id) {
205 $this->tabs_gui->addTab('view_content', $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, "view"));
206 $this->tabs_gui->addTab(
207 "info_short",
208 $this->lng->txt('tab_info'),
209 $this->ctrl->getLinkTargetByClass([
210 strtolower(self::class),
211 strtolower(ilInfoScreenGUI::class)
212 ], "showSummary")
213 );
214 }
215 if ($this->tree->getSavedNodeData($this->object->getRefId())) {
216 $this->tabs_gui->addTarget('trash', $this->ctrl->getLinkTarget($this, 'trash'), 'trash', get_class($this));
217 }
218 parent::getTabs();
219 }
220
224 public function getAdminTabs(): void
225 {
226 $this->getTabs();
227 }
228}
Render add new item selector.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Parent class of all container content GUIs.
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
ILIAS Container InternalGUIService $gui
getItemPresentation( $include_empty_blocks=true, ?string $lang=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilInfoScreenGUI.
Class ilObjTalkTemplateAdministrationGUI GUI class.
returnObject()
Not completely sure why this is necessary, after creation of talk templates the redirect leads here.
getContentGUI()
Filter the view by talk templates because the talk series objects are also children of the talk templ...
showPossibleSubObjects()
show possible sub objects (pull down menu)
getTabs()
@abstract overwrite in derived GUI class of your object type
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
Class ilObjTalkTemplateGUI.
buildGroup(string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
const SYSTEM_ROLE_ID
Definition: constants.php:29
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ilObjForumAdministration.
$container
@noRector
Definition: wac.php:37
$GLOBALS["DIC"]
Definition: wac.php:54
$refId
Definition: xapitoken.php:56