32 require_once(
"./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
33 require_once(
"./Modules/ScormAicc/classes/AICC/class.ilAICCTree.php");
34 require_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
47 parent::__construct($a_target);
48 $this->slm_obj = $a_slm_obj;
49 $this->tree =
new ilAICCTree($a_slm_obj->getId());
72 return (strlen($block_object->getDescription())>0);
106 if (!isset($a_node_id)
or !is_array($a_option))
108 $this->
ilias->raiseError(get_class($this).
"::formatObject(): Missing parameter or wrong datatype! ".
109 "node_id: ".$a_node_id.
" options:".var_dump($a_option),$this->
ilias->error_obj->WARNING);
112 $tpl =
new ilTemplate(
"tpl.sahs_tree.html",
true,
true,
"Modules/ScormAicc");
114 if ($a_option[
"c_type"]==
"sos")
117 if ($a_option[
"c_type"]==
"srs")
120 if (is_array($a_option[
"tab"])) {
121 foreach ($a_option[
"tab"] as $picture)
124 if ($picture ==
'plus')
127 $tpl->setCurrentBlock(
"expander");
128 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
130 $tpl->parseCurrentBlock();
134 if ($picture ==
'minus' && $this->show_minus)
137 $tpl->setCurrentBlock(
"expander");
138 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
140 $tpl->parseCurrentBlock();
147 $tpl->setCurrentBlock(
"lines");
149 $tpl->parseCurrentBlock();
154 if ($this->output_icons) {
155 if ($this->
isClickable($a_option[
"c_type"], $a_node_id) && !$a_option[
"c_type"]==
"sbl")
159 if ($this->
isClickable($a_option[
"c_type"], $a_node_id))
161 $tpl->setCurrentBlock(
"link");
163 $frame_target = $this->
buildFrameTarget($a_option[
"c_type"], $a_node_id, $a_option[
"obj_id"]);
164 if ($frame_target !=
"")
166 if ($a_option[
"c_type"]==
"sbl") {
168 $tpl->setVariable(
"TARGET",
" target=\"".$frame_target.
"\"");
172 $tpl->setVariable(
"LINK_TARGET",
"javascript:void(0);");
173 $tpl->setVariable(
"ONCLICK",
" onclick=\"parent.APIFRAME.setupApi();parent.APIFRAME.API.IliasLaunchSahs('".$a_node_id.
"');return false;\"");
176 $tpl->parseCurrentBlock();
180 $tpl->setCurrentBlock(
"text");
182 $tpl->parseCurrentBlock();
186 $tpl->setCurrentBlock(
"row");
187 $tpl->parseCurrentBlock();
189 $this->output[] =
$tpl->get();
194 global $rbacadmin, $rbacsystem;
197 if (!isset($a_parent_id))
199 $this->
ilias->raiseError(get_class($this).
"::setOutput(): No node_id given!",$this->
ilias->error_obj->WARNING);
203 $objects = $this->tree->getChilds($a_parent_id, $this->order_column);
209 if (count($objects) > 0)
217 foreach ($objects as $key => $object) {
219 if ($this->filtered ==
false or $this->
checkFilter($object[
"c_type"]) ==
false) {
220 if ($this->
isVisible($object[
"obj_id"], $object[
"c_type"])) {
229 if ($parent_index == 0) {
233 $this->format_options[
"$counter"][
"visible"] = !$this->
shouldHideCurrentNode($object[
"child"], $parent_index, $object[
"parent"]);
236 if ($object[
"child"] != $this->tree->getRootId()) {
237 $this->format_options[
"$parent_index"][
"container"] =
true;
239 if ($this->expand_all
or in_array($object[
"parent"],$this->expanded)) {
240 $this->format_options[
"$parent_index"][
"tab"][(
$tab-2)] =
'minus';
242 $this->format_options[
"$parent_index"][
"tab"][(
$tab-2)] =
'plus';
247 if ($this->expand_all
or in_array($object[
"parent"],$this->expanded)
or ($object[
"parent"] == 0)) {
249 $this->
setOutput($object[
"child"],$a_depth);
258 for ($i = 0; $i <
$tab; ++$i) {
259 $this->format_options[
"$counter"][
"tab"][] =
'blank';
264 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
265 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
266 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
267 $this->format_options[
"$counter"][
"c_type"] = $object[
"c_type"];
268 $this->format_options[
"$counter"][
"obj_id"] = $object[
"obj_id"];
269 $this->format_options[
"$counter"][
"desc"] =
"obj_".$object[
"c_type"];
270 $this->format_options[
"$counter"][
"depth"] =
$tab;
271 $this->format_options[
"$counter"][
"container"] =
false;
272 $this->format_options[
"$counter"][
"visible"] =
true;
276 if ($c_type ==
"sos") {
282 if ($child != $this->tree->getRootId()) {
288 if (!$this->expand_all && !in_array($parent, $this->expanded)) {
289 $this->expanded[] = $parent;
294 if ($child != $this->tree->getRootId()
295 && (!$this->expand_all
and !in_array($parent, $this->expanded)
296 or !$this->format_options[
"$parent_index"][
"visible"]))
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
createTarget($a_type, $a_child, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter private.
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
setParentExpanded($parent)
__construct($a_target, &$a_slm_obj)
Constructor public.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
checkPermissions($a_check)
check permissions via rbac
getOutputIcons(&$tpl, $a_option, $a_node_id, $scormtype="sco")
tpl is filled with option state
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id private
makeObjectNodeExpandable($c_type, $obj_id)
setOrderColumn($a_column)
set the order column public
formatItemTable(&$tpl, $a_id, $a_type)
formatObject($a_node_id, $a_option)
Creates output recursive method private.
shouldHideCurrentNode($child, $parent_index, $parent)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Explorer View for AICC Learning Modules.
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) ...
Explorer View for SCORM Learning Modules.
isVisible($a_id, $a_type)
Create styles array
The data for the language used.
setOutput($a_parent_id, $a_depth=0)
checkFilter($a_item)
check if item is in filter private
addObjectToOutputArray($counter, $tab, $object)
createPrefixArray($counter, $tab)
isClickable($a_type, $a_id=0)
outputIcons($a_icons)
output icons
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
readRootId()
read root id from database