ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
5 require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
6 
16 {
17 
23  var $root_id;
24  var $output;
25  var $ctrl;
27  var $ref_id;
28 
35  function __construct($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::__construct($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 = 0)
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_tpl, $a_obj_id,$a_option)
117  {
118  global $lng;
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  $this->output[] = $tpl->get();
126  }
127 }
128 ?>
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
special template class to simplify handling of ITX/PEAR
__construct($a_target, &$a_gui_obj)
Constructor public.
Class ilExplorer class for explorer view in admin frame.
global $lng
Definition: privfeed.php:17
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
formatHeader($a_tpl, $a_obj_id, $a_option)
overwritten method from base class public
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)