4 require_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
5 require_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
6 require_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Export.php");
7 include_once(
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
8 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
34 $lng->loadLanguageModule(
"content");
35 $lng->loadLanguageModule(
"sahs");
36 $lng->loadLanguageModule(
"search");
38 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
39 #$this->tabs_gui =& new ilTabsGUI();
49 $next_class = $ilCtrl->getNextClass($this);
50 $cmd = $ilCtrl->getCmd();
53 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
56 $form_gui->updateExpanded();
65 switch(
$_GET[
"notes_mode"])
68 $ilTabs->setTabActive(
"sahs_organization");
74 case "ilscorm2004chaptergui":
75 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004ChapterGUI.php");
77 $chap_gui->setParentGUI($this);
78 return $ilCtrl->forwardCommand($chap_gui);
82 case "ilscorm2004seqchaptergui":
83 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004SeqChapterGUI.php");
85 $chap_gui->setParentGUI($this);
86 return $ilCtrl->forwardCommand($chap_gui);
90 case "ilscorm2004scogui":
91 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php");
93 $sco_gui->setParentGUI($this);
94 return $ilCtrl->forwardCommand($sco_gui);
98 case "ilscorm2004pagenodegui":
99 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004PageNodeGUI.php");
101 $page_gui->setParentGUI($this);
102 $html = $ilCtrl->forwardCommand($page_gui);
118 if ($this->object->getEditable())
120 include_once(
"./Services/Frameset/classes/class.ilFramesetGUI.php");
123 $fs_gui->setFramesetTitle($this->lng->txt(
"editor"));
124 $fs_gui->setMainFrameName(
"content");
125 $fs_gui->setSideFrameName(
"tree");
126 $this->ctrl->setParameter($this,
"active_node",
$_GET[
"obj_id"]);
127 $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this,
"showTree"));
128 $this->ctrl->setParameter($this,
"activeNode",
"");
129 if (
$_GET[
"obj_id"] > 0)
131 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
134 if (in_array(
$type, array(
"sco",
"chap",
"seqc",
"page")))
136 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
137 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this,
"jumpToNode"));
141 $fs_gui->setMainFrameSource($this->ctrl->getLinkTarget($this,
"properties"));
148 $this->tpl =
new ilTemplate(
"tpl.sahs_edit_frameset.html",
false,
false,
"Modules/ScormAicc");
149 $this->tpl->setVariable(
"SRC",
150 $this->ctrl->getLinkTarget($this,
"properties"));
151 $this->tpl->show(
"DEFAULT",
false);
156 function jumpToNode($a_anchor_node =
"", $a_highlight_ids =
"")
160 $anchor = ($a_anchor_node !=
"")
161 ?
"node_".$a_anchor_node
164 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
166 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
170 $ilCtrl->setParameterByClass(
"ilscorm2004scogui",
"highlight", $a_highlight_ids);
171 $ilCtrl->redirectByClass(
"ilscorm2004scogui",
"showOrganization", $anchor);
173 $ilCtrl->setParameterByClass(
"ilscorm2004chaptergui",
"highlight", $a_highlight_ids);
174 $ilCtrl->redirectByClass(
"ilscorm2004chaptergui",
"showOrganization", $anchor);
176 $ilCtrl->setParameterByClass(
"ilscorm2004seqchaptergui",
"highlight", $a_highlight_ids);
177 $ilCtrl->redirectByClass(
"ilscorm2004seqchaptergui",
"showOrganization", $anchor);
179 $ilCtrl->redirectByClass(
"ilscorm2004pagenodegui",
"edit");
190 $this->
setSubTabs(
"settings",
"general_settings");
192 $lng->loadLanguageModule(
"style");
194 if ($this->object->editable!=1)
197 $ilToolbar->addButton($this->lng->txt(
"view"),
198 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
202 $ilToolbar->addButton($this->lng->txt(
"cont_sc_new_version"),
203 $this->ctrl->getLinkTarget($this,
"newModuleVersion"));
215 if ($this->object->editable!=1)
218 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scorm2004_properties.html",
"Modules/Scorm2004");
219 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
220 $this->tpl->setVariable(
"TXT_PROPERTIES", $this->lng->txt(
"cont_lm_properties"));
223 $this->tpl->setVariable(
"TXT_VERSION", $this->lng->txt(
"cont_sc_version").
":");
224 $this->tpl->setVariable(
"VAL_VERSION", $this->object->getModuleVersion());
226 $this->tpl->setCurrentBlock(
"editable");
228 $this->tpl->setVariable(
"TXT_ONLINE", $this->lng->txt(
"cont_online"));
229 $this->tpl->setVariable(
"CBOX_ONLINE",
"cobj_online");
230 $this->tpl->setVariable(
"VAL_ONLINE",
"y");
231 if ($this->object->getOnline())
233 $this->tpl->setVariable(
"CHK_ONLINE",
"checked");
237 $this->tpl->setVariable(
"TXT_LESSON_MODE", $this->lng->txt(
"cont_def_lesson_mode"));
238 $lesson_modes = array(
"normal" => $this->lng->txt(
"cont_sc_less_mode_normal"),
239 "browse" => $this->lng->txt(
"cont_sc_less_mode_browse"));
241 "lesson_mode", $lesson_modes,
false,
true);
242 $this->tpl->setVariable(
"SEL_LESSON_MODE", $sel_lesson);
245 $this->tpl->setVariable(
"TXT_CREDIT_MODE", $this->lng->txt(
"cont_credit_mode"));
246 $credit_modes = array(
"credit" => $this->lng->txt(
"cont_credit_on"),
247 "no_credit" => $this->lng->txt(
"cont_credit_off"));
249 "credit_mode", $credit_modes,
false,
true);
250 $this->tpl->setVariable(
"SEL_CREDIT_MODE", $sel_credit);
253 $this->tpl->setVariable(
"TXT_AUTO_REVIEW", $this->lng->txt(
"cont_sc_auto_review"));
254 $this->tpl->setVariable(
"CBOX_AUTO_REVIEW",
"auto_review");
255 $this->tpl->setVariable(
"VAL_AUTO_REVIEW",
"y");
256 if ($this->object->getAutoReview())
258 $this->tpl->setVariable(
"CHK_AUTO_REVIEW",
"checked");
262 $this->tpl->setVariable(
"MAX_ATTEMPTS", $this->lng->txt(
"cont_sc_max_attempt"));
263 $this->tpl->setVariable(
"VAL_MAX_ATTEMPT", $this->object->getMaxAttempt());
266 $this->tpl->setVariable(
"TXT_SESSION", $this->lng->txt(
"cont_sc_usession"));
267 $this->tpl->setVariable(
"CBOX_SESSION",
"cobj_session");
268 $this->tpl->setVariable(
"VAL_SESSION",
"y");
269 if ($this->object->getSession())
271 $this->tpl->setVariable(
"CHK_SESSION",
"checked");
276 $this->tpl->setVariable(
"TXT_NOMENU", $this->lng->txt(
"cont_nomenu"));
277 $this->tpl->setVariable(
"CBOX_NOMENU",
"cobj_nomenu");
278 $this->tpl->setVariable(
"VAL_NOMENU",
"y");
279 if ($this->object->getNoMenu())
281 $this->tpl->setVariable(
"CHK_NOMENU",
"checked");
285 $this->tpl->setVariable(
"TXT_HIDENAVIG", $this->lng->txt(
"cont_hidenavig"));
286 $this->tpl->setVariable(
"CBOX_HIDENAVIG",
"cobj_hidenavig");
287 $this->tpl->setVariable(
"VAL_HIDENAVIG",
"y");
288 if ($this->object->getHideNavig())
290 $this->tpl->setVariable(
"CHK_HIDENAVIG",
"checked");
293 $this->tpl->setCurrentBlock(
"commands");
294 $this->tpl->setVariable(
"BTN_NAME",
"saveProperties");
295 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
296 $this->tpl->parseCurrentBlock();
299 if ($this->object->editable==1)
303 $tpl->setContent($this->form->getHTML());
314 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
319 $this->form->addItem($ne);
325 $this->form->addItem($ni);
327 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
328 $parent_ref_id = $tree->getParentId((
int)
$_GET[
"ref_id"]);
332 if ($rbacsystem->checkAccess(
"create", $parent_ref_id,
"glo"))
334 $this->form->addCommandButton(
"createGlossary", $lng->txt(
"cont_glo_create"));
336 $this->form->addCommandButton(
"assignGlossary", $lng->txt(
"cont_glo_assign"));
340 $this->form->addCommandButton(
"detachGlossary", $lng->txt(
"cont_glo_detach"));
343 $this->form->setTitle($lng->txt(
"cont_lm_properties"));
344 $this->form->setFormAction($ilCtrl->getFormAction($this));
360 $values[
"glossary"] = $this->lng->txt(
"cont_no_glossary");
362 $values[
"q_tries"] = $this->
object->getTries();
364 $this->form->setValuesByArray($values);
374 if ($this->object->editable!=1) {
376 $this->
object->setCreditMode(
$_POST[
"credit_mode"]);
377 $this->
object->setMaxAttempt(
$_POST[
"max_attempt"]);
379 $this->
object->setDefaultLessonMode(
$_POST[
"lesson_mode"]);
390 if ($this->form->checkInput())
392 $this->
object->setTries(
$_POST[
"q_tries"]);
395 $this->
object->update();
397 $this->ctrl->redirect($this,
"properties");
407 $this->
object->setAssignedGlossary(0);
408 $this->
object->update();
409 $ilCtrl->redirect($this,
"properties");
420 $tpl->setContent($this->form->getHTML());
430 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
436 $this->form->addItem($ti);
440 $this->form->addItem($ta);
442 $this->form->addCommandButton(
"saveGlossary", $lng->txt(
"save"));
443 $this->form->addCommandButton(
"properties", $lng->txt(
"cancel"));
445 $this->form->
setTitle($lng->txt(
"cont_glo_create"));
446 $this->form->setFormAction($ilCtrl->getFormAction($this));
456 $parent_ref_id = $tree->getParentId((
int)
$_GET[
"ref_id"]);
457 if (!$rbacsystem->checkAccess(
"create", $parent_ref_id,
"glo"))
460 $ilCtrl->redirect($this,
"properties");
464 if ($this->form->checkInput())
466 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
468 $newObj->setType(
"glo");
469 $newObj->setTitle(
$_POST[
"title"]);
470 $newObj->setDescription(
$_POST[
"description"]);
471 $newObj->setVirtualMode(
"none");
473 $newObj->createReference();
474 $newObj->putInTree($parent_ref_id);
475 $newObj->setPermissions($parent_ref_id);
476 $newObj->notify(
"new",$parent_ref_id,$_GET[
"parent_non_rbac_id"],$parent_ref_id,$newObj->getRefId());
479 $this->
object->setAssignedGlossary($newObj->getId());
480 $this->
object->update();
483 $ilCtrl->redirect($this,
"properties");
486 $this->form->setValuesByPost();
487 $tpl->setContent($this->form->getHtml());
497 include_once(
"./Modules/Scorm2004/classes/class.ilGlossarySelectorGUI.php");
499 $ilCtrl->getLinkTarget($this,
"selectGlossary"),
"ilobjscorm2004learningmodulegui");
502 if (
$_GET[
"expand"] ==
"")
504 $expanded = $tree->readRootId();
508 $expanded =
$_GET[
"expand"];
510 $exp->setExpand($expanded);
512 $exp->setTargetGet(
"glo_id");
515 $exp->setParamsGet($this->ctrl->getParameterArray($this,
"assignGlossary"));
518 $exp->setFiltered(
true);
520 $exp->addFilter(
"root");
521 $exp->addFilter(
"cat");
522 $exp->addFilter(
"grp");
523 $exp->addFilter(
"fold");
524 $exp->addFilter(
"crs");
525 $exp->addFilter(
"glo");
529 $tpl->setContent($exp->getOutput());
540 $this->
object->update();
541 $ilCtrl->redirect($this,
"properties");
551 if ($this->call_by_reference)
570 $tpl->setContent($this->form->getHTML());
580 $lng->loadLanguageModule(
"style");
582 $ilTabs->setTabActive(
"settings");
584 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
587 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
588 $style_id = $this->
object->getStyleSheetId();
590 if ($fixed_style > 0)
594 $this->lng->txt(
"global_fixed").
")");
595 $this->form->addItem($st);
602 $st_styles[0] = $this->lng->txt(
"default");
612 $this->form->addItem($st);
617 $this->form->addCommandButton(
"editStyle",
618 $lng->txt(
"cont_edit_style"));
619 $this->form->addCommandButton(
"deleteStyle",
620 $lng->txt(
"cont_delete_style"));
628 $st_styles,
false,
true);
629 $style_sel =
new ilSelectInputGUI($lng->txt(
"cont_current_style"),
"style_id");
631 $style_sel->setValue($style_id);
632 $this->form->addItem($style_sel);
634 $this->form->addCommandButton(
"saveStyleSettings",
636 $this->form->addCommandButton(
"createStyle",
637 $lng->txt(
"sty_create_ind_style"));
640 $this->form->setTitle($lng->txt(
"cont_style"));
641 $this->form->setFormAction($ilCtrl->getFormAction($this));
651 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
661 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
671 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
681 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
683 || $this->object->getStyleSheetId() == 0))
686 $this->
object->update();
689 $this->ctrl->redirect($this,
"editStyleProperties");
698 include_once
"./Services/Table/classes/class.ilTableGUI.php";
702 if (
$_POST[
"search_string"] !=
"")
705 }
else if (isset(
$_POST[
"search_string"]) &&
$_POST[
"search_string"] ==
"") {
710 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl_scorm_track_items_search.html",
"Modules/ScormAicc");
712 $this->tpl->addBlockfile(
"USR_TABLE",
"usr_table",
"tpl.table.html");
714 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm_track_items.html",
"Modules/ScormAicc");
718 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
724 if (isset(
$_SESSION[
"scorm_search_string"])) {
725 $tbl->setTitle($this->lng->txt(
"cont_tracking_items").
' - Aktive Suche: "'.
$_SESSION[
"scorm_search_string"].
'"');
727 $tbl->setTitle($this->lng->txt(
"cont_tracking_items"));
730 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"name"), $this->lng->txt(
"last_access"), $this->lng->txt(
"attempts"), $this->lng->txt(
"version") ));
733 $header_params = $this->ctrl->getParameterArray($this,
"showTrackingItems");
735 $tbl->setColumnWidth(array(
"1%",
"50%",
"29%",
"10%",
"10%"));
737 $cols = array(
"user_id",
"username",
"last_access",
"attempts",
"version");
738 $tbl->setHeaderVars($cols, $header_params);
741 $_GET[
"sort_order"] =
$_GET[
"sort_order"] ?
$_GET[
"sort_order"] :
"asc";
745 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
746 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
747 $tbl->setLimit(
$_GET[
"limit"]);
748 $tbl->setOffset(
$_GET[
"offset"]);
749 $tbl->setMaxCount($this->maxcount);
751 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
755 $this->tpl->setCurrentBlock(
"tbl_action_btn");
756 $this->tpl->setVariable(
"BTN_NAME",
"deleteTrackingForUser");
757 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
758 $this->tpl->parseCurrentBlock();
761 $this->tpl->setCurrentBlock(
"tbl_action_btn");
762 $this->tpl->setVariable(
"BTN_NAME",
"decreaseAttempts");
763 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"decrease_attempts"));
764 $this->tpl->parseCurrentBlock();
767 $this->tpl->setCurrentBlock(
"tbl_action_btn");
768 $this->tpl->setVariable(
"BTN_NAME",
"exportSelected");
769 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"export"));
770 $this->tpl->parseCurrentBlock();
774 $this->tpl->setVariable(
"EXPORT_ACTION",$this->ctrl->getFormAction($this));
776 $this->tpl->setVariable(
"EXPORT_ALL_VALUE", $this->lng->txt(
'cont_export_all'));
777 $this->tpl->setVariable(
"EXPORT_ALL_NAME",
"exportAll");
778 $this->tpl->setVariable(
"IMPORT_VALUE", $this->lng->txt(
'import'));
779 $this->tpl->setVariable(
"IMPORT_NAME",
"Import");
781 $this->tpl->setVariable(
"SEARCH_TXT_SEARCH",$this->lng->txt(
'search'));
782 $this->tpl->setVariable(
"SEARCH_ACTION",$this->ctrl->getFormAction($this));
783 $this->tpl->setVariable(
"SEARCH_NAME",
'showTrackingItems');
784 if (isset(
$_SESSION[
"scorm_search_string"])) {
785 $this->tpl->setVariable(
"STYLE",
'display:inline;');
787 $this->tpl->setVariable(
"STYLE",
'display:none;');
789 $this->tpl->setVariable(
"SEARCH_VAL",
$_SESSION[
"scorm_search_string"]);
790 $this->tpl->setVariable(
"SEARCH_VALUE",$this->lng->txt(
'search_users'));
791 $this->tpl->parseCurrentBlock();
794 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
796 $items = $this->
object->getTrackedUsers(
$_SESSION[
"scorm_search_string"]);
798 $tbl->setMaxCount(count($items));
800 $items = array_slice($items,
$_GET[
"offset"],
$_GET[
"limit"]);
804 if (count($items) > 0)
806 foreach ($items as $item)
808 if (
ilObject::_exists($item[
"user_id"]) && ilObject::_lookUpType($item[
"user_id"])==
"usr")
811 $this->tpl->setCurrentBlock(
"tbl_content");
812 $this->tpl->setVariable(
"VAL_USERNAME", $item[
"username"]);
813 $this->tpl->setVariable(
"VAL_LAST", $item[
"last_access"]);
814 $this->tpl->setVariable(
"VAL_ATTEMPT", $item[
"attempts"]);
815 $this->tpl->setVariable(
"VAL_VERSION", $item[
'version']);
816 $this->ctrl->setParameter($this,
"user_id", $item[
"user_id"]);
817 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
818 $this->tpl->setVariable(
"LINK_ITEM",
819 $this->ctrl->getLinkTarget($this,
"showTrackingItem"));
820 $this->tpl->setVariable(
"CHECKBOX_ID", $item[
"user_id"]);
822 $this->tpl->setVariable(
"CSS_ROW", $css_row);
823 $this->tpl->parseCurrentBlock();
826 $this->tpl->setCurrentBlock(
"selectall");
827 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
828 $this->tpl->setVariable(
"CSS_ROW", $css_row);
829 $this->tpl->parseCurrentBlock();
834 $this->tpl->setCurrentBlock(
"notfound");
835 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
836 $this->tpl->setVariable(
"NUM_COLS", $num);
837 $this->tpl->parseCurrentBlock();
844 $this->
object->exportSelected(1);
849 if (!isset(
$_POST[
"user"]))
852 $this->ctrl->redirect($this,
"showTrackingItems");
854 $this->
object->exportSelected(0,
$_POST[
"user"]);
864 include_once
"./Services/Table/classes/class.ilTableGUI.php";
867 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
869 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.scorm2004_track_item.html",
"Modules/Scorm2004");
873 $this->tpl->setVariable(
"FORMACTION",
"adm_object.php?ref_id=".$this->ref_id.
"$obj_str&cmd=gateway");
878 include_once(
"./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
883 $tbl->setTitle($user->getLastname().
", ".$user->getFirstname());
885 $tbl->setHeaderNames(array($this->lng->txt(
"title"),
886 $this->lng->txt(
"cont_status"), $this->lng->txt(
"cont_time"),
887 $this->lng->txt(
"cont_score")));
889 $header_params = array(
"ref_id" => $this->ref_id,
"cmd" =>
$_GET[
"cmd"],
890 "cmdClass" => get_class($this),
"obj_id" =>
$_GET[
"obj_id"],
"baseClass"=>
"ilSAHSEditGUI",
'user_id'=>
$_GET[
"user_id"]);
892 $cols = array(
"title",
"status",
"time",
"score");
893 $tbl->setHeaderVars($cols, $header_params);
897 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
898 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
899 $tbl->setLimit(
$_GET[
"limit"]);
900 $tbl->setOffset(
$_GET[
"offset"]);
901 $tbl->setMaxCount($this->maxcount);
907 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
908 #$tbl->disable("footer");
910 $tr_data = $this->
object->getTrackingDataAgg(
$_GET[
"user_id"]);
913 $tbl->setMaxCount(count($tr_data));
914 $tr_data = array_slice($tr_data,
$_GET[
"offset"],
$_GET[
"limit"]);
918 if (count($tr_data) > 0)
920 foreach ($tr_data as
$data)
922 $this->tpl->setCurrentBlock(
"tbl_content");
923 $this->tpl->setVariable(
"VAL_TITLE", $data[
"title"]);
924 $this->ctrl->setParameter($this,
"user_id",
$_GET[
"user_id"]);
925 $this->ctrl->setParameter($this,
"obj_id", $data[
"sco_id"]);
927 $this->tpl->setVariable(
"LINK_SCO",
928 $this->ctrl->getLinkTarget($this,
"showTrackingItemPerUser"));
929 $this->tpl->setVariable(
"VAL_TIME", $data[
"time"]);
930 $this->tpl->setVariable(
"VAL_STATUS", $data[
"status"]);
931 $this->tpl->setVariable(
"VAL_SCORE", $data[
"score"]);
934 $this->tpl->setVariable(
"CSS_ROW", $css_row);
935 $this->tpl->parseCurrentBlock();
941 $this->tpl->setCurrentBlock(
"notfound");
942 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
943 $this->tpl->setVariable(
"NUM_COLS", $num);
944 $this->tpl->parseCurrentBlock();
954 if(!isset(
$_POST[
"user"]))
956 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
962 $this->data[
"cols"] = array(
"type",
"title",
"description");
964 foreach(
$_POST[
"user"] as $id)
968 $this->data[
"data"][
"$id"] = array(
970 "title" => $user->getLastname().
", ".$user->getFirstname(),
971 "desc" => $this->lng->txt(
"cont_tracking_data")
976 $this->data[
"buttons"] = array(
"cancelDeleteTracking" => $this->lng->txt(
"cancel"),
977 "confirmedDeleteTracking" => $this->lng->txt(
"confirm"));
983 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
986 foreach ($this->data[
"cols"] as $key)
988 $this->tpl->setCurrentBlock(
"table_header");
989 $this->tpl->setVariable(
"TEXT",$this->lng->txt($key));
990 $this->tpl->parseCurrentBlock();
997 foreach($this->data[
"data"] as $key => $value)
1000 foreach($value as $key => $cell_data)
1002 $this->tpl->setCurrentBlock(
"table_cell");
1011 $this->tpl->setVariable(
"TEXT_CONTENT",$cell_data);
1013 $this->tpl->parseCurrentBlock();
1016 $this->tpl->setCurrentBlock(
"table_row");
1018 $this->tpl->parseCurrentBlock();
1024 foreach($this->data[
"buttons"] as
$name => $value)
1026 $this->tpl->setCurrentBlock(
"operation_btn");
1027 $this->tpl->setVariable(
"BTN_NAME",
$name);
1028 $this->tpl->setVariable(
"BTN_VALUE",$value);
1029 $this->tpl->parseCurrentBlock();
1034 unset(
$_SESSION[
"scorm_search_string"]);
1035 $this->ctrl->redirect($this,
"showTrackingItems");
1043 session_unregister(
"scorm_user_delete");
1045 $this->ctrl->redirect($this,
"showTrackingItems");
1055 global
$ilDB, $ilUser;
1061 $val_set = $ilDB->queryF(
'
1062 SELECT cp_node_id FROM cp_node
1064 AND cp_node.slm_id = %s',
1065 array(
'text',
'integer'),
1066 array(
'item',$this->object->getId()));
1068 while ($val_rec = $ilDB->fetchAssoc($val_set))
1070 array_push($scos,$val_rec[
'cp_node_id']);
1073 foreach (
$_SESSION[
"scorm_user_delete"] as $user)
1076 foreach ($scos as $sco)
1079 $ret = $ilDB->manipulateF(
'
1080 DELETE FROM cmi_node
1082 AND cp_node_id = %s',
1083 array(
'integer',
'integer'),
1087 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
1092 $this->ctrl->redirect($this,
"showTrackingItems");
1097 global
$ilDB, $ilUser;
1099 if (!isset(
$_POST[
"user"]) || !is_array(
$_POST[
"user"]))
1104 foreach (
$_POST[
"user"] as $user)
1110 $val_set = $ilDB->queryF(
'
1111 SELECT * FROM cmi_custom
1116 array(
'integer',
'integer',
'text',
'integer'),
1117 array($user,0,
'package_attempts',$this->object->getID()));
1119 $val_rec = $ilDB->fetchAssoc($val_set);
1121 $val_rec[
"rvalue"] = str_replace(
"\r\n",
"\n", $val_rec[
"rvalue"]);
1122 if ($val_rec[
"rvalue"] != null && $val_rec[
"rvalue"] != 0)
1124 $new_rec = $val_rec[
"rvalue"]-1;
1126 $res = $ilDB->queryF(
'
1127 SELECT * FROM cmi_custom
1132 array(
'integer',
'text',
'integer',
'integer'),
1133 array($user,
'package_attempts',$this->object->getID(),0));
1136 if($ilDB->numRows(
$res) > 0)
1138 $val_set = $ilDB->manipulateF(
'
1146 array(
'text',
'timestamp',
'integer',
'integer',
'integer',
'text'),
1147 array($new_rec, date(
"Y-m-d H:i:s") ,$user,0,$this->object->getID(),
'package_attempts'));
1151 $val_set = $ilDB->manipulateF(
'
1152 INSERT INTO cmi_custom
1153 (rvalue,user_id,sco_id,obj_id,lvalue,c_timestamp)
1154 VALUES(%s,%s,%s,%s,%s,%s)',
1155 array(
'text',
'integer',
'integer',
'integer',
'text',
'timestamp'),
1156 array($new_rec,$user,0,$this->object->getID(),
'package_attempts',date(
"Y-m-d H:i:s")));
1162 $this->ctrl->redirect($this,
"showTrackingItems");
1167 if (is_array(
$_POST[
"id"]))
1169 $this->
object->deleteTrackingDataOfUsers(
$_POST[
"id"]);
1181 $mtree =
new ilTree($this->object->getId());
1182 $mtree->
setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1183 $mtree->setTreeTablePK(
"slm_id");
1185 if (
$_POST[
"expandAll"] !=
"")
1187 $_GET[
"scexpand"] =
"";
1188 $stree = $mtree->getSubTree($mtree->getNodeData($mtree->readRootId()));
1190 foreach ($stree as $n)
1192 $n_arr[] = $n[
"child"];
1197 if (
$_POST[
"collapseAll"] !=
"")
1199 $_GET[
"scexpand"] =
"";
1200 $_SESSION[
"scexpand"] = array($mtree->readRootId());
1203 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
1206 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"active_node"]);
1208 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
1211 $this->tpl->setCurrentBlock(
"exp2_button");
1212 $this->tpl->setVariable(
"CMD_EXP2_BTN",
"expandAll");
1213 $this->tpl->setVariable(
"TXT_EXP2_BTN", $lng->txt(
"expand_all"));
1214 $this->tpl->parseCurrentBlock();
1216 $this->tpl->setCurrentBlock(
"exp2_button");
1217 $this->tpl->setVariable(
"CMD_EXP2_BTN",
"collapseAll");
1218 $this->tpl->setVariable(
"TXT_EXP2_BTN", $lng->txt(
"collapse_all"));
1219 $this->tpl->parseCurrentBlock();
1221 require_once (
"./Modules/Scorm2004/classes/class.ilSCORM2004EditorExplorer.php");
1222 $exp =
new ilSCORM2004EditorExplorer($this->ctrl->getLinkTarget($this,
"edit"),
1224 $exp->setFrameUpdater(
"content",
"ilHierarchyFormUpdater");
1225 $exp->setTargetGet(
"obj_id");
1226 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"showTree"));
1228 if (
$_GET[
"scexpand"] ==
"")
1230 $expanded = $mtree->readRootId();
1234 $expanded =
$_GET[
"scexpand"];
1238 if (
$_GET[
"active_node"] !=
"")
1240 $path = $mtree->getPathId(
$_GET[
"active_node"]);
1241 $exp->setForceOpenPath(
$path);
1243 $exp->highlightNode(
$_GET[
"active_node"]);
1245 $exp->setExpand($expanded);
1249 $output = $exp->getOutput();
1252 if ($ilCtrl->isAsynch())
1257 $this->tpl->setCurrentBlock(
"content");
1258 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"sahs_organization"));
1259 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
1260 $this->tpl->setVariable(
"EXPLORER",$output);
1261 $this->ctrl->setParameter($this,
"scexpand",
$_GET[
"scexpand"]);
1262 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this,
"showTree"));
1263 $this->tpl->parseCurrentBlock();
1264 $this->tpl->show(
false);
1277 $nav_settings = $this->
object->getSequencingSettings();
1278 $tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.scormeditor_course_sequencing.html",
"Modules/Scorm2004");
1279 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1280 $tpl->setVariable(
"TXT_TITLE",
"Sequencing Navigation Options for Module");
1282 $tpl->setVariable(
"BTN_NAME",
"saveSequencing");
1283 $tpl->setVariable(
"TXT_SAVE", $lng->txt(
'save'));
1285 $tpl->setVariable(
"VAL_CHOICE",
ilUtil::tf2yn($nav_settings->getChoice()));
1286 $tpl->setVariable(
"VAL_FLOW",
ilUtil::tf2yn($nav_settings->getFlow()));
1287 $tpl->setVariable(
"VAL_FORWARDONLY",
ilUtil::tf2yn($nav_settings->getForwardOnly()));
1289 $tpl->setVariable(
"VAL_CHOICE",
"y");
1290 $tpl->setVariable(
"VAL_FLOW",
"y");
1291 $tpl->setVariable(
"VAL_FORWARDONLY",
"y");
1293 if ($nav_settings->getChoice())
1295 $tpl->setVariable(
"CHK_CHOICE",
"checked");
1297 if ($nav_settings->getFlow())
1299 $tpl->setVariable(
"CHK_FLOW",
"checked");
1301 if ($nav_settings->getForwardOnly())
1303 $tpl->setVariable(
"CHK_FORWARDONLY",
"checked");
1305 $tpl->parseCurrentBlock();
1307 $ilTabs->setTabActive(
"sahs_sequencing");
1315 $this->
object->updateSequencingSettings();
1326 $oa_tpl =
new ilTemplate(
"tpl.objectives_alignment.html",
true,
true,
"Modules/Scorm2004");
1328 $chaps = $this->
object->getTree()->getChilds(
1329 $this->object->getTree()->getRootId());
1331 foreach($chaps as $chap)
1333 $s_chaps[$chap[
"child"]] = $chap[
"title"];
1336 if (count($s_chaps) > 0)
1342 $oa_tpl->setCurrentBlock(
"chapter_selection");
1343 $oa_tpl->setVariable(
"CHAPTER_SELECTION",
1345 $oa_tpl->setVariable(
"TXT_SELECT_CHAPTER",
1346 $lng->txt(
"chapter"));
1347 $oa_tpl->setVariable(
"TXT_CHANGE", $lng->txt(
"change"));
1348 $oa_tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this));
1349 $oa_tpl->setVariable(
"CMD_CHAP_SEL",
"selectLObjChapter");
1350 $oa_tpl->parseCurrentBlock();
1352 include_once(
"./Modules/Scorm2004/classes/class.ilObjectivesAlignmentTableGUI.php");
1355 $oa_tpl->setVariable(
"LOBJ_TABLE", $obj_table->getHTML());
1356 $tpl->setContent($oa_tpl->get());
1369 $ilCtrl->redirect($this,
"showLearningObjectivesAlignment");
1377 switch (
$_POST[
'select_export'])
1379 case "exportScorm12":
1380 case "exportScorm2004_3rd":
1381 case "exportScorm2004_4th":
1385 $this->ctrl->redirect($this,
$_POST[
'select_export']);
1388 $this->ctrl->redirect($this,
'showExportList');
1400 $template =
new ilTemplate(
"tpl.scorm2004_export_buttons.html",
true,
true,
'Modules/Scorm2004');
1403 "exportScorm2004_3rd" => $this->lng->txt(
"scorm_create_export_file_scrom2004"),
1404 "exportScorm2004_4th" => $this->lng->txt(
"scorm_create_export_file_scrom2004_4th"),
1405 "exportScorm12" => $this->lng->txt(
"scorm_create_export_file_scrom12"),
1406 "exportPDF" => $this->lng->txt(
"scorm_create_export_file_pdf"),
1407 "exportISO" => $this->lng->txt(
"scorm_create_export_file_iso"),
1408 "exportHTML" => $this->lng->txt(
"scorm_create_export_file_html")
1410 foreach ($buttons as $value => $text)
1412 $template->setCurrentBlock(
'option');
1413 $template->setVariable(
'OPTION_VALUE', $value);
1415 $template->parseCurrentBlock();
1417 $template->setVariable(
'EXPORT_TITLE', $this->lng->txt(
'export'));
1418 $template->setVariable(
'EXPORT_LABEL', $this->lng->txt(
'type'));
1419 $template->setVariable(
'FORMACTION', $this->ctrl->getFormAction($this,
'selectExport'));
1421 $export_files = $this->
object->getExportFiles();
1423 include_once
"./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
1426 foreach ($export_files as $exp_file)
1428 $filetype = $exp_file[
'type'];
1429 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($filetype))
1430 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
1432 $file_arr = explode(
"__", $exp_file[
"file"]);
1435 $table_gui->setData(
$data);
1436 $this->tpl->setVariable(
'ADM_CONTENT', $template->get() .
"\n" . $table_gui->getHTML());
1448 if ($this->ctrl->getCmd() ==
"delete")
1453 if (!$this->object->getEditable())
1459 $tabs_gui->addTarget(
"sahs_organization",
1460 $this->ctrl->getLinkTarget($this,
"showOrganization"),
"showOrganization",
1464 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
1467 $tabs_gui->addTarget(
"info_short",
1468 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
1469 "ilinfoscreengui",
"", $force_active);
1472 $tabs_gui->addTarget(
"settings",
1473 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
1491 $tabs_gui->addTarget(
"sahs_objectives_alignment",
1492 $this->ctrl->getLinkTarget($this,
"showLearningObjectivesAlignment"),
"showLearningObjectivesAlignment",
1508 $tabs_gui->addTarget(
"meta_data",
1509 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
1510 "",
"ilmdeditorgui");
1513 $tabs_gui->addTarget(
"export",
1514 $this->ctrl->getLinkTarget($this,
"showExportList"), array(
"showExportList",
'confirmDeleteExportFile'),
1518 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()))
1520 $tabs_gui->addTarget(
"perm_settings",
1521 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1524 if ($this->object->editable==1)
1527 $tabs_gui->addNonTabbedLink(
"preview",
1528 $this->lng->txt(
"cont_sc_preview"),
1529 $this->ctrl->getLinkTarget($this,
"preview"),
1542 if ($a_main_tab ==
"settings" &&
1543 $this->object->editable == 1)
1546 $ilTabs->addSubTab(
"general_settings",
1547 $lng->txt(
"general_settings"),
1548 $ilCtrl->getLinkTarget($this,
'properties'));
1551 $ilTabs->addSubTab(
"style",
1552 $lng->txt(
"cont_style"),
1553 $ilCtrl->getLinkTarget($this,
'editStyleProperties'));
1555 $ilTabs->activateSubTab($a_active);
1565 $slm_tree =
new ilTree($this->object->getId());
1567 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1575 $a_title =
"", $a_icon =
"", $a_gui_obj = null, $a_gui_cmd =
"")
1579 if ($a_form_action ==
"")
1581 $a_form_action = $ilCtrl->getFormAction($this);
1586 $a_title = $this->
object->getTitle();
1592 if ($a_top_node == 0)
1594 $a_top_node = $slm_tree->getRootId();
1597 if (is_null($a_gui_obj))
1600 $a_gui_cmd =
"showOrganization";
1603 $ilCtrl->setParameter($this,
"backcmd",
"showOrganization");
1604 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1606 $form_gui->setParentCommand($a_gui_obj, $a_gui_cmd);
1607 $form_gui->setFormAction($a_form_action);
1608 $form_gui->setTitle($a_title);
1609 $form_gui->setIcon($a_icon);
1610 $form_gui->setTree($slm_tree);
1611 $form_gui->setCurrentTopNodeId($a_top_node);
1612 $form_gui->addMultiCommand($lng->txt(
"delete"),
"deleteNodes");
1613 $form_gui->addMultiCommand($lng->txt(
"cut"),
"cutItems");
1614 $form_gui->addMultiCommand($lng->txt(
"copy"),
"copyItems");
1615 $form_gui->addCommand($lng->txt(
"cont_save_all_titles"),
"saveAllTitles");
1616 $form_gui->addCommand($lng->txt(
"expand_all"),
"expandAll");
1617 $form_gui->addCommand($lng->txt(
"collapse_all"),
"collapseAll");
1618 $form_gui->setTriggeredUpdateCommand(
"saveAllTitles");
1621 if (
$_GET[
"highlight"] !=
"")
1623 $hl = explode(
":",
$_GET[
"highlight"]);
1624 $form_gui->setHighlightedNodes($hl);
1625 $form_gui->setFocusId($hl[0]);
1628 $ilCtrl->setParameter($this,
"active_node",
$_GET[
"obj_id"]);
1629 $form_gui->setExplorerUpdater(
"tree",
"tree_div",
1630 $ilCtrl->getLinkTarget($this,
"showTree",
"",
true));
1631 $sc_tpl =
new ilTemplate(
"tpl.scormeditor_orga_screen.html",
true,
true,
"Modules/Scorm2004");
1632 $sc_tpl->setVariable(
"ORGANIZATION", $form_gui->getHTML());
1635 $tpl->setContent($sc_tpl->get());
1646 $ilCtrl->setParameter($this,
"nodes_mode", $a_mode);
1647 include_once(
"Services/Notes/classes/class.ilNoteGUI.php");
1648 $node_id =
$_GET[
"obj_id"];
1649 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1650 $node_type = ($node_id > 0)
1654 $notes_gui =
new ilNoteGUI($this->object->getId(),
1655 (int) $node_id, $node_type);
1660 $notes_gui->enablePrivateNotes();
1661 $notes_gui->enablePublicNotes();
1663 $next_class = $ilCtrl->getNextClass($this);
1664 if ($next_class ==
"ilnotegui")
1666 $html = $this->ctrl->forwardCommand($notes_gui);
1670 $html = $notes_gui->getNotesHTML();
1682 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1684 $slm_tree =&
new ilTree($this->object->getId());
1686 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1693 $parent_id = $slm_tree->getParentId($node_id);
1698 $parent_id = $node_id;
1701 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Chapter.php");
1702 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1704 $chap_ids = array();
1705 for ($i = 1; $i <= $num; $i++)
1708 $chap->setTitle($lng->txt(
"sahs_new_chapter"));
1709 $chap->setSLMId($this->object->getId());
1712 $chap_ids[] = $chap->getId();
1714 $chap_ids = array_reverse($chap_ids);
1715 $chap_ids = implode($chap_ids,
":");
1719 $ilCtrl->setParameter($this,
"highlight", $chap_ids);
1720 $ilCtrl->redirect($this,
"showOrganization",
"node_".$node_id);
1722 return array(
"node_id" => $node_id,
"items" => $chap_ids);
1732 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1734 $slm_tree =&
new ilTree($this->object->getId());
1736 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1741 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Sco.php");
1742 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1746 $parent_id = $slm_tree->getParentId($node_id);
1751 $parent_id = $node_id;
1756 for ($i = 1; $i <= $num; $i++)
1759 $sco->setTitle($lng->txt(
"sahs_new_sco"));
1760 $sco->setSLMId($this->object->getId());
1763 $sco_ids[] = $sco->getId();
1765 $sco_ids = array_reverse($sco_ids);
1766 $sco_ids = implode($sco_ids,
":");
1770 $ilCtrl->setParameter($this,
"highlight", $sco_ids);
1771 $ilCtrl->redirect($this,
"showOrganization",
"node_".$node_id);
1773 return array(
"node_id" => $node_id,
"items" => $sco_ids);
1783 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1785 $slm_tree =&
new ilTree($this->object->getId());
1787 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1792 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
1793 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1796 $parent_id = $slm_tree->getParentId($node_id);
1801 $parent_id = $node_id;
1805 $page_ids = array();
1806 for ($i = 1; $i <= $num; $i++)
1809 $page->setTitle($lng->txt(
"sahs_new_page"));
1810 $page->setSLMId($this->object->getId());
1813 $page_ids[] = $page->getId();
1815 $page_ids = array_reverse($page_ids);
1816 $page_ids = implode($page_ids,
":");
1820 $ilCtrl->setParameter($this,
"highlight", $page_ids);
1821 $ilCtrl->redirect($this,
"showOrganization",
"node_".$node_id);
1823 return array(
"node_id" => $node_id,
"items" => $page_ids);
1835 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1836 include_once(
"./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
1838 $templates = array();
1839 $description = null;
1842 $default_identifier =
$_POST[
"identifier"];
1847 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scormeditor_seq_chooser.html",
"Modules/Scorm2004");
1849 $this->tpl->setCurrentBlock(
"option_item");
1852 foreach ($arr_templates as $templ)
1855 $item_data = $templ->getMetadataProperties();
1856 $item_data[
'identifier'] = $templ->getIdentifier();
1857 array_push($templates,$item_data);
1858 if ($default_identifier == $item_data[
'identifier']) {$sel =
'selected'; $active = $item_data;}
1859 $this->tpl->setVariable(
"VAL_SELECTED",$sel );
1860 $this->tpl->setVariable(
"VAL_IDENTIFIER",$item_data[
'identifier'] );
1861 $this->tpl->setVariable(
"VAL_TITLE",$item_data[
'title'] );
1862 $this->tpl->parseCurrentBlock();
1866 if ($active == null )
1869 $description = $templates[0][
'description'];
1870 $image = $templates[0][
'thumbnail'];
1872 $description = $active[
'description'];
1873 $image = $active[
'thumbnail'];
1876 $this->tpl->setVariable(
"VAL_DESCRIPTION",$description);
1879 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1880 $this->tpl->setVariable(
"BTN_NAME",
"insertScenario");
1881 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
1882 $this->tpl->setVariable(
"TXT_INSERT", $this->lng->txt(
"insert"));
1883 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"change"));
1885 $this->tpl->setVariable(
"TXT_TITLE",
"Choose Sequencing Template");
1887 $node_id =
$_POST[
"node_id"];
1888 $first_child =
$_POST[
"first_child"];
1893 $this->tpl->setVariable(
"VAL_NODE_ID", $node_id);
1894 $this->tpl->setVariable(
"VAL_FIRST_CHILD", $first_child);
1906 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1908 $slm_tree =&
new ilTree($this->object->getId());
1910 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
1912 $node_id =
$_POST[
"node_id"];
1914 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
1915 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
1916 include_once(
"./Modules/Scorm2004/classes/seq_editor/class.ilSCORM2004SeqTemplate.php");
1918 if (!
$_POST[
"first_child"])
1920 $parent_id = $slm_tree->getParentId($node_id);
1925 $parent_id = $node_id;
1930 $id = $template->insertTemplateForObjectAtParent($this->
object,$parent_id,$target);
1931 $ilCtrl->setParameter($this,
"highlight", $id);
1932 $ilCtrl->redirect($this,
"showOrganization",
"node_".$node_id);
1942 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
1946 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.scormeditor_page_layout_chooser.html",
"Modules/Scorm2004");
1948 $this->tpl->setCurrentBlock(
"option_item");
1951 foreach ($arr_templates as $templ)
1955 $templ->readObject();
1956 $this->tpl->setVariable(
"VAL_LAYOUT_TITLE",$templ->getTitle());
1957 $this->tpl->setVariable(
"VAL_LAYOUT_IMAGE",$templ->getPreview());
1958 $this->tpl->setVariable(
"VAL_LAYOUT_ID",$templ->getId());
1959 $this->tpl->setVariable(
"VAL_DISPLAY",
"inline");
1961 $this->tpl->setVariable(
"VAL_CHECKED",
"checked");
1963 if ($count%4 == 0) {
1964 $this->tpl->setVariable(
"END_ROW",
"</tr>");
1966 if ($count == 1 || ($count-1)%4 == 0) {
1967 $this->tpl->setVariable(
"BEGIN_ROW",
"<tr>");
1969 $this->tpl->parseCurrentBlock();
1974 $rest = 4-($count%4);
1979 for ($i=1;$i<=
$rest;$i++) {
1980 $this->tpl->setVariable(
"VAL_DISPLAY",
"none");
1981 $this->tpl->setVariable(
"VAL_LAYOUT_ID",$templ->getId());
1984 $this->tpl->setVariable(
"END_ROW",
"</tr>");
1986 $this->tpl->parseCurrentBlock();
1996 $ilCtrl->saveParameter($this,
"obj_id");
1998 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1999 $this->tpl->setVariable(
"BTN_NAME",
"insertTemplate");
2000 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2001 $this->tpl->setVariable(
"TXT_INSERT", $this->lng->txt(
"insert"));
2002 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"change"));
2003 $this->tpl->setVariable(
"TXT_TITLE",
"Choose Page Layout");
2016 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004OrganizationHFormGUI.php");
2018 $slm_tree =&
new ilTree($this->object->getId());
2020 $slm_tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
2023 $node_id =
$_POST[
"node_id"];
2024 $layout_id =
$_POST[
"layout_id"];
2027 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
2028 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2030 if (!
$_POST[
"first_child"])
2032 $parent_id = $slm_tree->getParentId($node_id);
2037 $parent_id = $node_id;
2041 $page_ids = array();
2042 for ($i = 1; $i <= $num; $i++)
2045 $page->setTitle($lng->txt(
"sahs_new_page"));
2046 $page->setSLMId($this->object->getId());
2047 $page->create(
false,$layout_id);
2049 $page_ids[] = $page->getId();
2051 $page_ids = array_reverse($page_ids);
2052 $page_ids = implode($page_ids,
":");
2056 if (
$_GET[
"obj_id"] !=
"")
2062 $ilCtrl->setParameter($this,
"highlight", $page_ids);
2063 $ilCtrl->redirect($this,
"showOrganization",
"node_".$node_id);
2073 $_GET[
"scexpand"] =
"";
2074 $mtree = $this->
object->getTree();
2075 $n_id = (
$_GET[
"obj_id"] > 0)
2077 : $mtree->readRootId();
2078 $stree = $mtree->getSubTree($mtree->getNodeData($n_id));
2080 foreach ($stree as $n)
2082 $n_arr[] = $n[
"child"];
2093 $_GET[
"scexpand"] =
"";
2094 $mtree = $this->
object->getTree();
2095 $n_id = (
$_GET[
"obj_id"] > 0)
2097 : $mtree->readRootId();
2098 $stree = $mtree->getSubTree($mtree->getNodeData($n_id));
2100 foreach ($stree as $n)
2102 if (in_array($n[
"child"], $old) && $n[
"child"] != $n_id)
2104 $k = array_search($n[
"child"], $old);
2119 if (is_array(
$_POST[
"title"]))
2121 include_once(
"./Services/MetaData/classes/class.ilMD.php");
2122 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
2126 if (is_object($node_obj))
2129 $md =
new ilMD($this->object->getId(), $id, $node_obj->getType());
2140 $ilCtrl->redirect($this,
"showOrganization");
2155 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2161 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2164 if ($a_form_action ==
"")
2167 ?
"showOrganization"
2169 $this->ctrl->setParameter($this,
"backcmd",
$cmd);
2170 $a_form_action = $this->ctrl->getFormAction($this);
2172 $confirmation_gui->setFormAction($a_form_action);
2173 $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
2176 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
2177 foreach(
$_POST[
"id"] as $id)
2182 $confirmation_gui->addItem(
"id[]", $node_obj->getId(),
2187 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
2188 $confirmation_gui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
2190 $tpl->setContent($confirmation_gui->getHTML());
2198 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
2209 $tree->setTableNames(
'sahs_sc13_tree',
'sahs_sc13_tree_node');
2210 $tree->setTreeTablePK(
"slm_id");
2213 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004NodeFactory.php");
2214 foreach (
$_POST[
"id"] as $id)
2219 $node_data =
$tree->getNodeData($id);
2220 if (is_object($obj))
2222 $obj->setSLMId($this->object->getId());
2231 if(
$tree->isInTree($id))
2233 $tree->deleteTree($node_data);
2246 $ilCtrl->redirect($this,
"showOrganization");
2257 $this->
object->executeDragDrop(
$_POST[
"il_hform_source_id"],
$_POST[
"il_hform_target_id"],
2259 $ilCtrl->redirect($this,
"showOrganization");
2269 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2273 foreach($items as $k => $item)
2280 foreach($todel as $k)
2286 ilUtil::sendInfo($lng->txt(
"sahs_choose_pages_or_chapters_or_scos_only"),
true);
2287 $ilCtrl->redirect($this, $a_return);
2292 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
2296 $ilCtrl->redirect($this, $a_return);
2306 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2310 foreach($items as $k => $item)
2317 foreach($todel as $k)
2324 ilUtil::sendInfo($lng->txt(
"sahs_choose_pages_or_chapters_or_scos_only"),
true);
2325 $ilCtrl->redirect($this, $a_return);
2330 include_once(
"./Modules/LearningModule/classes/class.ilEditClipboard.php");
2335 $ilCtrl->redirect($this, $a_return);
2345 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2348 $ilCtrl->redirect($this,
"showOrganization",
2359 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2362 $ilCtrl->redirect($this,
"showOrganization",
2373 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
2376 $ilCtrl->redirect($this,
"showOrganization",
2384 $export->buildExportFile();
2385 $this->ctrl->redirect($this,
"showExportList");
2391 $export->buildExportFile();
2392 $this->ctrl->redirect($this,
"showExportList");
2398 $export->buildExportFile();
2399 $this->ctrl->redirect($this,
"showExportList");
2405 $export->buildExportFile();
2406 $this->ctrl->redirect($this,
"showExportList");
2412 if(!$export->buildExportFile())
2414 if(!PATH_TO_MKISOFS)
2415 $this->ilias->raiseError($this->lng->txt(
"no_mkisofs_configured"),$this->ilias->error_obj->MESSAGE);
2417 $this->ctrl->redirect($this,
"showExportList");
2423 $export->buildExportFile();
2424 $this->ctrl->redirect($this,
"showExportList");
2429 if(!isset(
$_POST[
"file"]))
2431 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2434 if (count(
$_POST[
"file"]) > 1)
2436 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2438 $export =
new ilSCORM2004Export($this->
object);
2439 $export_dir = $export->getExportDirectoryForType(
$_POST[
'type'][
$_POST[
'file'][0]]);
2448 if(!isset(
$_POST[
"file"]))
2451 $this->ctrl->redirect($this,
"showExportList");
2455 $export_files = $this->
object->getExportFiles();
2457 include_once
"./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
2460 foreach ($export_files as $exp_file)
2462 foreach (
$_POST[
'file'] as $delete_file)
2464 if (strcmp($delete_file, $exp_file[
'file']) == 0)
2466 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
2467 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
2469 $file_arr = explode(
"__", $exp_file[
"file"]);
2474 $table_gui->setData(
$data);
2475 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2483 session_unregister(
"ilExportFiles");
2484 $this->ctrl->redirect($this,
"showExportList");
2493 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2494 $export =
new ilSCORM2004Export($this->
object);
2497 $export_dir = $export->getExportDirectoryForType(
$_POST[
'type'][$idx]);
2498 $exp_file = $export_dir.
"/".
$file;
2499 if (@is_file($exp_file))
2505 $this->ctrl->redirect($this,
"showExportList");
2513 if(!isset(
$_POST[
"file"]))
2515 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2517 if (count(
$_POST[
"file"]) > 1)
2519 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2522 $export =
new ilSCORM2004Export($this->
object);
2526 if ($this->object->getPublicExportFile(
$type) ==
$file)
2528 $this->
object->setPublicExportFile(
$type,
"");
2532 $this->
object->setPublicExportFile(
$type,
$file);
2534 $this->
object->update();
2535 $this->ctrl->redirect($this,
"showExportList");
2546 $zipfile = $export->buildExportFile();
2547 $zipPathinfo = pathinfo($zipfile);
2548 $file_path = $this->
object->getDataDirectory().
"/".($zipPathinfo[
"basename"]);
2549 copy($zipfile,$file_path);
2556 include_once (
"./Modules/Scorm2004/classes/ilSCORM13Package.php");
2558 $rte_pkg->il_import($this->object->getDataDirectory(),$this->
object->getId(),
$ilias,
false,
true);
2565 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID().
"&envEditor=1");