ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
5 
15 {
19  protected $user;
20 
24  public function __construct($a_parent_obj, $a_parent_cmd, $a_slm)
25  {
26  global $DIC;
27 
28  $this->user = $DIC->user();
29  $this->lng = $DIC->language();
30  $this->ctrl = $DIC->ctrl();
31  $ilUser = $DIC->user();
32 
33  $this->slm = $a_slm;
34 
35  $tree = new ilTree($this->slm->getId());
36  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
37  $tree->setTreeTablePK("slm_id");
38 
39  parent::__construct("scorm_ed_exp", $a_parent_obj, $a_parent_cmd, $tree);
40 
41  //$this->setTypeWhiteList(array("du", "chap", "page"));
42  $this->setSkipRootNode(false);
43  $this->setAjax(false);
44  }
45 
52  public function getNodeContent($a_node)
53  {
54  $lng = $this->lng;
55 
56  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
57  return $this->slm->getTitle();
58  }
59 
60  return $a_node["title"];
61  }
62 
69  public function getNodeIcon($a_node)
70  {
71  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
72  $icon = ilUtil::getImagePath("icon_sahs.svg");
73  } else {
74  $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
75  }
76 
77  return $icon;
78  }
79 
86  public function getNodeIconAlt($a_node)
87  {
88  $lng = $this->lng;
89 
90  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
91  return $this->slm->getTitle();
92  }
93 
94  return parent::getNodeIconAlt($a_node);
95  }
96 
103  public function isNodeHighlighted($a_node)
104  {
105  if ($a_node["child"] == $_GET["obj_id"] ||
106  ($_GET["obj_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
107  return true;
108  }
109  return false;
110  }
111 
118  public function getNodeHref($a_node)
119  {
121 
122  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
123  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "obj_id", $a_node["child"]);
124  $ret = $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showOrganization");
125  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui", "obj_id", $_GET["obj_id"]);
126  return $ret;
127  }
128 
129  switch ($a_node["type"]) {
130  case "page":
131  $ilCtrl->setParameterByClass("ilScorm2004PageNodeGUI", "obj_id", $a_node["child"]);
132  $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004PageNodeGUI", "edit");
133  $ilCtrl->setParameterByClass("ilScorm2004PageNodeGUI", "obj_id", $_GET["obj_id"]);
134  return $ret;
135  break;
136 
137  case "chap":
138  $ilCtrl->setParameterByClass("ilScorm2004ChapterGUI", "obj_id", $a_node["child"]);
139  $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004ChapterGUI", "showOrganization");
140  $ilCtrl->setParameterByClass("ilScorm2004ChapterGUI", "obj_id", $_GET["obj_id"]);
141  return $ret;
142  break;
143 
144  case "sco":
145  $ilCtrl->setParameterByClass("ilScorm2004ScoGUI", "obj_id", $a_node["child"]);
146  $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004ScoGUI", "showOrganization");
147  $ilCtrl->setParameterByClass("ilScorm2004ScoGUI", "obj_id", $_GET["obj_id"]);
148  return $ret;
149  break;
150 
151  case "ass":
152  $ilCtrl->setParameterByClass("ilScorm2004AssetGUI", "obj_id", $a_node["child"]);
153  $ret = $ilCtrl->getLinkTargetByClass("ilScorm2004AssetGUI", "showOrganization");
154  $ilCtrl->setParameterByClass("ilScorm2004AssetGUI", "obj_id", $_GET["obj_id"]);
155  return $ret;
156  break;
157  }
158  }
159 }
global $DIC
Definition: saml.php:7
$_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.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
getNodeIconAlt($a_node)
Get node icon alt text.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
getNodeId($a_node)
Get id for node.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
getRootNode()
Get root node.
Explorer class that works on tree objects (Services/Tree)
$ret
Definition: parser.php:6