ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilSurveySkillExplorer.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
6 
15 require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
16 
18 {
24  var $root_id;
25  var $slm_obj;
26  var $output;
27 
34  function __construct($a_target, $a_templates = false)
35  {
36  $this->templates = $a_templates;
37 
38  parent::__construct($a_target);
39 
41  $this->addFilter("skrt");
42  $this->addFilter("skll");
43  $this->addFilter("scat");
44 // $this->addFilter("sktr");
45  $this->setTitleLength(999);
46 
47  include_once("./Services/Skill/classes/class.ilSkillTree.php");
48  $this->tree = new ilSkillTree();
49  $this->root_id = $this->tree->readRootId();
50 
51  $this->setSessionExpandVariable("skpexpand");
52  $this->checkPermissions(false);
53  $this->setPostSort(false);
54 
55  $this->setOrderColumn("order_nr");
56 // $this->textwidth = 200;
57 
58  $this->force_open_path = array();
59 
60  $this->all_nodes = $this->tree->getSubTree($this->tree->getNodeData($this->root_id));
61  foreach ($this->all_nodes as $n)
62  {
63  $this->node[$n["child"]] = $n;
64  $this->child_nodes[$n["parent"]][] = $n;
65  $this->parent[$n["child"]] = $n["parent"];
66 //echo "-$k-"; var_dump($n);
67  }
68 
69 // $this->buildSelectableTree($this->root_id);
70  }
71 
78 /*
79  function buildSelectableTree($a_node_id)
80  {
81  if (ilSkillTreeNode::_lookupSelfEvaluation($a_node_id))
82  {
83  $this->selectable[$a_node_id] = true;
84  $this->selectable[$this->parent[$a_node_id]] = true;
85  }
86  foreach ($this->getOriginalChildsOfNode($a_node_id) as $n)
87  {
88  $this->buildSelectableTree($n["child"]);
89  }
90  if ($this->selectable[$a_node_id] &&
91  !ilSkillTreeNode::_lookupDraft($a_node_id))
92  {
93  $this->selectable_child_nodes[$this->node[$a_node_id]["parent"]][] =
94  $this->node[$a_node_id];
95  }
96  }*/
97 
98 
102  function setForceOpenPath($a_path)
103  {
104  $this->force_open_path = $a_path;
105  }
106 
107 
115  function isClickable($a_type, $a_obj_id = 0)
116  {
117  global $ilUser;
118  if ($a_type == "skll")
119  {
120  return true;
121  }
122  return false;
123  }
124 
128  function buildLinkTarget($a_node_id, $a_type)
129  {
130  global $ilCtrl;
131 
132  $ilCtrl->setParameterByClass("ilsurveyskillgui", "obj_id", $a_node_id);
133  $ret = $ilCtrl->getLinkTargetByClass("ilsurveyskillgui", "selectSkillForQuestion");
134  $ilCtrl->setParameterByClass("ilsurveyskillgui", "obj_id", $_GET["obj_id"]);
135 
136  return $ret;
137  }
138 
142  function buildTitle($a_title, $a_id, $a_type)
143  {
144  global $lng;
145 
146  if ($a_type == "sktr")
147  {
148  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
150 // $a_title.= " (".ilSkillTreeNode::_lookupTitle($tid).")";
151  }
152 
153 /* if (ilSkillTreeNode::_lookupSelfEvaluation($a_id))
154  {
155  $a_title.= " [".$lng->txt("add")."]";
156  }*/
157 
158  return $a_title;
159  }
160 
164  function forceExpanded($a_obj_id)
165  {
166  if (in_array($a_obj_id, $this->force_open_path))
167  {
168  return true;
169  }
170  return false;
171  }
172 
176  function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
177  {
178  return "";
179  }
180 
187 /* function getMaximumTreeDepth()
188  {
189  $this->tree->getMaximumDepth();
190  }*/
191 
198 /*
199  function getChildsOfNode($a_parent_id)
200  {
201  if (is_array($this->selectable_child_nodes[$a_parent_id]))
202  {
203  $childs = $this->selectable_child_nodes[$a_parent_id];
204  $childs = ilUtil::sortArray($childs, "order_nr", "asc", true);
205  return $childs;
206  }
207  return array();
208  }*/
209 
216 /* function getOriginalChildsOfNode($a_parent_id)
217  {
218  if (is_array($this->child_nodes[$a_parent_id]))
219  {
220  return $this->child_nodes[$a_parent_id];
221  }
222  return array();
223  }*/
224 
228  function getImage($a_name, $a_type = "", $a_obj_id = "")
229  {
230  if (in_array($a_type, array("sktr")))
231  {
232  return ilUtil::getImagePath("icon_skll_s.gif");
233  }
234  return ilUtil::getImagePath($a_name);
235  }
236 
237 }
238 ?>
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
setPostSort($a_sort)
process post sorting
forceExpanded($a_obj_id)
force expansion of node
buildLinkTarget($a_node_id, $a_type)
build link target
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
Skill tree.
$_GET["client_id"]
setTitleLength($a_length)
Set max title length.
const IL_FM_POSITIVE
checkPermissions($a_check)
check permissions via rbac
isClickable($a_type, $a_obj_id=0)
check if links for certain object type are activated
__construct($a_target, $a_templates=false)
Constructor public.
setOrderColumn($a_column)
set the order column public
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:93
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
Get frame target.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
static _lookupTemplateId($a_obj_id)
Lookup template ID.
$n
Definition: RandomTest.php:80
Explorer for skill management.
Create styles array
The data for the language used.
Class ilExplorer class for explorer view in admin frame.
getImage($a_name, $a_type="", $a_obj_id="")
Get maximum tree depth.
setForceOpenPath($a_path)
Build selectable tree.
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public