ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
66  protected function lookupParentTitleInCreationMode()
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 }
$path
Definition: aliased.php:25
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
showTree()
Views in the Org Unit have the Navigation Tree enabled by default.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static lookupNameForId(string $a_ctype, string $a_cname, string $a_slot_id, string $a_plugin_id)
getType()
Functions that must be overwritten.
const IL_COMP_MODULE
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Class ilOrgUnitExtensionGUI.
static getRootOrgRefId()
$row
static _getFrame($a_class, $a_type='')
Get content frame name.
__construct($a_ref_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
ilOrgUnitExtensionGUI constructor.
setLocator()
Override the locator (breadcrumbs).
Class ilOrgUnitExplorerGUI.
$key
Definition: croninfo.php:18
Class ilOrgUnitExtensionPlugin.