ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilOrgUnitExtensionGUI.php
Go to the documentation of this file.
1 <?php
24 {
27 
28  public function __construct(int $a_ref_id = 0, int $a_id_type = self::REPOSITORY_NODE_ID, int $a_parent_node_id = 0)
29  {
30  global $DIC;
31  parent::__construct($a_ref_id, $a_id_type, $a_parent_node_id);
32  $this->ilLocator = $DIC['ilLocator'];
33  $this->tpl = $DIC->ui()->mainTemplate();
34 
35  $this->showTree();
36  }
37 
38  protected function supportsExport(): bool
39  {
40  return false;
41  }
42 
43  protected function lookupParentTitleInCreationMode(): string
44  {
45  $parent = parent::lookupParentTitleInCreationMode();
46  if ($parent == '__OrgUnitAdministration') {
47  return $this->lng->txt("objs_orgu");
48  }
49 
50  return $parent;
51  }
52 
56  protected function supportsCloning(): bool
57  {
58  return false;
59  }
60 
64  protected function setLocator(): void
65  {
66  if ($this->getCreationMode()) {
67  $endnode_id = $this->parent_id;
68  } else {
69  $endnode_id = $this->ref_id;
70  }
71 
72  $path = $this->tree->getPathFull($endnode_id, ilObjOrgUnit::getRootOrgRefId());
73  // add item for each node on path
74  foreach ((array) $path as $key => $row) {
75  if ($row["title"] == "__OrgUnitAdministration") {
76  $row["title"] = $this->lng->txt("objs_orgu");
77  }
78  $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
79  $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass(array(
80  "iladministrationgui",
81  "ilobjorgunitgui",
82  ), "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
83  $this->ctrl->setParameterByClass("ilobjplugindispatchgui", "ref_id", $_GET["ref_id"]);
84  }
85  $this->tpl->setLocator();
86  }
87 
91  public function showTree(): void
92  {
93  $this->ctrl->setParameterByClass("ilObjPluginDispatchGUI", "ref_id", $_GET["ref_id"]);
94  $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $_GET["ref_id"]);
96  "orgu_explorer",
97  array("ilAdministrationGUI", "ilObjOrgUnitGUI"),
98  "showTree",
99  new ilTree(1)
100  );
101  $tree->setTypeWhiteList($this->getTreeWhiteList());
102  if (!$tree->handleCommand()) {
103  $this->tpl->setLeftNavContent($tree->getHTML());
104  }
105  }
106 
107  protected function getTreeWhiteList(): array
108  {
109  $whiteList = array("orgu");
110  $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
111 
112  return array_merge($whiteList, $pls);
113  }
114 }
__construct(int $a_ref_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
showTree()
Views in the Org Unit have the Navigation Tree enabled by default.
$path
Definition: ltiservices.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Object GUI class for repository plugins.
global $DIC
Definition: feed.php:28
$_GET['client_id']
Definition: saml1-acs.php:21
string $key
Consumer key/client ID value.
Definition: System.php:193
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRootOrgRefId()
ilGlobalTemplateInterface $tpl
__construct(Container $dic, ilPlugin $plugin)
setLocator()
Override the locator (breadcrumbs).
static _getFrame(string $a_class)