ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004ChapterGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeGUI.php");
5 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
6 
20 {
21 
26  function ilSCORM2004ChapterGUI($a_slm_obj, $a_node_id = 0)
27  {
28  global $ilCtrl;
29 
30  $ilCtrl->saveParameter($this, "obj_id");
31 
32  parent::ilSCORM2004NodeGUI($a_slm_obj, $a_node_id);
33  }
34 
38  function getType()
39  {
40  return "chap";
41  }
42 
46  function &executeCommand()
47  {
48  global $ilCtrl, $tpl, $ilTabs;
49 
50  $tpl->getStandardTemplate();
51 
52  $next_class = $ilCtrl->getNextClass($this);
53  $cmd = $ilCtrl->getCmd();
54 
55  switch($next_class)
56  {
57  // notes
58  case "ilnotegui":
59  switch($_GET["notes_mode"])
60  {
61  default:
62  return $this->showOrganization();
63  }
64  break;
65 
66  case 'ilmdeditorgui':
67  $this->setTabs();
68  $this->setLocator();
69  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
70 
71  $md_gui =& new ilMDEditorGUI($this->slm_object->getID(),
72  $this->node_object->getId(), $this->node_object->getType());
73  $md_gui->addObserver($this->node_object,'MDUpdateListener','General');
74  $ilCtrl->forwardCommand($md_gui);
75  break;
76 
77  default:
78  $ret =& $this->$cmd();
79  break;
80  }
81  }
82 
86  function setTabs()
87  {
88  global $ilTabs, $ilCtrl, $tpl, $lng;
89 
90  // subelements
91  $ilTabs->addTarget("sahs_organization",
92  $ilCtrl->getLinkTarget($this,'showOrganization'),
93  "showOrganization", get_class($this));
94 /*
95  // properties
96  $ilTabs->addTarget("sahs_properties",
97  $ilCtrl->getLinkTarget($this,'showProperties'),
98  "showProperties", get_class($this));
99 */
100  // metadata
101  $ilTabs->addTarget("meta_data",
102  $ilCtrl->getLinkTargetByClass("ilmdeditorgui",''),
103  "", "ilmdeditorgui");
104 
105  $tpl->setTitleIcon(ilUtil::getImagePath("icon_chap_b.png"));
106  $tpl->setTitle(
107  $lng->txt("sahs_chapter").": ".$this->node_object->getTitle());
108  }
109 
113  function showProperties()
114  {
115  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
116  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
117 
118  global $tpl;
119 
120  $this->setTabs();
121  $this->setLocator();
122  $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.scormeditor_chapter_properties.html", "Modules/Scorm2004");
123  $template = ilSCORM2004SeqTemplate::templateForChapter($this->node_object->getId());
124  if ($template) {
125  $item_data = $template->getMetadataProperties();
126  $tpl->setVariable("VAL_DESCRIPTION",$item_data['description']);
127  $tpl->setVariable("VAL_TITLE",$item_data['title'] );
128  $tpl->setVariable("VAL_IMAGE",ilSCORM2004SeqTemplate::SEQ_TEMPLATE_DIR."/images/".$item_data['thumbnail']);
129  } else {
130  $tpl->setContent("No didactical scenario assigned.");
131  }
132  }
133 
137  function proceedDragDrop()
138  {
139  global $ilCtrl;
140 
141  $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
142  $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
143  $ilCtrl->redirect($this, "showOrganization");
144  }
145 }
146 ?>