ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilConditionSelector.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once "./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php";
5
14{
15
16 protected $highlighted_parent = null;
17 protected $clickable_types = array();
18 protected $ref_id = null;
19
29 public function __construct($a_parent_obj, $a_parent_cmd, $a_selection_gui = null, $a_selection_cmd = "add",
30 $a_selection_par = "source_id")
31 {
32 parent::__construct($a_parent_obj, $a_parent_cmd, $a_selection_gui, $a_selection_cmd,
33 $a_selection_par);
34
35 $this->setAjax(true);
36 }
37
44 function isNodeVisible($a_node)
45 {
46 global $ilAccess, $tree;
47
48 if (!$ilAccess->checkAccess('read', '', $a_node["child"]))
49 {
50 return false;
51 }
52 //remove childs of target object
53 if($tree->getParentId($a_node["child"]) == $this->getRefId())
54 {
55 return false;
56 }
57
58 return true;
59 }
60
67 function isNodeClickable($a_node)
68 {
69 if(!parent::isNodeClickable($a_node))
70 return false;
71
72 if($a_node["child"] == $this->getRefId())
73 {
74 return false;
75 }
76
77 return true;
78 }
79
85 function setRefId($a_ref_id)
86 {
87 global $tree;
88
89 $this->ref_id = $a_ref_id;
90
91 //can target object be highlighted?
92 $target_type = ilObject::_lookupType($a_ref_id,true);
93
94 if(!in_array($target_type,$this->getTypeWhiteList()))
95 {
96 $this->highlighted_parent = $tree->getParentId($a_ref_id);
97 }
98 }
99
105 function getRefId()
106 {
107 return $this->ref_id;
108 }
109
116 function isNodeHighlighted($a_node)
117 {
118 //highlight parent if target object cant be highlighted
119 if($this->highlighted_parent == $a_node["child"])
120 {
121 return true;
122 }
123
124 return parent::isNodeHighlighted($a_node);
125 }
126
127
128
129
130}
isNodeHighlighted($a_node)
Is node highlighted?
setRefId($a_ref_id)
set ref id of target object
isNodeVisible($a_node)
Is node visible.
getRefId()
get ref id of target object
__construct($a_parent_obj, $a_parent_cmd, $a_selection_gui=null, $a_selection_cmd="add", $a_selection_par="source_id")
Construct.
isNodeClickable($a_node)
Is node clickable?
static _lookupType($a_id, $a_reference=false)
lookup object type
Explorer for selecting repository items.
getTypeWhiteList()
Get type white list.
$target_type
Definition: goto.php:87