ILIAS  release_7 Revision v7.30-3-g800a261c036
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
4require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeGUI.php");
5require_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 {
80 $ilCtrl = $this->ctrl;
82 $ilTabs = $this->tabs;
83
84 $tpl->loadStandardTemplate();
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;
123 $ilCtrl = $this->ctrl;
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
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 {
195 $ilCtrl = $this->ctrl;
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}
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
Class ilObjectMetaDataGUI.
Class ilSCORM2004ChapterGUI.
__construct($a_slm_obj, $a_node_id=0)
Constructor @access public.
proceedDragDrop()
Perform drag and drop action.
Class ilSCORM2004NodeGUI.
showOrganization()
Confirm deletion screen (delete page or structure objects)
setLocator()
Set Locator Items.
static templateForChapter($a_chapter_id)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6