ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSCORM2004EditorExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
5
15{
19 public function __construct($a_parent_obj, $a_parent_cmd, $a_slm)
20 {
21 global $ilUser;
22
23 $this->slm = $a_slm;
24
25 $tree = new ilTree($this->slm->getId());
26 $tree->setTableNames('sahs_sc13_tree','sahs_sc13_tree_node');
27 $tree->setTreeTablePK("slm_id");
28
29 parent::__construct("scorm_ed_exp", $a_parent_obj, $a_parent_cmd, $tree);
30
31 //$this->setTypeWhiteList(array("du", "chap", "page"));
32 $this->setSkipRootNode(false);
33 $this->setAjax(false);
34 }
35
42 function getNodeContent($a_node)
43 {
44 global $lng;
45
46 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
47 {
48 return $this->slm->getTitle();
49 }
50
51 return $a_node["title"];
52 }
53
60 function getNodeIcon($a_node)
61 {
62 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
63 {
64 $icon = ilUtil::getImagePath("icon_sahs.svg");
65 }
66 else
67 {
68 $icon = ilUtil::getImagePath("icon_".$a_node["type"].".svg");
69 }
70
71 return $icon;
72 }
73
80 function getNodeIconAlt($a_node)
81 {
82 global $lng;
83
84 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
85 {
86 return $this->slm->getTitle();
87 }
88
89 return parent::getNodeIconAlt($a_node);
90 }
91
98 function isNodeHighlighted($a_node)
99 {
100 if ($a_node["child"] == $_GET["obj_id"] ||
101 ($_GET["obj_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
102 {
103 return true;
104 }
105 return false;
106 }
107
114 function getNodeHref($a_node)
115 {
116 global $ilCtrl;
117
118 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
119 {
120 $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "obj_id", $a_node["child"]);
121 $ret = $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showOrganization");
122 $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "obj_id", $_GET["obj_id"]);
123 return $ret;
124 }
125
126 switch($a_node["type"])
127 {
128 case "page":
129 $ilCtrl->setParameterByClass("ilScorm2004PageNodeGUI", "obj_id", $a_node["child"]);
130 $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004PageNodeGUI", "edit");
131 $ilCtrl->setParameterByClass("ilScorm2004PageNodeGUI", "obj_id", $_GET["obj_id"]);
132 return $ret;
133 break;
134
135 case "chap":
136 $ilCtrl->setParameterByClass("ilScorm2004ChapterGUI", "obj_id", $a_node["child"]);
137 $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004ChapterGUI", "showOrganization");
138 $ilCtrl->setParameterByClass("ilScorm2004ChapterGUI", "obj_id", $_GET["obj_id"]);
139 return $ret;
140 break;
141
142 case "sco":
143 $ilCtrl->setParameterByClass("ilScorm2004ScoGUI", "obj_id", $a_node["child"]);
144 $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004ScoGUI", "showOrganization");
145 $ilCtrl->setParameterByClass("ilScorm2004ScoGUI", "obj_id", $_GET["obj_id"]);
146 return $ret;
147 break;
148
149 case "ass":
150 $ilCtrl->setParameterByClass("ilScorm2004AssetGUI", "obj_id", $a_node["child"]);
151 $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004AssetGUI", "showOrganization");
152 $ilCtrl->setParameterByClass("ilScorm2004AssetGUI", "obj_id", $_GET["obj_id"]);
153 return $ret;
154 break;
155 }
156 }
157
158}
159
160?>
$_GET["client_id"]
setSkipRootNode($a_val)
Set skip root node.
isNodeHighlighted($a_node)
Is node highlighted?
__construct($a_parent_obj, $a_parent_cmd, $a_slm)
Constructor.
getNodeIconAlt($a_node)
Get node icon alt text.
Explorer class that works on tree objects (Services/Tree)
getNodeId($a_node)
Get id for node.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15