ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjTalkTemplateAdministrationGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
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  }
52 
53  protected function supportsPageEditor(): bool
54  {
55  return false;
56  }
57 
58  public function isActiveAdministrationPanel(): bool
59  {
60  return false;
61  }
62 
63  public function setContentSubTabs(): void
64  {
65  }
66 
67  public function executeCommand(): void
68  {
69  $cmd = $this->ctrl->getCmd();
70  $next_class = $this->ctrl->getNextClass($this);
71 
72 
73  switch ($next_class) {
74  case 'ilpermissiongui':
75  parent::prepareOutput();
76  $this->tabs_gui->activateTab('perm_settings');
77  $ilPermissionGUI = new ilPermissionGUI($this);
78  $this->ctrl->forwardCommand($ilPermissionGUI);
79  break;
80  case 'ilinfoscreengui':
81  parent::prepareOutput();
82  $this->tabs_gui->activateTab('info_short');
83  $ilInfoScreenGUI = new ilInfoScreenGUI($this);
84  $this->ctrl->forwardCommand($ilInfoScreenGUI);
85  break;
86  case strtolower(ilObjTalkTemplateGUI::class):
87  $ilTalkTemplateGUI = new ilObjTalkTemplateGUI();
88  $ilTalkTemplateGUI->setAdminMode($this->admin_mode);
89  $this->ctrl->setParameter(
90  $this,
91  'ref_id',
93  );
94  $this->tabs->setBackTarget(
95  $this->lng->txt('obj_tala'),
96  $this->ctrl->getLinkTarget($this, 'view')
97  );
98  $this->ctrl->clearParameters($this);
99  $this->ctrl->forwardCommand($ilTalkTemplateGUI);
100  break;
101  default:
102  parent::executeCommand();
103  }
104  }
105 
109  protected function setTitleAndDescription(): void
110  {
111  # all possible create permissions
112  parent::setTitleAndDescription();
113  $this->tpl->setTitle($this->lng->txt("objs_tala"));
114  $this->tpl->setDescription($this->lng->txt("objs_tala"));
115 
116  $this->tpl->setTitleIcon("", $this->lng->txt("obj_" . $this->object->getType()));
117  }
118 
119  protected function showPossibleSubObjects(): void
120  {
121  $gui = new ilObjectAddNewItemGUI($this->object->getRefId());
123  $gui->setCreationUrl($this->ctrl->getLinkTargetByClass(strtolower(ilObjTalkTemplateGUI::class), 'create'));
124  $gui->setDisabledObjectTypes([ilObjEmployeeTalkSeries::TYPE]);
125  $gui->render();
126  }
127 
128  public function viewObject(): void
129  {
130  $this->tabs_gui->activateTab('view_content');
131 
132  if (!$this->rbacsystem->checkAccess("read", $this->getRefId())) {
133  if ($this->rbacsystem->checkAccess("visible", $this->getRefId())) {
134  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_perm_read"));
135  $this->ctrl->redirectByClass(strtolower(ilInfoScreenGUI::class), '');
136  }
137 
138  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->WARNING);
139  }
140 
145  if (!in_array(SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->user->getId()), true)) {
146  $this->tpl->setOnScreenMessage(
148  $this->lng->txt("tala_no_content_without_admin_info")
149  );
150  }
151 
152  parent::renderObject();
153  }
154 
162  {
163  $this->container_user_filter = new ilContainerUserFilter([
165  ]);
166  return new ilContainerByTypeContentGUI(
167  $this,
168  $this->getItemPresentation()
169  );
170  }
171 
172  protected function getTabs(): void
173  {
174  $read_access_ref_id = $this->rbacsystem->checkAccess('visible,read', $this->object->getRefId());
175  if ($read_access_ref_id) {
176  $this->tabs_gui->addTab('view_content', $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, "view"));
177  $this->tabs_gui->addTab("info_short", "Info", $this->ctrl->getLinkTargetByClass(strtolower(ilInfoScreenGUI::class), "showSummary"));
178  }
179  if ($this->tree->getSavedNodeData($this->object->getRefId())) {
180  $this->tabs_gui->addTarget('trash', $this->ctrl->getLinkTarget($this, 'trash'), 'trash', get_class($this));
181  }
182  parent::getTabs();
183  }
184 
188  public function getAdminTabs(): void
189  {
190  $this->getTabs();
191  }
192 }
Class ilInfoScreenGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
const SYSTEM_ROLE_ID
Definition: constants.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$refId
Definition: xapitoken.php:58
$container
Definition: wac.php:14
Parent class of all container content GUIs.
getItemPresentation( $include_empty_blocks=true, ?string $lang=null)
Class ilObjTalkTemplateGUI.
__construct(VocabulariesInterface $vocabularies)
$GLOBALS["DIC"]
Definition: wac.php:31
header include for all ilias files.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getContentGUI()
Filter the view by talk templates because the talk series objects are also children of the talk templ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Container InternalGUIService $gui
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.