ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilOrgUnitExtensionGUI.php
Go to the documentation of this file.
1<?php
2
3
10{
11
15 protected $ilLocator;
16
17
25 public function __construct($a_ref_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
26 {
27 global $DIC;
28 $ilLocator = $DIC['ilLocator'];
29 parent::__construct($a_ref_id, $a_id_type, $a_parent_node_id);
30 $this->ilLocator = $ilLocator;
31 $this->showTree();
32 }
33
34
41 protected function getPlugin()
42 {
43 if (!$this->plugin) {
44 $this->plugin = ilPlugin::getPluginObject(IL_COMP_MODULE, "OrgUnit", "orguext", ilPlugin::lookupNameForId(IL_COMP_MODULE, "OrgUnit", "orguext", $this->getType()));
45 if (!$this->plugin instanceof ilOrgUnitExtensionPlugin) {
46 throw new ilPluginException("ilObjectPluginGUI: Could not instantiate plugin object for type " . $this->getType() . ".");
47 }
48 }
49
50 return $this->plugin;
51 }
52
53
57 protected function supportsExport()
58 {
59 return false;
60 }
61
62
67 {
68 $parent = parent::lookupParentTitleInCreationMode();
69 if ($parent == '__OrgUnitAdministration') {
70 return $this->lng->txt("objs_orgu");
71 }
72
73 return $parent;
74 }
75
79 protected function supportsCloning()
80 {
81 return false;
82 }
83
84
88 protected function setLocator()
89 {
90 global $DIC;
91 $tpl = $DIC['tpl'];
92 if ($this->getCreationMode()) {
93 $endnode_id = $this->parent_id;
94 } else {
95 $endnode_id = $this->ref_id;
96 }
97
98 $path = $this->tree->getPathFull($endnode_id, ilObjOrgUnit::getRootOrgRefId());
99 // add item for each node on path
100 foreach ((array) $path as $key => $row) {
101 if ($row["title"] == "__OrgUnitAdministration") {
102 $row["title"] = $this->lng->txt("objs_orgu");
103 }
104 $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
105 $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass(array(
106 "iladministrationgui",
107 "ilobjorgunitgui",
108 ), "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
109 $this->ctrl->setParameterByClass("ilobjplugindispatchgui", "ref_id", $_GET["ref_id"]);
110 }
111 $tpl->setLocator();
112 }
113
114
118 public function showTree()
119 {
120 $this->ctrl->setParameterByClass("ilObjPluginDispatchGUI", "ref_id", $_GET["ref_id"]);
121 $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $_GET["ref_id"]);
122 $tree = new ilOrgUnitExplorerGUI("orgu_explorer", array("ilAdministrationGUI", "ilObjOrgUnitGUI"), "showTree", new ilTree(1));
123 $tree->setTypeWhiteList($this->getTreeWhiteList());
124 if (!$tree->handleCommand()) {
125 $this->tpl->setLeftNavContent($tree->getHTML());
126 }
127 }
128
129
133 protected function getTreeWhiteList()
134 {
135 $whiteList = array("orgu");
136 $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
137
138 return array_merge($whiteList, $pls);
139 }
140}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_MODULE
static _getFrame($a_class, $a_type='')
Get content frame name.
static getRootOrgRefId()
getType()
Functions that must be overwritten.
getCreationMode()
get creation mode
Class ilOrgUnitExplorerGUI.
Class ilOrgUnitExtensionGUI.
setLocator()
Override the locator (breadcrumbs).
__construct($a_ref_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
ilOrgUnitExtensionGUI constructor.
showTree()
Views in the Org Unit have the Navigation Tree enabled by default.
Class ilOrgUnitExtensionPlugin.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
static lookupNameForId($a_ctype, $a_cname, $a_slot_id, $a_plugin_id)
Lookup name for id.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$key
Definition: croninfo.php:18
global $DIC
Definition: saml.php:7