33 require_once(
"./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
34 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMTree.php");
55 $this->slm_obj =& $a_slm_obj;
86 $tpl =
new ilTemplate(
"tpl.tree.html",
true,
true,
"Services/UIComponent/Explorer");
88 $tpl->setCurrentBlock(
"row");
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();
96 $this->output[] =
$tpl->get();
112 $a_child = ($a_type ==
'+')
116 return $_SERVER[
"PATH_INFO"].
"?cmd=explorer&ref_id=".$this->slm_obj->getRefId().
"&scexpand=".$a_child;
122 global $rbacadmin, $rbacsystem;
127 if (!isset($a_parent_id))
129 $this->ilias->raiseError(get_class($this).
"::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
134 $objects = $this->tree->getChilds($a_parent_id, $this->order_column);
141 if (count($objects) > 0)
157 foreach ($objects as $key => $object)
160 if ($this->filtered ==
false or $this->
checkFilter($object[
"c_type"]) ==
false)
162 if ($this->
isVisible($object[
"obj_id"], $object[
"c_type"]))
164 if ($object[
"child"] != $this->tree->getRootId())
166 $parent_index = $this->
getIndex($object);
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;
179 for ($i = 0; $i <
$tab; ++$i)
181 $this->format_options[
"$counter"][
"tab"][] =
'blank';
184 if ($object[
"c_type"]==
"sos")
188 if ($parent_index == 0)
190 if (!$this->expand_all and !in_array($object[
"parent"],$this->expanded))
192 $this->expanded[] = $object[
"parent"];
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"]))
200 $this->format_options[
"$counter"][
"visible"] =
false;
204 if ($object[
"child"] != $this->tree->getRootId())
206 $this->format_options[
"$parent_index"][
"container"] =
true;
208 if ($this->expand_all or in_array($object[
"parent"],$this->expanded))
210 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
214 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
221 if ($this->expand_all or in_array($object[
"parent"],$this->expanded) or ($object[
"parent"] == 0))
224 $this->
setOutput($object[
"child"],$a_depth);
234 if ($a_type ==
"sre")
255 $this->format_options[0][
"tab"] = array();
257 $depth = $this->tree->getMaximumDepth();
259 for ($i=0;$i<$depth;++$i)
264 foreach ($this->format_options as $key => $options)
266 if ($options[
"visible"] and $key != 0)
268 $ilBench->start(
"SCORMExplorer",
"formatObject");
270 $ilBench->stop(
"SCORMExplorer",
"formatObject");
274 return implode(
'',$this->output);
279 if ($a_type !=
"sit")
285 if (is_object($a_obj))
287 $sc_object =& $a_obj;
293 if ($sc_object->getIdentifierRef() !=
"")
321 if (!isset($a_node_id) or !is_array($a_option))
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);
327 $tpl =
new ilTemplate(
"tpl.sahs_tree.html",
true,
true,
"Modules/ScormAicc");
329 if ($a_option[
"c_type"]==
"sos")
332 if ($a_option[
"c_type"]==
"srs")
335 $ilBench->start(
"SCORMExplorer",
"renderIcons");
336 if (is_array($a_option[
"tab"])) {
337 foreach ($a_option[
"tab"] as $picture)
339 if ($picture ==
'plus')
342 $tpl->setCurrentBlock(
"expander");
343 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
345 $tpl->parseCurrentBlock();
348 if ($picture ==
'minus' && $this->show_minus)
351 $tpl->setCurrentBlock(
"expander");
352 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
354 $tpl->parseCurrentBlock();
357 if ($picture ==
'blank' or $picture ==
'winkel'
358 or $picture ==
'hoch' or $picture ==
'quer' or $picture ==
'ecke')
361 $tpl->setCurrentBlock(
"lines");
363 $tpl->parseCurrentBlock();
367 $ilBench->stop(
"SCORMExplorer",
"renderIcons");
369 $ilBench->start(
"SCORMExplorer",
"initSCORMItem");
371 $id_ref = $sc_object->getIdentifierRef();
372 $ilBench->stop(
"SCORMExplorer",
"initSCORMItem");
374 $ilBench->start(
"SCORMExplorer",
"initResource");
377 $ilBench->stop(
"SCORMExplorer",
"initResource");
381 $ilBench->start(
"SCORMExplorer",
"renderLink");
382 $ilBench->start(
"SCORMExplorer",
"renderLink_OutputIcons");
383 if ($this->output_icons)
385 if ($this->
isClickable($a_option[
"c_type"], $a_node_id, $sc_object))
390 $ilBench->stop(
"SCORMExplorer",
"renderLink_OutputIcons");
392 if ($this->
isClickable($a_option[
"c_type"], $a_node_id, $sc_object))
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 !=
"")
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;\"");
404 $tpl->setVariable(
"ONCLICK",
" onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API."
405 .($scormtype ==
'asset' ?
'IliasLaunchAsset' :
'IliasLaunchSahs')
406 .
"('".$a_node_id.
"');return false;\"");
409 $tpl->parseCurrentBlock();
410 $ilBench->stop(
"SCORMExplorer",
"renderLink_parseLinkBlock");
414 $tpl->setCurrentBlock(
"text");
416 $tpl->parseCurrentBlock();
418 $ilBench->stop(
"SCORMExplorer",
"renderLink");
420 $ilBench->start(
"SCORMExplorer",
"formatItemTable");
422 $ilBench->stop(
"SCORMExplorer",
"formatItemTable");
424 $tpl->setCurrentBlock(
"row");
425 $tpl->parseCurrentBlock();
427 $this->output[] =
$tpl->get();
434 $tpl->setCurrentBlock(
"icon");
436 if ($scormtype ==
'asset')
439 $tpl->setVariable(
'TXT_ALT_IMG',
'');
440 $tpl->parseCurrentBlock();
445 $this->slm_obj->getId());
448 $status = ($trdata[
"cmi.core.lesson_status"] ==
"")
450 : $trdata[
"cmi.core.lesson_status"];
452 $statusChar=strtolower(substr($status,0,1));
453 if ($statusChar==
"f")
455 else if ($statusChar==
"b")
457 else if ($statusChar==
"c")
459 else if ($statusChar==
"n")
460 $status=
"not_attempted";
461 else if ($statusChar==
"p")
463 else if ($statusChar==
"r")
466 $alt = $lng->txt(
"cont_status").
": ".
467 $lng->txt(
"cont_sc_stat_".str_replace(
" ",
"_", $status));
470 if ($trdata[
"cmi.core.score.raw"] !=
"")
472 $alt.=
", ".$lng->txt(
"cont_credits").
473 ": ".$trdata[
"cmi.core.score.raw"];
477 if ($trdata[
"cmi.core.total_time"] !=
"" &&
478 $trdata[
"cmi.core.total_time"] !=
"0000:00:00.00")
480 $alt.=
", ".$lng->txt(
"cont_total_time").
481 ": ".$trdata[
"cmi.core.total_time"];
484 $tpl->setVariable(
"ICON_NAME",
'scoIcon'.$a_node_id);
486 $tpl->setVariable(
"TXT_ALT_IMG", $alt);
487 $tpl->parseCurrentBlock();