ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLMMenuObjectSelector.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
6
16{
17
23 public $root_id;
24 public $output;
25 public $ctrl;
27 public $ref_id;
28
35 public function __construct($a_target, &$a_gui_obj)
36 {
37 global $DIC;
38
39 $this->rbacsystem = $DIC->rbac()->system();
40 $this->lng = $DIC->language();
41 $tree = $DIC->repositoryTree();
42 $ilCtrl = $DIC->ctrl();
43
44 $this->ctrl = $ilCtrl;
45
46 $this->gui_obj = $a_gui_obj;
47
48 parent::__construct($a_target);
49 $this->tree = $tree;
50 $this->root_id = $this->tree->readRootId();
51 $this->order_column = "title";
52 $this->setSessionExpandVariable("lm_menu_expand");
53 $this->addFilter("rolf");
54 $this->addFilter("adm");
55 }
56
57 public function setSelectableTypes($a_types)
58 {
59 $this->selectable_types = $a_types;
60 }
61
62 public function setRefId($a_ref_id)
63 {
64 $this->ref_id = $a_ref_id;
65 }
66
67
68 public function buildLinkTarget($a_node_id, $a_type)
69 {
70 if (in_array($a_type, $this->selectable_types)) {
71 $this->ctrl->setParameter($this->gui_obj, 'link_ref_id', $a_node_id);
72 if ($_GET["menu_entry"] > 0) {
73 return $this->ctrl->getLinkTarget($this->gui_obj, 'editMenuEntry');
74 } else {
75 return $this->ctrl->getLinkTarget($this->gui_obj, 'addMenuEntry');
76 }
77 }
78 }
79
80 public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
81 {
82 return '';
83 }
84
85 public function isClickable($a_type, $a_ref_id = 0)
86 {//return true;
87 return in_array($a_type, $this->selectable_types) and $a_ref_id != $this->ref_id;
88 }
89
90 public function showChilds($a_ref_id)
91 {
93
94 if ($a_ref_id == 0) {
95 return true;
96 }
97
98 if ($rbacsystem->checkAccess("read", $a_ref_id)) {
99 return true;
100 } else {
101 return false;
102 }
103 }
104
105
113 public function formatHeader($a_tpl, $a_obj_id, $a_option)
114 {
116
117 $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
118
119 $tpl->setCurrentBlock("text");
120 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
121 $tpl->parseCurrentBlock();
122 $this->output[] = $tpl->get();
123 }
124}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Class ilExplorer class for explorer view in admin frame.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter @access public
__construct($a_target, &$a_gui_obj)
Constructor @access public.
formatHeader($a_tpl, $a_obj_id, $a_option)
overwritten method from base class @access public
showChilds($a_ref_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92