ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 {
24  protected $ctrl;
25 
29  protected $tpl;
30 
34  protected $tabs;
35 
39  protected $lng;
40 
44  protected $help;
45 
46 
51  public function __construct($a_slm_obj, $a_node_id = 0)
52  {
53  global $DIC;
54 
55  $this->ctrl = $DIC->ctrl();
56  $this->tpl = $DIC["tpl"];
57  $this->tabs = $DIC->tabs();
58  $this->lng = $DIC->language();
59  $this->help = $DIC["ilHelp"];
60  $ilCtrl = $DIC->ctrl();
61 
62  $ilCtrl->saveParameter($this, "obj_id");
63 
64  parent::__construct($a_slm_obj, $a_node_id);
65  }
66 
70  public function getType()
71  {
72  return "chap";
73  }
74 
78  public function executeCommand()
79  {
81  $tpl = $this->tpl;
82  $ilTabs = $this->tabs;
83 
84  $tpl->getStandardTemplate();
85 
86  $next_class = $ilCtrl->getNextClass($this);
87  $cmd = $ilCtrl->getCmd();
88 
89  switch ($next_class) {
90  // notes
91  case "ilnotegui":
92  switch ($_GET["notes_mode"]) {
93  default:
94  return $this->showOrganization();
95  }
96  break;
97 
98  case 'ilobjectmetadatagui':
99  $this->setTabs();
100  $this->setLocator();
101  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
102  $md_gui = new ilObjectMetaDataGUI(
103  $this->slm_object,
104  $this->node_object->getType(),
105  $this->node_object->getId()
106  );
107  $md_gui->addMDObserver($this->node_object, 'MDUpdateListener', 'General');
108  $ilCtrl->forwardCommand($md_gui);
109  break;
110 
111  default:
112  $ret = $this->$cmd();
113  break;
114  }
115  }
116 
120  public function setTabs()
121  {
122  $ilTabs = $this->tabs;
124  $tpl = $this->tpl;
125  $lng = $this->lng;
126  $ilHelp = $this->help;
127 
128  $ilHelp->setScreenIdComponent("sahsed");
129 
130  // subelements
131  $ilTabs->addTarget(
132  "sahs_organization",
133  $ilCtrl->getLinkTarget($this, 'showOrganization'),
134  "showOrganization",
135  get_class($this)
136  );
137  /*
138  // properties
139  $ilTabs->addTarget("sahs_properties",
140  $ilCtrl->getLinkTarget($this,'showProperties'),
141  "showProperties", get_class($this));
142  */
143  // metadata
144  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
145  $mdgui = new ilObjectMetaDataGUI(
146  $this->slm_object,
147  $this->node_object->getType(),
148  $this->node_object->getId()
149  );
150  $mdtab = $mdgui->getTab();
151  if ($mdtab) {
152  $ilTabs->addTarget(
153  "meta_data",
154  $mdtab,
155  "",
156  "ilmdeditorgui"
157  );
158  }
159 
160  $tpl->setTitleIcon(ilUtil::getImagePath("icon_chap.svg"));
161  $tpl->setTitle(
162  $lng->txt("sahs_chapter") . ": " . $this->node_object->getTitle()
163  );
164  }
165 
169  public function showProperties()
170  {
171  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004Objective.php");
172  include_once("./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
173 
174  $tpl = $this->tpl;
175 
176  $this->setTabs();
177  $this->setLocator();
178  $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.scormeditor_chapter_properties.html", "Modules/Scorm2004");
179  $template = ilSCORM2004SeqTemplate::templateForChapter($this->node_object->getId());
180  if ($template) {
181  $item_data = $template->getMetadataProperties();
182  $tpl->setVariable("VAL_DESCRIPTION", $item_data['description']);
183  $tpl->setVariable("VAL_TITLE", $item_data['title']);
184  $tpl->setVariable("VAL_IMAGE", ilSCORM2004SeqTemplate::SEQ_TEMPLATE_DIR . "/images/" . $item_data['thumbnail']);
185  } else {
186  $tpl->setContent("No didactical scenario assigned.");
187  }
188  }
189 
193  public function proceedDragDrop()
194  {
196 
197  $this->slm_object->executeDragDrop(
198  $_POST["il_hform_source_id"],
199  $_POST["il_hform_target_id"],
200  $_POST["il_hform_fc"],
201  $_POST["il_hform_as_subitem"]
202  );
203  $ilCtrl->redirect($this, "showOrganization");
204  }
205 }
Class ilObjectMetaDataGUI.
$template
Class ilSCORM2004NodeGUI.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
addMDObserver($a_class, $a_method, $a_section)
setLocator()
Set Locator Items.
proceedDragDrop()
Perform drag and drop action.
getTab($a_base_class=null)
Get tab link if available.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
showOrganization()
put this object into content object tree
$ret
Definition: parser.php:6
Class ilSCORM2004ChapterGUI.
__construct($a_slm_obj, $a_node_id=0)
Constructor public.
$_POST["username"]
static templateForChapter($a_chapter_id)