ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilShopRepositoryExplorer Class Reference
+ Inheritance diagram for ilShopRepositoryExplorer:
+ Collaboration diagram for ilShopRepositoryExplorer:

Public Member Functions

 __construct ($a_target, $a_top_node=0)
 
 setForceOpenPath ($a_path)
 set force open path More...
 
 buildLinkTarget ($a_node_id, $a_type)
 note: most of this stuff is used by ilCourseContentInterface too More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path More...
 
 isClickable ($a_type, $a_ref_id, $a_obj_id=0)
 
 showChilds ($a_ref_id, $a_obj_id=0)
 
 isVisible ($a_ref_id, $a_type)
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 overwritten method from base class @access public More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes More...
 
 forceExpanded ($a_node)
 Force expansion of node. More...
 
- Public Member Functions inherited from ilExplorer
 ilExplorer ($a_target)
 Constructor @access public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column @access public More...
 
 setOrderDirection ($a_direction)
 set the order direction @access public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string @access public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string @access public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method @access public. More...
 
 modifyChilds ($a_parent_id, $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method @access public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method @access private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter @access private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view @access private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING @access private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id @access private More...
 
 addFilter ($a_item)
 adds item to the filter @access public More...
 
 delFilter ($a_item)
 removes item from the filter @access public More...
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter @access public More...
 
 checkFilter ($a_item)
 check if item is in filter @access private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array @access private More...
 

Data Fields

 $root_id
 
 $output
 
 $ctrl
 
- Data Fields inherited from ilExplorer
 $id
 
 $ilias
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Detailed Description

Definition at line 9 of file class.ilShopRepositoryExplorer.php.

Constructor & Destructor Documentation

◆ __construct()

ilShopRepositoryExplorer::__construct (   $a_target,
  $a_top_node = 0 
)
Parameters
$a_target
int$a_top_node

Definition at line 24 of file class.ilShopRepositoryExplorer.php.

25 {
26 global $tree, $ilCtrl;
27
28 $this->ctrl = $ilCtrl;
29
30 $this->force_open_path = array();
31
32 parent::ilExplorer($a_target);
33 $this->tree = $tree;
34 $this->root_id = $this->tree->readRootId();
35 $this->order_column = "title";
36 $this->frame_target = false;
37 $this->setSessionExpandVariable("repexpand");
38 #$this->setTitle($lng->txt("overview"));
39
40# Es sollen nur container angezeigt werden, die entweder als container (z.B. Kurse) kaufbar sind oder kaufbare Objekte enthalten können!
41
42/* if ($ilSetting->get("repository_tree_pres") == "" ||
43 ($ilSetting->get("rep_tree_limit_grp_crs") && $a_top_node == 0))
44 {*/
45 $this->addFilter("root");
46 $this->addFilter("cat");
47 $this->addFilter('catr');
48 $this->addFilter("grp");
49 $this->addFilter("icrs");
50 $this->addFilter("crs");
51 $this->addFilter('crsr');
52 $this->addFilter('rcrs');
53
54# $this->addFilter("file");
55# $this->addFilter("tst");
56# $this->addFilter("exc");
57 $this->setFiltered(true);
59/* }
60 else if ($ilSetting->get("repository_tree_pres") == "all_types")
61 {
62 foreach ($objDefinition->getAllRBACObjects() as $rtype)
63 {
64 $this->addFilter($rtype);
65 }
66 $this->setFiltered(true);
67 $this->setFilterMode(IL_FM_POSITIVE);
68 }*/
69 }
const IL_FM_POSITIVE
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter @access public
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
setFiltered($a_bool)
active/deactivate the filter @access public
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ilExplorer\$tree, ilExplorer\addFilter(), IL_FM_POSITIVE, ilExplorer\setFiltered(), ilExplorer\setFilterMode(), and ilExplorer\setSessionExpandVariable().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildLinkTarget()

ilShopRepositoryExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

note: most of this stuff is used by ilCourseContentInterface too

Reimplemented from ilExplorer.

Definition at line 82 of file class.ilShopRepositoryExplorer.php.

83 {
84 global $ilCtrl;
85 switch($a_type)
86 {
87
88 case "cat":
89 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
90
91 case "catr":
92 return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
93
94 case "grp":
95 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
96
97 case "crs":
98 return "ilias.php?baseClass=ilshopcontroller&ref_id=".$a_node_id;
99
100 case "crsr":
101 return "ilias.php?cmd=redirect&baseClass=ilshopcontroller&ref_id=".$a_node_id;
102
103 case "icrs":
104 $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $a_node_id);
105 $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjilinccoursegui"), "");
106 $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $_GET["ref_id"]);
107 return $link;
108
109 case 'rcrs':
110 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
111 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
112 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
113 return $link;
114
115 default:
116 include_once('./Services/Link/classes/class.ilLink.php');
117 return ilLink::_getStaticLink($a_node_id, $a_type, true);
118
119 }
120 }
$_GET["client_id"]

References $_GET, $ilCtrl, and ilLink\_getStaticLink().

+ Here is the call graph for this function:

◆ forceExpanded()

ilShopRepositoryExplorer::forceExpanded (   $a_node)

Force expansion of node.

Parameters

return

Reimplemented from ilExplorer.

Definition at line 393 of file class.ilShopRepositoryExplorer.php.

394 {
395 if (in_array($a_node, $this->force_open_path))
396 {
397 return true;
398 }
399 return false;
400 }

◆ formatHeader()

ilShopRepositoryExplorer::formatHeader ( $tpl,
  $a_obj_id,
  $a_option 
)

overwritten method from base class @access public

Parameters
integera_obj_id
integerarray options
Returns
string

Reimplemented from ilExplorer.

Definition at line 296 of file class.ilShopRepositoryExplorer.php.

297 {
298 global $lng, $tree;
299
300 // custom icons
301 $path = ilObject::_getIcon($a_obj_id, "tiny", "root");
302
303 $tpl->setCurrentBlock("icon");
304 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
305 $title = $nd["title"];
306
307 if ($title == "ILIAS")
308 {
309 $title = $lng->txt("repository");
310 }
311
312 $tpl->setVariable("ICON_IMAGE", $path);
313 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("icon")." ".$title);
314 $tpl->parseCurrentBlock();
315
316 $tpl->setCurrentBlock("link");
317 $tpl->setVariable("TITLE", $title);
318 $tpl->setVariable("LINK_TARGET", "ilias.php?baseClass=ilshopcontroller&ref_id=1");
319
320 #$tpl->setVariable("TARGET", " target=\"_self\"");
321 $tpl->parseCurrentBlock();
322
323 $tpl->setCurrentBlock("element");
324 $tpl->parseCurrentBlock();
325 }
global $tpl
Definition: ilias.php:8
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
$nd
Definition: error.php:9
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22

References $lng, $nd, $path, $tpl, ilExplorer\$tree, and ilObject\_getIcon().

+ Here is the call graph for this function:

◆ getImage()

ilShopRepositoryExplorer::getImage (   $a_name,
  $a_type = "",
  $a_obj_id = "" 
)

get image path

Reimplemented from ilExplorer.

Definition at line 125 of file class.ilShopRepositoryExplorer.php.

126 {
127 if ($a_type != "")
128 {
129 return ilObject::_getIcon($a_obj_id, "tiny", $a_type);
130 }
131
132 return parent::getImage($a_name);
133 }

References ilObject\_getIcon().

+ Here is the call graph for this function:

◆ isClickable()

ilShopRepositoryExplorer::isClickable (   $a_type,
  $a_ref_id,
  $a_obj_id = 0 
)

Definition at line 135 of file class.ilShopRepositoryExplorer.php.

136 {
137 global $rbacsystem,$ilDB,$ilUser,$ilAccess;
138
140 {
141 return false;
142 }
143
144 switch ($a_type)
145 {
146 case "crs":
147 return $ilAccess->checkAccess("read", "", $a_ref_id);
148
149 // visible groups can allways be clicked; group processing decides
150 // what happens next
151 case "grp":
152 return true;
153
154 case 'tst':
155 if(!$rbacsystem->checkAccess("read", $a_ref_id))
156 {
157 return false;
158 }
159
160 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s",$a_obj_id);
161 $res = $ilDB->query($query);
162 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
163 {
164 return (bool) $row->complete;
165 }
166 return false;
167
168 case 'svy':
169 if(!$rbacsystem->checkAccess("read", $a_ref_id))
170 {
171 return false;
172 }
173
174 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s",$a_obj_id);
175 $res = $ilDB->query($query);
176 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
177 {
178 return (bool) $row->complete;
179 }
180 return false;
181
182 // media pools can only be edited
183 case "mep":
184 if ($rbacsystem->checkAccess("read", $a_ref_id))
185 {
186 return true;
187 }
188 else
189 {
190 return false;
191 }
192 break;
193
194 case 'crsr':
195 case 'catr':
196 include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
198
199
200 // all other types are only clickable, if read permission is given
201 default:
202 if ($rbacsystem->checkAccess("read", $a_ref_id))
203 {
204 // check if lm is online
205 if ($a_type == "lm")
206 {
207 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
208 $lm_obj =& new ilObjLearningModule($a_ref_id);
209 if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
210 {
211 return false;
212 }
213 }
214 // check if fblm is online
215 if ($a_type == "htlm")
216 {
217 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
218 $lm_obj =& new ilObjFileBasedLM($a_ref_id);
219 if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
220 {
221 return false;
222 }
223 }
224 // check if fblm is online
225 if ($a_type == "sahs")
226 {
227 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
228 $lm_obj =& new ilObjSAHSLearningModule($a_ref_id);
229 if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write',$a_ref_id)))
230 {
231 return false;
232 }
233 }
234 // check if glossary is online
235 if ($a_type == "glo")
236 {
237 $obj_id = ilObject::_lookupObjectId($a_ref_id);
238 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
239 if((!ilObjGlossary::_lookupOnline($obj_id)) &&
240 (!$rbacsystem->checkAccess('write',$a_ref_id)))
241 {
242 return false;
243 }
244 }
245
246 return true;
247 }
248 else
249 {
250 return false;
251 }
252 break;
253 }
254 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
_checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _isAccessible($a_ref_id)
Check if target is accessible and not deleted.
File Based Learning Module (HTML) object.
_lookupOnline($a_id)
check wether content object is online
Class ilObjLearningModule.
Class ilObjSCORMLearningModule.
static _lookupObjectId($a_ref_id)
lookup object id
global $ilDB
global $ilUser
Definition: imgupload.php:15

References $ilDB, $ilUser, $query, $res, $row, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObjGlossary\_lookupOnline(), and DB_FETCHMODE_OBJECT.

+ Here is the call graph for this function:

◆ isVisible()

ilShopRepositoryExplorer::isVisible (   $a_ref_id,
  $a_type 
)

Reimplemented from ilExplorer.

Definition at line 278 of file class.ilShopRepositoryExplorer.php.

279 {
280 global $ilAccess,$tree;
281
282 if(!$ilAccess->checkAccess('visible', '', $a_ref_id))
283 {
284 return false;
285 }
286 return true;
287 }

References ilExplorer\$tree.

◆ setForceOpenPath()

ilShopRepositoryExplorer::setForceOpenPath (   $a_path)

set force open path

Definition at line 74 of file class.ilShopRepositoryExplorer.php.

75 {
76 $this->force_open_path = $a_path;
77 }

◆ showChilds()

ilShopRepositoryExplorer::showChilds (   $a_ref_id,
  $a_obj_id = 0 
)

Definition at line 256 of file class.ilShopRepositoryExplorer.php.

257 {
258 global $rbacsystem;
259
260 if ($a_ref_id == 0)
261 {
262 return true;
263 }
265 {
266 return false;
267 }
268 if ($rbacsystem->checkAccess("read", $a_ref_id))
269 {
270 return true;
271 }
272 else
273 {
274 return false;
275 }
276 }

References ilConditionHandler\_checkAllConditionsOfTarget().

+ Here is the call graph for this function:

◆ sortNodes()

ilShopRepositoryExplorer::sortNodes (   $a_nodes,
  $a_parent_obj_id 
)

sort nodes

@access public

Parameters

return

Reimplemented from ilExplorer.

Definition at line 334 of file class.ilShopRepositoryExplorer.php.

335 {
336 global $objDefinition;
337
338 if ($a_parent_obj_id > 0)
339 {
340 $parent_type = ilObject::_lookupType($a_parent_obj_id);
341 }
342 else
343 {
344 $parent_type = "dummy";
345 $this->type_grps["dummy"] = array("root" => "dummy");
346 }
347
348 if (empty($this->type_grps[$parent_type]))
349 {
350 $this->type_grps[$parent_type] =
351 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
352 }
353 $group = array();
354
355 foreach ($a_nodes as $node)
356 {
357 $g = $objDefinition->getGroupOfObj($node["type"]);
358 if ($g == "")
359 {
360 $g = $node["type"];
361 }
362 $group[$g][] = $node;
363 }
364
365 $nodes = array();
366 foreach ($this->type_grps[$parent_type] as $t => $g)
367 {
368 if (is_array($group[$t]))
369 {
370 // do we have to sort this group??
371 include_once("./Services/Container/classes/class.ilContainer.php");
372 include_once("./Services/Container/classes/class.ilContainerSorting.php");
373 $sort = ilContainerSorting::_getInstance($a_parent_obj_id);
374 $group = $sort->sortItems($group);
375
376 foreach ($group[$t] as $k => $item)
377 {
378 $nodes[] = $item;
379 }
380 }
381 }
382
383 return $nodes;
384 //return parent::sortNodes($a_nodes,$a_parent_obj_id);
385 }
static _getInstance($a_obj_id)
get instance by obj_id
static _lookupType($a_id, $a_reference=false)
lookup object type

References $t, ilContainerSorting\_getInstance(), and ilObject\_lookupType().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilShopRepositoryExplorer::$ctrl

Definition at line 18 of file class.ilShopRepositoryExplorer.php.

◆ $output

ilShopRepositoryExplorer::$output

Definition at line 17 of file class.ilShopRepositoryExplorer.php.

◆ $root_id

ilShopRepositoryExplorer::$root_id

Definition at line 16 of file class.ilShopRepositoryExplorer.php.


The documentation for this class was generated from the following file: