ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilOrgUnitExtensionGUI.php
Go to the documentation of this file.
1 <?php
2 
25 {
28 
29  public function __construct(int $a_ref_id = 0, int $a_id_type = self::REPOSITORY_NODE_ID, int $a_parent_node_id = 0)
30  {
31  global $DIC;
32  parent::__construct($a_ref_id, $a_id_type, $a_parent_node_id);
33  $this->ilLocator = $DIC['ilLocator'];
34  $this->tpl = $DIC->ui()->mainTemplate();
35 
36  $this->showTree();
37  }
38 
39  protected function supportsExport(): bool
40  {
41  return false;
42  }
43 
44  protected function lookupParentTitleInCreationMode(): string
45  {
46  $parent = parent::lookupParentTitleInCreationMode();
47  if ($parent == '__OrgUnitAdministration') {
48  return $this->lng->txt("objs_orgu");
49  }
50 
51  return $parent;
52  }
53 
57  protected function supportsCloning(): bool
58  {
59  return false;
60  }
61 
65  protected function setLocator(): void
66  {
67  if ($this->getCreationMode()) {
68  $endnode_id = $this->parent_id;
69  } else {
70  $endnode_id = $this->ref_id;
71  }
72 
73  $path = $this->tree->getPathFull($endnode_id, ilObjOrgUnit::getRootOrgRefId());
74  // add item for each node on path
75  foreach ((array) $path as $key => $row) {
76  if ($row["title"] == "__OrgUnitAdministration") {
77  $row["title"] = $this->lng->txt("objs_orgu");
78  }
79  $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
80  $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass(array(
81  "iladministrationgui",
82  "ilobjorgunitgui",
83  ), "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
84  $this->ctrl->setParameterByClass("ilobjplugindispatchgui", "ref_id", $_GET["ref_id"]);
85  }
86  $this->tpl->setLocator();
87  }
88 
92  public function showTree(): void
93  {
94  $this->ctrl->setParameterByClass("ilObjPluginDispatchGUI", "ref_id", $_GET["ref_id"]);
95  $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $_GET["ref_id"]);
97  "orgu_explorer",
98  array("ilAdministrationGUI", "ilObjOrgUnitGUI"),
99  "showTree",
100  new ilTree(1)
101  );
102  $tree->setTypeWhiteList($this->getTreeWhiteList());
103  if (!$tree->handleCommand()) {
104  $this->tpl->setLeftNavContent($tree->getHTML());
105  }
106  }
107 
108  protected function getTreeWhiteList(): array
109  {
110  $whiteList = array("orgu");
111  $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
112 
113  return array_merge($whiteList, $pls);
114  }
115 }
__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:30
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: shib_login.php:25
$_GET['cmd']
Definition: lti.php:26
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)