ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004ChapterGUI.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 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeGUI.php");
25 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
26 
40 {
41 
46  function ilSCORM2004ChapterGUI($a_slm_obj, $a_node_id = 0)
47  {
48  global $ilCtrl;
49 
50  $ilCtrl->saveParameter($this, "obj_id");
51 
52  parent::ilSCORM2004NodeGUI($a_slm_obj, $a_node_id);
53  }
54 
58  function getType()
59  {
60  return "chap";
61  }
62 
66  function &executeCommand()
67  {
68  global $ilCtrl, $tpl, $ilTabs;
69 
70  $tpl->getStandardTemplate();
71 
72  $next_class = $ilCtrl->getNextClass($this);
73  $cmd = $ilCtrl->getCmd();
74 
75  switch($next_class)
76  {
77  // notes
78  case "ilnotegui":
79  switch($_GET["notes_mode"])
80  {
81  default:
82  return $this->showOrganization();
83  }
84  break;
85 
86  case 'ilmdeditorgui':
87  $this->setTabs();
88  $this->setLocator();
89  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
90 
91  $md_gui =& new ilMDEditorGUI($this->slm_object->getID(),
92  $this->node_object->getId(), $this->node_object->getType());
93  $md_gui->addObserver($this->node_object,'MDUpdateListener','General');
94  $ilCtrl->forwardCommand($md_gui);
95  break;
96 
97  default:
98  $ret =& $this->$cmd();
99  break;
100  }
101  }
102 
106  function setTabs()
107  {
108  global $ilTabs, $ilCtrl, $tpl, $lng;
109 
110  // subelements
111  $ilTabs->addTarget("sahs_organization",
112  $ilCtrl->getLinkTarget($this,'showOrganization'),
113  "showOrganization", get_class($this));
114 /*
115  // properties
116  $ilTabs->addTarget("sahs_properties",
117  $ilCtrl->getLinkTarget($this,'showProperties'),
118  "showProperties", get_class($this));
119 */
120  // metadata
121  $ilTabs->addTarget("meta_data",
122  $ilCtrl->getLinkTargetByClass("ilmdeditorgui",''),
123  "", "ilmdeditorgui");
124 
125  $tpl->setTitleIcon(ilUtil::getImagePath("icon_chap_b.gif"));
126  $tpl->setTitle(
127  $lng->txt("sahs_chapter").": ".$this->node_object->getTitle());
128  }
129 
133  function showProperties()
134  {
135  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
136  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
137 
138  global $tpl;
139 
140  $this->setTabs();
141  $this->setLocator();
142  $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.scormeditor_chapter_properties.html", "Modules/Scorm2004");
143  $template = ilSCORM2004SeqTemplate::templateForChapter($this->node_object->getId());
144  if ($template) {
145  $item_data = $template->getMetadataProperties();
146  $tpl->setVariable("VAL_DESCRIPTION",$item_data['description']);
147  $tpl->setVariable("VAL_TITLE",$item_data['title'] );
148  $tpl->setVariable("VAL_IMAGE",ilSCORM2004SeqTemplate::SEQ_TEMPLATE_DIR."/images/".$item_data['thumbnail']);
149  } else {
150  $tpl->setContent("No didactical scenario assigned.");
151  }
152  }
153 
157  function proceedDragDrop()
158  {
159  global $ilCtrl;
160 
161  $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
162  $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
163  $ilCtrl->redirect($this, "showOrganization");
164  }
165 }
166 ?>