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

Public Member Functions

 ilSCORMExplorer ($a_target, &$a_slm_obj)
 Constructor public. More...
 
 getItem ($a_node_id)
 
 getIconImagePathPrefix ()
 
 getNodesToSkip ()
 
 formatHeader ($a_obj_id, $a_option)
 overwritten method from base class public More...
 
 createTarget ($a_type, $a_child)
 Creates Get Parameter private. More...
 
 setOutput ($a_parent_id, $a_depth=0)
 
 isVisible ($a_id, $a_type)
 
 getOutput ($jsApi=false)
 Creates output recursive method public. More...
 
 isClickable ($a_type, $a_id=0, $a_obj=0)
 
 formatItemTable (&$tpl, $a_id, $a_type)
 
 formatObject ($a_node_id, $a_option, $jsApi)
 Creates output recursive method private. More...
 
 getOutputIcons (&$tpl, $a_option, $a_node_id, $scormtype="sco")
 
- Public Member Functions inherited from ilExplorer
 ilExplorer ($a_target)
 Constructor 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 public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string 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 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 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 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 private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter 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,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Data Fields

 $slm_obj
 
- 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 36 of file class.ilSCORMExplorer.php.

Member Function Documentation

◆ createTarget()

ilSCORMExplorer::createTarget (   $a_type,
  $a_child 
)

Creates Get Parameter private.

Parameters
string
integer
Returns
string

Definition at line 107 of file class.ilSCORMExplorer.php.

Referenced by ilHACPExplorer\formatObject(), ilAICCExplorer\formatObject(), and formatObject().

108  {
109  // SET expand parameter:
110  // positive if object is expanded
111  // negative if object is compressed
112  $a_child = ($a_type == '+')
113  ? $a_child
114  : -(int) $a_child;
115 
116  return $_SERVER["PATH_INFO"]."?cmd=explorer&ref_id=".$this->slm_obj->getRefId()."&scexpand=".$a_child;
117  }
+ Here is the caller graph for this function:

◆ formatHeader()

ilSCORMExplorer::formatHeader (   $a_obj_id,
  $a_option 
)

overwritten method from base class public

Parameters
integerobj_id
integerarray options

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

References ilExplorer\$ilias, $lng, and $tpl.

83  {
84  global $lng, $ilias;
85 
86  $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
87 
88  $tpl->setCurrentBlock("row");
89  //$tpl->setVariable("TYPE", $a_option["c_type"]);
90  //$tpl->setVariable("ICON_IMAGE" ,ilUtil::getImagePath("icon_".$a_option["c_type"].".png"));
91  $tpl->setVariable("TITLE", $lng->txt("cont_manifest"));
92  $tpl->setVariable("LINK_TARGET", $this->target."&".$this->target_get."=".$a_obj_id);
93  $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
94  $tpl->parseCurrentBlock();
95 
96  $this->output[] = $tpl->get();
97  }
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:40

◆ formatItemTable()

ilSCORMExplorer::formatItemTable ( $tpl,
  $a_id,
  $a_type 
)

Definition at line 301 of file class.ilSCORMExplorer.php.

References $lng.

Referenced by formatObject().

302  {
303  global $lng;
304 
305  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ formatObject()

ilSCORMExplorer::formatObject (   $a_node_id,
  $a_option,
  $jsApi 
)

Creates output recursive method private.

Parameters
integer
array
Returns
string

Definition at line 315 of file class.ilSCORMExplorer.php.

References $ilBench, $lng, ilExplorer\$target, $tpl, ilSCORMResource\_lookupIdByIdRef(), ilSCORMResource\_lookupScormType(), ilExplorer\buildFrameTarget(), createTarget(), formatItemTable(), ilUtil\getImagePath(), getOutputIcons(), isClickable(), and ilUtil\shortenText().

Referenced by getOutput().

316  {
317  global $lng, $ilBench;
318 
319  //echo "scorm: ".$a_option["title"]." >> ".implode(", ",$a_option["tab"])."<br>";
320 
321  if (!isset($a_node_id) or !is_array($a_option))
322  {
323  $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
324  "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
325  }
326 
327  $tpl = new ilTemplate("tpl.sahs_tree.html", true, true, "Modules/ScormAicc");
328 
329  if ($a_option["c_type"]=="sos")
330  return;
331 
332  if ($a_option["c_type"]=="srs")
333  return;
334 
335  $ilBench->start("SCORMExplorer", "renderIcons");
336  if (is_array($a_option["tab"])) { //test if there are any tabs
337  foreach ($a_option["tab"] as $picture)
338  {
339  if ($picture == 'plus')
340  {
341  $target = $this->createTarget('+',$a_node_id);
342  $tpl->setCurrentBlock("expander");
343  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
344  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.png"));
345  $tpl->parseCurrentBlock();
346  }
347 
348  if ($picture == 'minus' && $this->show_minus)
349  {
350  $target = $this->createTarget('-',$a_node_id);
351  $tpl->setCurrentBlock("expander");
352  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
353  $tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.png"));
354  $tpl->parseCurrentBlock();
355  }
356 
357  if ($picture == 'blank' or $picture == 'winkel'
358  or $picture == 'hoch' or $picture == 'quer' or $picture == 'ecke')
359  {
360  $picture = 'blank';
361  $tpl->setCurrentBlock("lines");
362  $tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".png"));
363  $tpl->parseCurrentBlock();
364  }
365  }
366  }
367  $ilBench->stop("SCORMExplorer", "renderIcons");
368 
369  $ilBench->start("SCORMExplorer", "initSCORMItem");
370  $sc_object =& new ilSCORMItem($a_node_id);
371  $id_ref = $sc_object->getIdentifierRef();
372  $ilBench->stop("SCORMExplorer", "initSCORMItem");
373 
374  $ilBench->start("SCORMExplorer", "initResource");
375  //$sc_res =& new ilSCORMResource();
376  $sc_res_id = ilSCORMResource::_lookupIdByIdRef($id_ref, $sc_object->getSLMId());
377  $ilBench->stop("SCORMExplorer", "initResource");
378 
379  $scormtype = strtolower(ilSCORMResource::_lookupScormType($sc_res_id));
380 
381  $ilBench->start("SCORMExplorer", "renderLink");
382  $ilBench->start("SCORMExplorer", "renderLink_OutputIcons");
383  if ($this->output_icons)
384  {
385  if ($this->isClickable($a_option["c_type"], $a_node_id, $sc_object))
386  {
387  $this->getOutputIcons($tpl, $a_option, $a_node_id, $scormtype);
388  }
389  }
390  $ilBench->stop("SCORMExplorer", "renderLink_OutputIcons");
391 
392  if ($this->isClickable($a_option["c_type"], $a_node_id, $sc_object)) // output link
393  {
394  $ilBench->start("SCORMExplorer", "renderLink_parseLinkBlock");
395  $tpl->setCurrentBlock("link");
396  $frame_target = $this->buildFrameTarget($a_option["c_type"], $a_node_id, $a_option["obj_id"]);
397  if ($frame_target != "")
398  {
399  $tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
400  $tpl->setVariable("LINK_TARGET", "javascript:void(0);");
401  if ($jsApi == true) {
402  $tpl->setVariable("ONCLICK", " onclick=\"parent.API.IliasLaunch('".$a_node_id."');return false;\"");
403  } else {
404  $tpl->setVariable("ONCLICK", " onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API."
405  .($scormtype == 'asset' ? 'IliasLaunchAsset' : 'IliasLaunchSahs')
406  ."('".$a_node_id."');return false;\"");
407  }
408  }
409  $tpl->parseCurrentBlock();
410  $ilBench->stop("SCORMExplorer", "renderLink_parseLinkBlock");
411  }
412  else // output text only
413  {
414  $tpl->setCurrentBlock("text");
415  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
416  $tpl->parseCurrentBlock();
417  }
418  $ilBench->stop("SCORMExplorer", "renderLink");
419 
420  $ilBench->start("SCORMExplorer", "formatItemTable");
421  $this->formatItemTable($tpl, $a_node_id, $a_option["c_type"]);
422  $ilBench->stop("SCORMExplorer", "formatItemTable");
423 
424  $tpl->setCurrentBlock("row");
425  $tpl->parseCurrentBlock();
426 
427  $this->output[] = $tpl->get();
428  }
formatItemTable(&$tpl, $a_id, $a_type)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
getOutputIcons(&$tpl, $a_option, $a_node_id, $scormtype="sco")
global $tpl
Definition: ilias.php:8
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
createTarget($a_type, $a_child)
Creates Get Parameter private.
special template class to simplify handling of ITX/PEAR
SCORM Item.
redirection script todo: (a better solution should control the processing via a xml file) ...
isClickable($a_type, $a_id=0, $a_obj=0)
global $lng
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
_lookupIdByIdRef($a_id_ref, $a_slm_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIconImagePathPrefix()

ilSCORMExplorer::getIconImagePathPrefix ( )

Definition at line 67 of file class.ilSCORMExplorer.php.

Referenced by getOutputIcons().

67  {
68  return "scorm/";
69  }
+ Here is the caller graph for this function:

◆ getItem()

ilSCORMExplorer::getItem (   $a_node_id)

Definition at line 63 of file class.ilSCORMExplorer.php.

63  {
64  return new ilSCORMItem($a_node_id);
65  }
SCORM Item.

◆ getNodesToSkip()

ilSCORMExplorer::getNodesToSkip ( )

Definition at line 71 of file class.ilSCORMExplorer.php.

Referenced by setOutput().

71  {
72  return 2;
73  }
+ Here is the caller graph for this function:

◆ getOutput()

ilSCORMExplorer::getOutput (   $jsApi = false)

Creates output recursive method public.

Returns
string

Definition at line 250 of file class.ilSCORMExplorer.php.

References $ilBench, $options, ilExplorer\createLines(), and formatObject().

251  {
252  global $ilBench;
253 
254  //echo "getOutput <br>";
255  $this->format_options[0]["tab"] = array();
256 
257  $depth = $this->tree->getMaximumDepth();
258 
259  for ($i=0;$i<$depth;++$i)
260  {
261  $this->createLines($i);
262  }
263 
264  foreach ($this->format_options as $key => $options)
265  {
266  if ($options["visible"] and $key != 0)
267  {
268  $ilBench->start("SCORMExplorer", "formatObject");
269  $this->formatObject($options["child"],$options,$jsApi);
270  $ilBench->stop("SCORMExplorer", "formatObject");
271  }
272  }
273 
274  return implode('',$this->output);
275  }
formatObject($a_node_id, $a_option, $jsApi)
Creates output recursive method private.
if(!is_array($argv)) $options
global $ilBench
Definition: ilias.php:18
createLines($a_depth)
Creates lines for explorer view private.
+ Here is the call graph for this function:

◆ getOutputIcons()

ilSCORMExplorer::getOutputIcons ( $tpl,
  $a_option,
  $a_node_id,
  $scormtype = "sco" 
)

Definition at line 430 of file class.ilSCORMExplorer.php.

References $lng, $tpl, ilSCORMItem\_lookupTrackingDataOfUser(), getIconImagePathPrefix(), and ilUtil\getImagePath().

Referenced by ilHACPExplorer\formatObject(), ilAICCExplorer\formatObject(), and formatObject().

431  {
432  global $lng;
433 
434  $tpl->setCurrentBlock("icon");
435 
436  if ($scormtype == 'asset')
437  {
438  $tpl->setVariable('ICON_IMAGE', ilUtil::getImagePath($this->getIconImagePathPrefix()."asset.svg"));
439  $tpl->setVariable('TXT_ALT_IMG', '');
440  $tpl->parseCurrentBlock();
441  return;
442  }
443 
444  $trdata = ilSCORMItem::_lookupTrackingDataOfUser($a_node_id, 0,
445  $this->slm_obj->getId());
446 
447  // status
448  $status = ($trdata["cmi.core.lesson_status"] == "")
449  ? "not attempted"
450  : $trdata["cmi.core.lesson_status"];
451 
452  $statusChar=strtolower(substr($status,0,1));
453  if ($statusChar=="f")
454  $status="failed";
455  else if ($statusChar=="b")
456  $status="browsed";
457  else if ($statusChar=="c")
458  $status="completed";
459  else if ($statusChar=="n")
460  $status="not_attempted";
461  else if ($statusChar=="p")
462  $status="passed";
463  else if ($statusChar=="r")
464  $status="running";
465 
466  $alt = $lng->txt("cont_status").": ".
467  $lng->txt("cont_sc_stat_".str_replace(" ", "_", $status));
468 
469  // score
470  if ($trdata["cmi.core.score.raw"] != "")
471  {
472  $alt.= ", ".$lng->txt("cont_credits").
473  ": ".$trdata["cmi.core.score.raw"];
474  }
475 
476  // total time
477  if ($trdata["cmi.core.total_time"] != "" &&
478  $trdata["cmi.core.total_time"] != "0000:00:00.00")
479  {
480  $alt.= ", ".$lng->txt("cont_total_time").
481  ": ".$trdata["cmi.core.total_time"];
482  }
483 
484  $tpl->setVariable("ICON_NAME", 'scoIcon'.$a_node_id);
485  $tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath($this->getIconImagePathPrefix().str_replace(" ", "_", $status).".svg"));
486  $tpl->setVariable("TXT_ALT_IMG", $alt);
487  $tpl->parseCurrentBlock();
488 
489  }
global $tpl
Definition: ilias.php:8
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
_lookupTrackingDataOfUser($a_item_id, $a_user_id=0, $a_obj_id=0)
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilSCORMExplorer()

ilSCORMExplorer::ilSCORMExplorer (   $a_target,
$a_slm_obj 
)

Constructor public.

Parameters
stringscriptname
intuser_id

Definition at line 52 of file class.ilSCORMExplorer.php.

References ilExplorer\checkPermissions(), ilExplorer\outputIcons(), ilTree\readRootId(), and ilExplorer\setOrderColumn().

53  {
54  parent::ilExplorer($a_target);
55  $this->slm_obj =& $a_slm_obj;
56  $this->tree = new ilSCORMTree($a_slm_obj->getId());
57  $this->root_id = $this->tree->readRootId();
58  $this->checkPermissions(false);
59  $this->outputIcons(true);
60  $this->setOrderColumn("");
61  }
checkPermissions($a_check)
check permissions via rbac
setOrderColumn($a_column)
set the order column public
SCORM Object Tree.
outputIcons($a_icons)
output icons
readRootId()
read root id from database
+ Here is the call graph for this function:

◆ isClickable()

ilSCORMExplorer::isClickable (   $a_type,
  $a_id = 0,
  $a_obj = 0 
)

Definition at line 277 of file class.ilSCORMExplorer.php.

Referenced by formatObject().

278  {
279  if ($a_type != "sit")
280  {
281  return false;
282  }
283  else
284  {
285  if (is_object($a_obj))
286  {
287  $sc_object =& $a_obj;
288  }
289  else
290  {
291  $sc_object =& new ilSCORMItem($a_id);
292  }
293  if ($sc_object->getIdentifierRef() != "")
294  {
295  return true;
296  }
297  }
298  return false;
299  }
SCORM Item.
+ Here is the caller graph for this function:

◆ isVisible()

ilSCORMExplorer::isVisible (   $a_id,
  $a_type 
)

Definition at line 232 of file class.ilSCORMExplorer.php.

Referenced by setOutput().

233  {
234  if ($a_type == "sre")
235  {
236  return false;
237  }
238  else
239  {
240  return true;
241  }
242  }
+ Here is the caller graph for this function:

◆ setOutput()

ilSCORMExplorer::setOutput (   $a_parent_id,
  $a_depth = 0 
)

Definition at line 119 of file class.ilSCORMExplorer.php.

References $tab, ilExplorer\checkFilter(), ilExplorer\getIndex(), getNodesToSkip(), isVisible(), ilExplorer\setExpand(), and ilExplorer\showChilds().

120  {
121 
122  global $rbacadmin, $rbacsystem;
123  static $counter = 0;
124 
125  //echo "setOutput <br>";
126 
127  if (!isset($a_parent_id))
128  {
129  $this->ilias->raiseError(get_class($this)."::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
130  }
131 
132  if ($this->showChilds($a_parent_id))
133  {
134  $objects = $this->tree->getChilds($a_parent_id, $this->order_column);
135  }
136  else
137  {
138  $objects = array();
139  }
140 
141  if (count($objects) > 0)
142  {
143 
144  //moved the scorm-only constant parameter to a function
145  //to be able to reuse the code
146  //$tab = ++$a_depth - 2;
147  $tab = ++$a_depth - $this->getNodesToSkip();
148 
149 
150  // Maybe call a lexical sort function for the child objects
151 
152  //666if ($this->post_sort)
153  //{
154  //$objects = $this->sortNodes($objects);
155  //}
156 
157  foreach ($objects as $key => $object)
158  {
159  //ask for FILTER
160  if ($this->filtered == false or $this->checkFilter($object["c_type"]) == false)
161  {
162  if ($this->isVisible($object["obj_id"], $object["c_type"]))
163  {
164  if ($object["child"] != $this->tree->getRootId())
165  {
166  $parent_index = $this->getIndex($object);
167  }
168  $this->format_options["$counter"]["parent"] = $object["parent"];
169  $this->format_options["$counter"]["child"] = $object["child"];
170  $this->format_options["$counter"]["title"] = $object["title"];
171  $this->format_options["$counter"]["c_type"] = $object["c_type"];
172  $this->format_options["$counter"]["obj_id"] = $object["obj_id"];
173  $this->format_options["$counter"]["desc"] = "obj_".$object["c_type"];
174  $this->format_options["$counter"]["depth"] = $tab;
175  $this->format_options["$counter"]["container"] = false;
176  $this->format_options["$counter"]["visible"] = true;
177 
178  // Create prefix array
179  for ($i = 0; $i < $tab; ++$i)
180  {
181  $this->format_options["$counter"]["tab"][] = 'blank';
182  }
183 
184  if ($object["c_type"]=="sos")
185  $this->setExpand($object["obj_id"]);
186 
187  // fix explorer (sometimes explorer disappears)
188  if ($parent_index == 0)
189  {
190  if (!$this->expand_all and !in_array($object["parent"],$this->expanded))
191  {
192  $this->expanded[] = $object["parent"];
193  }
194  //$this->format_options["$parent_index"]["visible"] = true;
195  }
196 
197  if ($object["child"] != $this->tree->getRootId() and (!$this->expand_all and !in_array($object["parent"],$this->expanded)
198  or !$this->format_options["$parent_index"]["visible"]))
199  {
200  $this->format_options["$counter"]["visible"] = false;
201  }
202 
203  // if object exists parent is container
204  if ($object["child"] != $this->tree->getRootId())
205  {
206  $this->format_options["$parent_index"]["container"] = true;
207 
208  if ($this->expand_all or in_array($object["parent"],$this->expanded))
209  {
210  $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
211  }
212  else
213  {
214  $this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
215  }
216  }
217 
218  ++$counter;
219 
220  // stop recursion if 2. level beyond expanded nodes is reached
221  if ($this->expand_all or in_array($object["parent"],$this->expanded) or ($object["parent"] == 0))
222  {
223  // recursive
224  $this->setOutput($object["child"],$a_depth);
225  }
226  } //if
227  } //if FILTER
228  } //foreach
229  } //if
230  } //function
setOutput($a_parent_id, $a_depth=0)
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id private
showChilds($a_parent_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
redirection script todo: (a better solution should control the processing via a xml file) ...
isVisible($a_id, $a_type)
checkFilter($a_item)
check if item is in filter private
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
+ Here is the call graph for this function:

Field Documentation

◆ $slm_obj

ilSCORMExplorer::$slm_obj

Definition at line 44 of file class.ilSCORMExplorer.php.


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