ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
11{
15 protected $user;
16
20 protected $ctrl;
21
27 public $root_id;
28 public $slm_obj;
29 public $output;
30
37 public function __construct($a_target, $a_templates = false)
38 {
39 global $DIC;
40
41 $this->user = $DIC->user();
42 $this->ctrl = $DIC->ctrl();
43 $this->lng = $DIC->language();
44 $this->templates = $a_templates;
45
46 parent::__construct($a_target);
47
49 $this->addFilter("skrt");
50 $this->addFilter("skll");
51 $this->addFilter("scat");
52 // $this->addFilter("sktr");
53 $this->setTitleLength(999);
54
55 $this->tree = new ilSkillTree();
56 $this->root_id = $this->tree->readRootId();
57
58 $this->setSessionExpandVariable("skpexpand");
59 $this->checkPermissions(false);
60 $this->setPostSort(false);
61
62 $this->setOrderColumn("order_nr");
63 // $this->textwidth = 200;
64
65 $this->force_open_path = array();
66
67 $this->all_nodes = $this->tree->getSubTree($this->tree->getNodeData($this->root_id));
68 foreach ($this->all_nodes as $n) {
69 $this->node[$n["child"]] = $n;
70 $this->child_nodes[$n["parent"]][] = $n;
71 $this->parent[$n["child"]] = $n["parent"];
72 //echo "-$k-"; var_dump($n);
73 }
74
75 // $this->buildSelectableTree($this->root_id);
76 }
77
84 /*
85 function buildSelectableTree($a_node_id)
86 {
87 if (ilSkillTreeNode::_lookupSelfEvaluation($a_node_id))
88 {
89 $this->selectable[$a_node_id] = true;
90 $this->selectable[$this->parent[$a_node_id]] = true;
91 }
92 foreach ($this->getOriginalChildsOfNode($a_node_id) as $n)
93 {
94 $this->buildSelectableTree($n["child"]);
95 }
96 if ($this->selectable[$a_node_id] &&
97 !ilSkillTreeNode::_lookupDraft($a_node_id))
98 {
99 $this->selectable_child_nodes[$this->node[$a_node_id]["parent"]][] =
100 $this->node[$a_node_id];
101 }
102 }*/
103
104
108 public function setForceOpenPath($a_path)
109 {
110 $this->force_open_path = $a_path;
111 }
112
113
121 public function isClickable($a_type, $a_obj_id = 0)
122 {
124 if ($a_type == "skll") {
125 return true;
126 }
127 return false;
128 }
129
133 public function buildLinkTarget($a_node_id, $a_type)
134 {
136
137 $ilCtrl->setParameterByClass("ilsurveyskillgui", "obj_id", $a_node_id);
138 $ret = $ilCtrl->getLinkTargetByClass("ilsurveyskillgui", "selectSkillForQuestion");
139 $ilCtrl->setParameterByClass("ilsurveyskillgui", "obj_id", $_GET["obj_id"]);
140
141 return $ret;
142 }
143
147 public function buildTitle($a_title, $a_id, $a_type)
148 {
150
151 if ($a_type == "sktr") {
153 }
154
155 return $a_title;
156 }
157
161 public function forceExpanded($a_obj_id)
162 {
163 if (in_array($a_obj_id, $this->force_open_path)) {
164 return true;
165 }
166 return false;
167 }
168
172 public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
173 {
174 return "";
175 }
176
183 /* function getMaximumTreeDepth()
184 {
185 $this->tree->getMaximumDepth();
186 }*/
187
194 /*
195 function getChildsOfNode($a_parent_id)
196 {
197 if (is_array($this->selectable_child_nodes[$a_parent_id]))
198 {
199 $childs = $this->selectable_child_nodes[$a_parent_id];
200 $childs = ilUtil::sortArray($childs, "order_nr", "asc", true);
201 return $childs;
202 }
203 return array();
204 }*/
205
212 /* function getOriginalChildsOfNode($a_parent_id)
213 {
214 if (is_array($this->child_nodes[$a_parent_id]))
215 {
216 return $this->child_nodes[$a_parent_id];
217 }
218 return array();
219 }*/
220
224 public function getImage($a_name, $a_type = "", $a_obj_id = "")
225 {
226 if (in_array($a_type, array("sktr"))) {
227 return ilUtil::getImagePath("icon_skll_s.gif");
228 }
229 return ilUtil::getImagePath($a_name);
230 }
231}
user()
Definition: user.php:4
$n
Definition: RandomTest.php:85
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
const IL_FM_POSITIVE
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
setPostSort($a_sort)
process post sorting
setTitleLength($a_length)
Set max title length.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
checkPermissions($a_check)
check permissions via rbac
setOrderColumn($a_column)
set the order column @access public
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Explorer for skill management.
buildLinkTarget($a_node_id, $a_type)
build link target
isClickable($a_type, $a_obj_id=0)
check if links for certain object type are activated
forceExpanded($a_obj_id)
force expansion of node
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
__construct($a_target, $a_templates=false)
Constructor @access public.
getImage($a_name, $a_type="", $a_obj_id="")
Get maximum tree depth.
setForceOpenPath($a_path)
Build selectable tree.
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)
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46