ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
25 var $ctrl;
28
35 function ilLMMenuObjectSelector($a_target,&$a_gui_obj)
36 {
37 global $tree,$ilCtrl;
38
39 $this->ctrl = $ilCtrl;
40
41 $this->gui_obj = $a_gui_obj;
42
43 parent::ilExplorer($a_target);
44 $this->tree = $tree;
45 $this->root_id = $this->tree->readRootId();
46 $this->order_column = "title";
47 $this->setSessionExpandVariable("lm_menu_expand");
48 $this->addFilter("rolf");
49 $this->addFilter("adm");
50 }
51
52 function setSelectableTypes($a_types)
53 {
54 $this->selectable_types = $a_types;
55 }
56
57 function setRefId($a_ref_id)
58 {
59 $this->ref_id = $a_ref_id;
60 }
61
62
63 function buildLinkTarget($a_node_id, $a_type)
64 {
65 if(in_array($a_type,$this->selectable_types))
66 {
67 $this->ctrl->setParameter($this->gui_obj,'link_ref_id',$a_node_id);
68 if ($_GET["menu_entry"] > 0)
69 {
70 return $this->ctrl->getLinkTarget($this->gui_obj,'editMenuEntry');
71 }
72 else
73 {
74 return $this->ctrl->getLinkTarget($this->gui_obj,'addMenuEntry');
75 }
76 }
77 }
78
79 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
80 {
81 return '';
82 }
83
84 function isClickable($a_type, $a_ref_id)
85 {//return true;
86 return in_array($a_type,$this->selectable_types) and $a_ref_id != $this->ref_id;
87 }
88
89 function showChilds($a_ref_id)
90 {
91 global $rbacsystem;
92
93 if ($a_ref_id == 0)
94 {
95 return true;
96 }
97
98 if ($rbacsystem->checkAccess("read", $a_ref_id))
99 {
100 return true;
101 }
102 else
103 {
104 return false;
105 }
106 }
107
108
116 function formatHeader($a_obj_id,$a_option)
117 {
118 global $lng, $ilias;
119
120 $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
121
122 $tpl->setCurrentBlock("text");
123 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
124 $tpl->parseCurrentBlock();
125
126// $tpl->setCurrentBlock("row");
127// $tpl->parseCurrentBlock();
128
129 $this->output[] = $tpl->get();
130 }
131} // END class ilLMMenuObjectSelector
132?>
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
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
ilLMMenuObjectSelector($a_target, &$a_gui_obj)
Constructor @access public.
showChilds($a_ref_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
isClickable($a_type, $a_ref_id)
check if links for certain object type are activated
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
formatHeader($a_obj_id, $a_option)
overwritten method from base class @access public
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
special template class to simplify handling of ITX/PEAR
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40