ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLMMenuObjectSelector.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14{
15
21 public $root_id;
22 public $output;
23 public $ctrl;
25 public $ref_id;
26
33 public function __construct($a_target, &$a_gui_obj)
34 {
35 global $DIC;
36
37 $this->rbacsystem = $DIC->rbac()->system();
38 $this->lng = $DIC->language();
39 $tree = $DIC->repositoryTree();
40 $ilCtrl = $DIC->ctrl();
41
42 $this->ctrl = $ilCtrl;
43
44 $this->gui_obj = $a_gui_obj;
45
46 parent::__construct($a_target);
47 $this->tree = $tree;
48 $this->root_id = $this->tree->readRootId();
49 $this->order_column = "title";
50 $this->setSessionExpandVariable("lm_menu_expand");
51 $this->addFilter("rolf");
52 $this->addFilter("adm");
53 }
54
55 public function setSelectableTypes($a_types)
56 {
57 $this->selectable_types = $a_types;
58 }
59
60 public function setRefId($a_ref_id)
61 {
62 $this->ref_id = $a_ref_id;
63 }
64
65
66 public function buildLinkTarget($a_node_id, $a_type)
67 {
68 if (in_array($a_type, $this->selectable_types)) {
69 $this->ctrl->setParameter($this->gui_obj, 'link_ref_id', $a_node_id);
70 if ($_GET["menu_entry"] > 0) {
71 return $this->ctrl->getLinkTarget($this->gui_obj, 'editMenuEntry');
72 } else {
73 return $this->ctrl->getLinkTarget($this->gui_obj, 'addMenuEntry');
74 }
75 }
76 }
77
78 public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
79 {
80 return '';
81 }
82
83 public function isClickable($a_type, $a_ref_id = 0)
84 {//return true;
85 return in_array($a_type, $this->selectable_types) and $a_ref_id != $this->ref_id;
86 }
87
88 public function showChilds($a_ref_id)
89 {
91
92 if ($a_ref_id == 0) {
93 return true;
94 }
95
96 if ($rbacsystem->checkAccess("read", $a_ref_id)) {
97 return true;
98 } else {
99 return false;
100 }
101 }
102
103
111 public function formatHeader($a_tpl, $a_obj_id, $a_option)
112 {
114
115 $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
116
117 $tpl->setCurrentBlock("text");
118 $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
119 $tpl->parseCurrentBlock();
120 $this->output[] = $tpl->get();
121 }
122}
$_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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46