Inheritance diagram for ilSCORMExplorer:
Collaboration diagram for ilSCORMExplorer:Public Member Functions | |
| ilSCORMExplorer ($a_target, &$a_slm_obj) | |
| Constructor public. | |
| getItem ($a_node_id) | |
| getIconImagePathPrefix () | |
| getNodesToSkip () | |
| formatHeader ($a_obj_id, $a_option) | |
| overwritten method from base class public | |
| createTarget ($a_type, $a_child) | |
| Creates Get Parameter private. | |
| setOutput ($a_parent_id, $a_depth=0) | |
| getOutput () | |
| Creates output recursive method public. | |
| isClickable ($a_type, $a_id=0) | |
| check if links for certain object type are activated | |
| formatItemTable (&$tpl, $a_id, $a_type) | |
| formatObject ($a_node_id, $a_option) | |
| Creates output recursive method private. | |
| getOutputIcons (&$tpl, $a_option, $a_node_id, $scormtype="sco") | |
Data Fields | |
| $slm_obj | |
Definition at line 36 of file class.ilSCORMExplorer.php.
| ilSCORMExplorer::createTarget | ( | $ | a_type, | |
| $ | a_child | |||
| ) |
Creates Get Parameter private.
| string | ||
| integer |
Reimplemented from ilExplorer.
Definition at line 107 of file class.ilSCORMExplorer.php.
Referenced by formatObject(), ilHACPExplorer::formatObject(), and ilAICCExplorer::formatObject().
{
// SET expand parameter:
// positive if object is expanded
// negative if object is compressed
$a_child = ($a_type == '+')
? $a_child
: -(int) $a_child;
return $_SERVER["PATH_INFO"]."?cmd=explorer&ref_id=".$this->slm_obj->getRefId()."&scexpand=".$a_child;
}
Here is the caller graph for this function:| ilSCORMExplorer::formatHeader | ( | $ | a_obj_id, | |
| $ | a_option | |||
| ) |
overwritten method from base class public
| integer | obj_id | |
| integer | array options |
Reimplemented from ilExplorer.
Definition at line 82 of file class.ilSCORMExplorer.php.
References ilExplorer::$ilias, $lng, and $tpl.
{
global $lng, $ilias;
$tpl = new ilTemplate("tpl.tree.html", true, true);
$tpl->setCurrentBlock("row");
//$tpl->setVariable("TYPE", $a_option["type"]);
//$tpl->setVariable("ICON_IMAGE" ,ilUtil::getImagePath("icon_".$a_option["type"].".gif"));
$tpl->setVariable("TITLE", $lng->txt("cont_manifest"));
$tpl->setVariable("LINK_TARGET", $this->target."&".$this->target_get."=".$a_obj_id);
$tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
$tpl->parseCurrentBlock();
$this->output[] = $tpl->get();
}
| ilSCORMExplorer::formatItemTable | ( | &$ | tpl, | |
| $ | a_id, | |||
| $ | a_type | |||
| ) |
Reimplemented in ilAICCExplorer.
Definition at line 279 of file class.ilSCORMExplorer.php.
References $lng.
Referenced by formatObject().
{
global $lng;
/*
if ($a_type != "sit")
{
return;
}
else
{
$sc_object =& new ilSCORMItem($a_id);
if ($sc_object->getIdentifierRef() != "")
{
$trdata = $sc_object->getTrackingDataOfUser();
// credits
if ($trdata["mastery_score"] != "")
{
$tpl->setCurrentBlock("item_row");
$tpl->setVariable("TXT_KEY", $lng->txt("cont_credits"));
$tpl->setVariable("TXT_VALUE", $trdata["mastery_score"]);
$tpl->parseCurrentBlock();
}
// total time
if ($trdata["total_time"] != "")
{
$tpl->setCurrentBlock("item_row");
$tpl->setVariable("TXT_KEY", $lng->txt("cont_total_time"));
$tpl->setVariable("TXT_VALUE", $trdata["total_time"]);
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("item_table");
$tpl->parseCurrentBlock();
}
}*/
}
Here is the caller graph for this function:| ilSCORMExplorer::formatObject | ( | $ | a_node_id, | |
| $ | a_option | |||
| ) |
Creates output recursive method private.
| integer | ||
| array |
Reimplemented in ilAICCExplorer, and ilHACPExplorer.
Definition at line 329 of file class.ilSCORMExplorer.php.
References $lng, ilExplorer::$target, $tpl, ilExplorer::buildFrameTarget(), createTarget(), formatItemTable(), ilUtil::getImagePath(), getOutputIcons(), isClickable(), and ilUtil::shortenText().
Referenced by getOutput().
{
global $lng;
//echo "scorm: ".$a_option["title"]." >> ".implode(", ",$a_option["tab"])."<br>";
if (!isset($a_node_id) or !is_array($a_option))
{
$this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
"node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
}
$tpl = new ilTemplate("tpl.sahs_tree.html", true, true, true);
if ($a_option["type"]=="sos")
return;
if ($a_option["type"]=="srs")
return;
if (is_array($a_option["tab"])) { //test if there are any tabs
foreach ($a_option["tab"] as $picture)
{
if ($picture == 'plus')
{
$target = $this->createTarget('+',$a_node_id);
$tpl->setCurrentBlock("expander");
$tpl->setVariable("LINK_TARGET_EXPANDER", $target);
$tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/plus.gif"));
$tpl->parseCurrentBlock();
}
if ($picture == 'minus')
{
$target = $this->createTarget('-',$a_node_id);
$tpl->setCurrentBlock("expander");
$tpl->setVariable("LINK_TARGET_EXPANDER", $target);
$tpl->setVariable("IMGPATH", ilUtil::getImagePath("browser/minus.gif"));
$tpl->parseCurrentBlock();
}
if ($picture == 'blank' or $picture == 'winkel'
or $picture == 'hoch' or $picture == 'quer' or $picture == 'ecke')
{
$picture = 'blank';
$tpl->setCurrentBlock("lines");
$tpl->setVariable("IMGPATH_LINES", ilUtil::getImagePath("browser/".$picture.".gif"));
$tpl->parseCurrentBlock();
}
}
}
$sc_object =& new ilSCORMItem($a_node_id);
$id_ref = $sc_object->getIdentifierRef();
$sc_res =& new ilSCORMResource();
$sc_res->readByIdRef($id_ref, $sc_object->getSLMId());
$scormtype = strtolower($sc_res->getScormType());
if ($this->output_icons) {
if ($this->isClickable($a_option["type"], $a_node_id))
$this->getOutputIcons(&$tpl, $a_option, $a_node_id, $scormtype);
}
if ($this->isClickable($a_option["type"], $a_node_id)) // output link
{
$tpl->setCurrentBlock("link");
//$target = (strpos($this->target, "?") === false) ?
// $this->target."?" : $this->target."&";
//$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
//$tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
$frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
if ($frame_target != "")
{
$tpl->setVariable("TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
$tpl->setVariable("LINK_TARGET", "javascript:void(0);");
$tpl->setVariable("ONCLICK", " onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API."
.($scormtype == 'asset' ? 'IliasLaunchAsset' : 'IliasLaunchSahs')
."('".$a_node_id."');return false;\"");
}
$tpl->parseCurrentBlock();
}
else // output text only
{
$tpl->setCurrentBlock("text");
$tpl->setVariable("OBJ_TITLE", ilUtil::shortenText($a_option["title"], $this->textwidth, true));
$tpl->parseCurrentBlock();
}
$this->formatItemTable($tpl, $a_node_id, $a_option["type"]);
$tpl->setCurrentBlock("row");
$tpl->parseCurrentBlock();
$this->output[] = $tpl->get();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSCORMExplorer::getIconImagePathPrefix | ( | ) |
Reimplemented in ilAICCExplorer.
Definition at line 67 of file class.ilSCORMExplorer.php.
Referenced by getOutputIcons().
{
return "scorm/";
}
Here is the caller graph for this function:| ilSCORMExplorer::getItem | ( | $ | a_node_id | ) |
Reimplemented in ilAICCExplorer.
Definition at line 63 of file class.ilSCORMExplorer.php.
Referenced by getOutputIcons().
{
return new ilSCORMItem($a_node_id);
}
Here is the caller graph for this function:| ilSCORMExplorer::getNodesToSkip | ( | ) |
Reimplemented in ilAICCExplorer.
Definition at line 71 of file class.ilSCORMExplorer.php.
Referenced by setOutput().
{
return 2;
}
Here is the caller graph for this function:| ilSCORMExplorer::getOutput | ( | ) |
Creates output recursive method public.
Reimplemented from ilExplorer.
Definition at line 239 of file class.ilSCORMExplorer.php.
References ilExplorer::createLines(), and formatObject().
{
//echo "getOutput <br>";
$this->format_options[0]["tab"] = array();
$depth = $this->tree->getMaximumDepth();
for ($i=0;$i<$depth;++$i)
{
$this->createLines($i);
}
foreach ($this->format_options as $key => $options)
{
if ($options["visible"] and $key != 0)
{
$this->formatObject($options["child"],$options);
}
}
return implode('',$this->output);
}
Here is the call graph for this function:| ilSCORMExplorer::getOutputIcons | ( | &$ | tpl, | |
| $ | a_option, | |||
| $ | a_node_id, | |||
| $ | scormtype = "sco" | |||
| ) |
Definition at line 423 of file class.ilSCORMExplorer.php.
References $lng, $status, $tpl, getIconImagePathPrefix(), ilUtil::getImagePath(), and getItem().
Referenced by formatObject(), ilHACPExplorer::formatObject(), and ilAICCExplorer::formatObject().
{
global $lng;
$tpl->setCurrentBlock("icon");
if ($scormtype == 'asset')
{
$tpl->setVariable('ICON_IMAGE', ilUtil::getImagePath($this->getIconImagePathPrefix()."asset.gif"));
$tpl->setVariable('TXT_ALT_IMG', '');
$tpl->parseCurrentBlock();
return;
}
$sc_object = & $this->getItem($a_node_id);
$trdata = $sc_object->getTrackingDataOfUser();
// status
$status = ($trdata["cmi.core.lesson_status"] == "")
? "not attempted"
: $trdata["cmi.core.lesson_status"];
$statusChar=strtolower(substr($status,0,1));
if ($statusChar=="f")
$status="failed";
else if ($statusChar=="b")
$status="browsed";
else if ($statusChar=="c")
$status="completed";
else if ($statusChar=="n")
$status="not_attempted";
else if ($statusChar=="p")
$status="passed";
else if ($statusChar=="r")
$status="running";
$alt = $lng->txt("cont_status").": ".
$lng->txt("cont_sc_stat_".str_replace(" ", "_", $status));
// score
if ($trdata["cmi.core.score.raw"] != "")
{
$alt.= ", ".$lng->txt("cont_credits").
": ".$trdata["cmi.core.score.raw"];
}
// total time
if ($trdata["cmi.core.total_time"] != "" &&
$trdata["cmi.core.total_time"] != "0000:00:00.00")
{
$alt.= ", ".$lng->txt("cont_total_time").
": ".$trdata["cmi.core.total_time"];
}
$tpl->setVariable("ICON_NAME", 'scoIcon'.$a_node_id);
$tpl->setVariable("ICON_IMAGE", ilUtil::getImagePath($this->getIconImagePathPrefix().str_replace(" ", "_", $status).".gif"));
$tpl->setVariable("TXT_ALT_IMG", $alt);
$tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSCORMExplorer::ilSCORMExplorer | ( | $ | a_target, | |
| &$ | a_slm_obj | |||
| ) |
Constructor public.
| string | scriptname | |
| int | user_id |
Definition at line 52 of file class.ilSCORMExplorer.php.
References ilExplorer::checkPermissions(), ilExplorer::ilExplorer(), ilExplorer::outputIcons(), and ilExplorer::setOrderColumn().
{
parent::ilExplorer($a_target);
$this->slm_obj =& $a_slm_obj;
$this->tree = new ilSCORMTree($a_slm_obj->getId());
$this->root_id = $this->tree->readRootId();
$this->checkPermissions(false);
$this->outputIcons(true);
$this->setOrderColumn("");
}
Here is the call graph for this function:| ilSCORMExplorer::isClickable | ( | $ | a_type, | |
| $ | a_ref_id = 0 | |||
| ) |
check if links for certain object type are activated
| string | $a_type object type |
Reimplemented from ilExplorer.
Reimplemented in ilAICCExplorer.
Definition at line 262 of file class.ilSCORMExplorer.php.
Referenced by formatObject().
{
if ($a_type != "sit")
{
return false;
}
else
{
$sc_object =& new ilSCORMItem($a_id);
if ($sc_object->getIdentifierRef() != "")
{
return true;
}
}
return false;
}
Here is the caller graph for this function:| ilSCORMExplorer::setOutput | ( | $ | a_parent_id, | |
| $ | a_depth = 0 | |||
| ) |
Definition at line 119 of file class.ilSCORMExplorer.php.
References $counter, $rbacadmin, $rbacsystem, $tab, ilExplorer::checkFilter(), ilExplorer::getIndex(), getNodesToSkip(), ilExplorer::setExpand(), and ilExplorer::showChilds().
{
global $rbacadmin, $rbacsystem;
static $counter = 0;
//echo "setOutput <br>";
if (!isset($a_parent_id))
{
$this->ilias->raiseError(get_class($this)."::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
}
if ($this->showChilds($a_parent_id))
{
$objects = $this->tree->getChilds($a_parent_id, $this->order_column);
}
else
{
$objects = array();
}
if (count($objects) > 0)
{
//moved the scorm-only constant parameter to a function
//to be able to reuse the code
//$tab = ++$a_depth - 2;
$tab = ++$a_depth - $this->getNodesToSkip();
// Maybe call a lexical sort function for the child objects
//666if ($this->post_sort)
//{
//$objects = $this->sortNodes($objects);
//}
foreach ($objects as $key => $object)
{
//ask for FILTER
if ($this->filtered == false or $this->checkFilter($object["type"]) == false)
{
if ($rbacsystem->checkAccess("visible",$object["child"]) || (!$this->rbac_check))
{
if ($object["child"] != $this->tree->getRootId())
{
$parent_index = $this->getIndex($object);
}
$this->format_options["$counter"]["parent"] = $object["parent"];
$this->format_options["$counter"]["child"] = $object["child"];
$this->format_options["$counter"]["title"] = $object["title"];
$this->format_options["$counter"]["type"] = $object["type"];
$this->format_options["$counter"]["obj_id"] = $object["obj_id"];
$this->format_options["$counter"]["desc"] = "obj_".$object["type"];
$this->format_options["$counter"]["depth"] = $tab;
$this->format_options["$counter"]["container"] = false;
$this->format_options["$counter"]["visible"] = true;
// Create prefix array
for ($i = 0; $i < $tab; ++$i)
{
$this->format_options["$counter"]["tab"][] = 'blank';
}
if ($object["type"]=="sos")
$this->setExpand($object["obj_id"]);
// fix explorer (sometimes explorer disappears)
if ($parent_index == 0)
{
if (!in_array($object["parent"],$this->expanded))
{
$this->expanded[] = $object["parent"];
}
//$this->format_options["$parent_index"]["visible"] = true;
}
if ($object["child"] != $this->tree->getRootId() and (!in_array($object["parent"],$this->expanded)
or !$this->format_options["$parent_index"]["visible"]))
{
$this->format_options["$counter"]["visible"] = false;
}
// if object exists parent is container
if ($object["child"] != $this->tree->getRootId())
{
$this->format_options["$parent_index"]["container"] = true;
if (in_array($object["parent"],$this->expanded))
{
$this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
}
else
{
$this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
}
}
++$counter;
// stop recursion if 2. level beyond expanded nodes is reached
if (in_array($object["parent"],$this->expanded) or ($object["parent"] == 0))
{
// recursive
$this->setOutput($object["child"],$a_depth);
}
} //if
} //if FILTER
} //foreach
} //if
} //function
Here is the call graph for this function:| ilSCORMExplorer::$slm_obj |
Definition at line 44 of file class.ilSCORMExplorer.php.
1.7.1