ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004EditorExplorer.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 /*
25 * Editor Explorer for SCORM 2004 Editing
26 *
27 * @author Alex Killing <alex.killing@gmx.de>
28 * @version $Id$
29 *
30 * @ingroup ModulesScormAicc
31 */
32 require_once("./classes/class.ilExplorer.php");
34 {
40  var $root_id;
41  var $slm_obj;
42  var $output;
43 
50  function ilScorm2004EditorExplorer($a_target, $a_slm_obj)
51  {
52  parent::ilExplorer($a_target);
53  $this->tree = new ilTree($a_slm_obj->getId());
54  $this->tree->setTableNames('sahs_sc13_tree','sahs_sc13_tree_node');
55  $this->tree->setTreeTablePK("slm_id");
56  $this->root_id = $this->tree->readRootId();
57  $this->slm_obj = $a_slm_obj;
58  $this->order_column = "";
59  $this->setSessionExpandVariable("scexpand");
60  $this->checkPermissions(false);
61  $this->setPostSort(false);
62  $this->textwidth = 200;
63 
64  $this->force_open_path = array();
65  }
66 
70  function setForceOpenPath($a_path)
71  {
72  $this->force_open_path = $a_path;
73  }
74 
82  function formatHeader(&$tpl, $a_obj_id,$a_option)
83  {
84  global $lng, $ilias, $ilCtrl;
85 
86  $tpl->setCurrentBlock("icon");
87  $tpl->setVariable("ICON_IMAGE" , ilUtil::getImagePath("icon_sahs_s.gif"));
88  $tpl->setVariable("TXT_ALT_IMG", $this->slm_obj->getTitle());
89  $tpl->parseCurrentBlock();
90 
91  $tpl->setCurrentBlock("link");
92  $tpl->setVariable("TITLE", ilUtil::shortenText($this->slm_obj->getTitle()."",
93  $this->textwidth, true));
94  $tpl->setVariable("LINK_TARGET",
95  $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui", "showOrganization"));
96  $tpl->setVariable("TARGET", " target=\"".$this->frame_target."\"");
97  $tpl->parseCurrentBlock();
98 
99  $tpl->touchBlock("element");
100  }
101 
109  function formatObject(&$tpl, $a_node_id,$a_option,$a_obj_id = 0)
110  {
111  global $lng;
112 
113  $tpl->setCurrentBlock("icon");
114  $tpl->setVariable("ICON_IMAGE" , $this->getImage("icon_".$a_option["type"]."_s.gif", $a_option["type"], $a_obj_id));
115  $tpl->setVariable("TARGET_ID" , "iconid_".$a_node_id);
116  $this->iconList[] = "iconid_".$a_node_id;
117  $tpl->setVariable("TXT_ALT_IMG", $lng->txt($a_option["desc"]));
118  $tpl->parseCurrentBlock();
119 
120  $this->outputIcons(false);
121  parent::formatObject($tpl, $a_node_id,$a_option,$a_obj_id);
122  }
123 
131  function isClickable($a_type, $a_obj_id = 0)
132  {
133  global $ilUser;
134  return true;
135  }
136 
140  function buildLinkTarget($a_node_id, $a_type)
141  {
142  global $ilCtrl;
143 
144  switch($a_type)
145  {
146  case "chap":
147  $ilCtrl->setParameterByClass("ilScorm2004ChapterGUI", "obj_id", $a_node_id);
148  return $ilCtrl->getLinkTargetByClass("ilScorm2004ChapterGUI", "showOrganization");
149  break;
150 
151  case "seqc":
152  $ilCtrl->setParameterByClass("ilScorm2004SeqChapterGUI", "obj_id", $a_node_id);
153  return $ilCtrl->getLinkTargetByClass("ilScorm2004SeqChapterGUI", "showOrganization");
154  break;
155 
156  case "page":
157  $ilCtrl->setParameterByClass("ilScorm2004PageNodeGUI", "obj_id", $a_node_id);
158  return $ilCtrl->getLinkTargetByClass("ilScorm2004PageNodeGUI", "edit");
159  break;
160 
161  case "sco":
162  $ilCtrl->setParameterByClass("ilScorm2004ScoGUI", "obj_id", $a_node_id);
163  return $ilCtrl->getLinkTargetByClass("ilScorm2004ScoGUI", "showOrganization");
164  break;
165  }
166  }
167 
171  function forceExpanded($a_obj_id)
172  {
173  if (in_array($a_obj_id, $this->force_open_path))
174  {
175  return true;
176  }
177  return false;
178  }
179 
180 } // END class ilScorm2004EditorExplorer
181 ?>