ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  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  {
115  $lng = $this->lng;
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 }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
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.
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)