ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSCORM2004ScoGUI Class Reference

Class ilSCORM2004ScoGUI. More...

+ Inheritance diagram for ilSCORM2004ScoGUI:
+ Collaboration diagram for ilSCORM2004ScoGUI:

Public Member Functions

 __construct ($a_slm_obj, $a_node_id=0)
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 execute command More...
 
 showProperties ()
 Show learning objectives. More...
 
 updateProperties ()
 update Properties More...
 
 sahs_questions ()
 
 getEditTree ()
 
 setTabs ()
 output tabs More...
 
 proceedDragDrop ()
 Perform drag and drop action. More...
 
 sco_preview ()
 SCO preview. More...
 
 selectExport ()
 Select the export type of the SCORM 2004 module. More...
 
 showExportList ()
 
 exportScorm2004_4th ()
 
 exportScorm2004_3rd ()
 
 exportScorm12 ()
 
 exportHTML ()
 
 exportISO ()
 
 exportPDF ()
 
 downloadExportFile ()
 
 confirmDeleteExportFile ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFile ()
 cancel deletion of export files More...
 
 deleteExportFile ()
 delete export files More...
 
 getExportResources ()
 
 sco_resources ()
 
 downloadResource ()
 
 downloadFile ()
 
 import ()
 
 importSave ()
 
 cancel ()
 Cancel action. More...
 
- Public Member Functions inherited from ilSCORM2004NodeGUI
 __construct ($a_slm_obj, $a_node_id=0)
 constructor More...
 
 setParentGUI ($a_parentgui)
 Set Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 getNodeObject ($a_node_id)
 Get node object (chapter/sco/page) More...
 
 putInTree ($a_parent_id, $a_target)
 put this object into content object tree More...
 
 showOrganization ()
 Confirm deletion screen (delete page or structure objects) More...
 
 insertChapter ()
 Insert Chapter. More...
 
 insertSco ()
 Insert Sco. More...
 
 insertAsset ()
 Insert Asset. More...
 
 insertPage ()
 Insert Page. More...
 
 insertTemplateGUI ()
 Insert Page with Layout. More...
 
 insertSpecialPage ()
 Insert special page. More...
 
 collapseAll ()
 Collapse all. More...
 
 ExpandAll ()
 Expand all. More...
 
 saveAllTitles ()
 Save Titles. More...
 
 deleteNodes ()
 Delete nodes in the hierarchy. More...
 
 cancelDelete ()
 cancel delete More...
 
 confirmedDelete ()
 confirmed delete More...
 
 setLocator ()
 Set Locator Items. More...
 
 setContentStyle ()
 Set content style sheet. More...
 
 copyItems ($a_return="showOrganization")
 Copy items to clipboard. More...
 
 cutItems ($a_return="showOrganization")
 Copy items to clipboard, then cut them from the current tree. More...
 
 insertPageClip ()
 Insert pages from clipboard. More...
 
 insertScoClip ()
 Insert scos from clipboard. More...
 
 insertAssetClip ()
 Insert assets from clipboard. More...
 
 insertLMChapterClip ()
 Insert scos from clipboard. More...
 

Static Public Member Functions

static getGlossaryOverviewId ()
 Get sco glossary overlay id. More...
 
static getGloOverviewOv ($a_sco)
 des More...
 

Data Fields

 $ctrl = null
 Constructor public. More...
 
- Data Fields inherited from ilSCORM2004NodeGUI
 $node_object
 
 $slm_object
 

Protected Attributes

 $help
 
 $error
 
- Protected Attributes inherited from ilSCORM2004NodeGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $tabs
 
 $locator
 
 $user
 

Static Private Member Functions

static insertQuestion ($matches)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSCORM2004ScoGUI::__construct (   $a_slm_obj,
  $a_node_id = 0 
)

Definition at line 41 of file class.ilSCORM2004ScoGUI.php.

References $DIC, and $ilCtrl.

42  {
43  global $DIC;
44 
45  $this->ctrl = $DIC->ctrl();
46  $this->tpl = $DIC["tpl"];
47  $this->tabs = $DIC->tabs();
48  $this->lng = $DIC->language();
49  $this->help = $DIC["ilHelp"];
50  $this->error = $DIC["ilErr"];
51  $ilCtrl = $DIC->ctrl();
52 
53  $ilCtrl->saveParameter($this, "obj_id");
54  $this->ctrl = &$ilCtrl;
55 
56  parent::__construct($a_slm_obj, $a_node_id);
57  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ cancel()

ilSCORM2004ScoGUI::cancel ( )

Cancel action.

Definition at line 1007 of file class.ilSCORM2004ScoGUI.php.

1008  {
1009  $this->ctrl->redirect($this, "showOrganization");
1010  }

◆ cancelDeleteExportFile()

ilSCORM2004ScoGUI::cancelDeleteExportFile ( )

cancel deletion of export files

Definition at line 682 of file class.ilSCORM2004ScoGUI.php.

References ilSession\clear().

683  {
684  ilSession::clear("ilExportFiles");
685  $this->ctrl->redirect($this, "showExportList");
686  }
static clear($a_var)
Unset a value.
+ Here is the call graph for this function:

◆ confirmDeleteExportFile()

ilSCORM2004ScoGUI::confirmDeleteExportFile ( )

confirmation screen for export file deletion

Definition at line 648 of file class.ilSCORM2004ScoGUI.php.

References $_POST, $data, ilSCORM2004NodeGUI\$lng, ilSCORM2004NodeGUI\$tpl, array, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\sendInfo(), and ilUtil\sendQuestion().

649  {
650  $lng = $this->lng;
651  $tpl = $this->tpl;
652 
653  if (!isset($_POST["file"])) {
654  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
655  $this->ctrl->redirect($this, "showExportList");
656  }
657 
658  ilUtil::sendQuestion($lng->txt("info_delete_sure"));
659  $export_files = $this->node_object->getExportFiles();
660 
661  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
662  $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList', true);
663  $data = array();
664  foreach ($export_files as $exp_file) {
665  foreach ($_POST['file'] as $delete_file) {
666  if (strcmp($delete_file, $exp_file['file']) == 0) {
667  // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
668  // ? " <b>(".$this->lng->txt("public").")<b>"
669  // : "";
670  $file_arr = explode("__", $exp_file["file"]);
671  array_push($data, array('file' => $exp_file['file'], 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => $exp_file['size'], 'type' => $exp_file['type'] . $public_str));
672  }
673  }
674  }
675  $table_gui->setData($data);
676  $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
677  }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const IL_CAL_UNIX
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteExportFile()

ilSCORM2004ScoGUI::deleteExportFile ( )

delete export files

Definition at line 692 of file class.ilSCORM2004ScoGUI.php.

References $_POST, $file, ilSCORM2004NodeGUI\$lng, and ilUtil\sendSuccess().

693  {
694  $lng = $this->lng;
695  include_once "./Services/Utilities/classes/class.ilUtil.php";
696  $export = new ilSCORM2004Export($this->node_object);
697  foreach ($_POST['file'] as $idx => $file) {
698  $export_dir = $export->getExportDirectoryForType($_POST['type'][$idx]);
699  $exp_file = $export_dir . "/" . $file;
700  if (@is_file($exp_file)) {
701  unlink($exp_file);
702  }
703  }
704  ilUtil::sendSuccess($lng->txt('msg_deleted_export_files'), true);
705  $this->ctrl->redirect($this, "showExportList");
706  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$_POST["username"]
+ Here is the call graph for this function:

◆ downloadExportFile()

ilSCORM2004ScoGUI::downloadExportFile ( )

Definition at line 637 of file class.ilSCORM2004ScoGUI.php.

References $_GET, $file, and ilUtil\deliverFile().

638  {
639  $file = str_replace("..", "", $_GET['file']);
640  $export = new ilSCORM2004Export($this->node_object);
641  $export_dir = $export->getExportDirectoryForType($_GET['type']);
642  ilUtil::deliverFile($export_dir . "/" . $file, $file);
643  }
$_GET["client_id"]
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ downloadFile()

ilSCORM2004ScoGUI::downloadFile ( )

Definition at line 893 of file class.ilSCORM2004ScoGUI.php.

References $_GET, $file, and exit.

894  {
895  $file = explode("_", $_GET["file_id"]);
896  require_once("./Modules/File/classes/class.ilObjFile.php");
897  $fileObj = new ilObjFile($file[count($file) - 1], false);
898  $fileObj->sendFile();
899  exit;
900  }
$_GET["client_id"]
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file

◆ downloadResource()

ilSCORM2004ScoGUI::downloadResource ( )

Definition at line 868 of file class.ilSCORM2004ScoGUI.php.

References $_GET, $file, ilUtil\deliverFile(), exit, and getExportResources().

869  {
870  $export_files = $this->getExportResources();
871 
872  if ($_GET["file_id"] > 0) {
873  $file = new ilObjFile($_GET["file_id"], false);
874  }
875 
876  // check that file really belongs to SCORM module (security)
877  foreach ($export_files as $f) {
878  if (is_object($file)) {
879  if ($f["file"] == $file->getFileName()) {
880  $file->sendFile();
881  }
882  } else {
883  if ($f["path"] == $_GET["resource"]) {
884  if (is_file($f["path"])) {
885  ilUtil::deliverFile($f["path"], $f["file"]);
886  }
887  }
888  }
889  }
890  exit;
891  }
$_GET["client_id"]
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilSCORM2004ScoGUI::executeCommand ( )

execute command

Definition at line 70 of file class.ilSCORM2004ScoGUI.php.

References $_GET, $ctrl, $ilCtrl, $ret, ilSCORM2004NodeGUI\$tabs, ilSCORM2004NodeGUI\$tpl, ilObjectMetaDataGUI\addMDObserver(), IL_PAGE_PREVIEW, ilSCORM2004NodeGUI\setLocator(), setTabs(), and ilSCORM2004NodeGUI\showOrganization().

71  {
72  $tpl = $this->tpl;
74  $ilTabs = $this->tabs;
75 
76  $tpl->getStandardTemplate();
77 
78  $next_class = $ilCtrl->getNextClass($this);
79  $cmd = $ilCtrl->getCmd();
80 
81  switch ($next_class) {
82  // notes
83  case "ilnotegui":
84  switch ($_GET["notes_mode"]) {
85  default:
86  $ilTabs->setTabActive("sahs_organization");
87  return $this->showOrganization();
88  }
89  break;
90 
91  case 'ilobjectmetadatagui':
92  $this->setTabs();
93  $this->setLocator();
94  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
95  $md_gui = new ilObjectMetaDataGUI(
96  $this->slm_object,
97  $this->node_object->getType(),
98  $this->node_object->getId()
99  );
100  $md_gui->addMDObserver($this->node_object, 'MDUpdateListener', 'General');
101  $ilCtrl->forwardCommand($md_gui);
102  break;
103 
104  case 'ilscorm2004pagegui':
105  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
106  $page_obj = new ilSCORM2004PageGUI("sahs", $_GET["pg_id"]);
107  //$page_obj->setPresentationTitle($page["title"]);
108  $page_obj->setOutputMode(IL_PAGE_PREVIEW);
109  $ilCtrl->forwardCommand($page_obj);
110  break;
111 
112  // mainly to fix #21631
113  case "ilassgenfeedbackpagegui":
114  break;
115 
116  default:
117  $cmd = $ilCtrl->getCmd("showOrganization");
118  $ret = $this->$cmd();
119  break;
120  }
121  }
Class ilObjectMetaDataGUI.
const IL_PAGE_PREVIEW
$_GET["client_id"]
$ctrl
Constructor public.
addMDObserver($a_class, $a_method, $a_section)
setLocator()
Set Locator Items.
global $ilCtrl
Definition: ilias.php:18
showOrganization()
Confirm deletion screen (delete page or structure objects)
Class ilSCORM2004Page GUI class.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ exportHTML()

ilSCORM2004ScoGUI::exportHTML ( )

Definition at line 616 of file class.ilSCORM2004ScoGUI.php.

617  {
618  $export = new ilScorm2004Export($this->node_object, 'HTML');
619  $export->buildExportFile();
620  $this->ctrl->redirect($this, "showExportList");
621  }
Export class for SCORM 2004 object.

◆ exportISO()

ilSCORM2004ScoGUI::exportISO ( )

Definition at line 623 of file class.ilSCORM2004ScoGUI.php.

624  {
625  $export = new ilScorm2004Export($this->node_object, 'ISO');
626  $export->buildExportFile();
627  $this->ctrl->redirect($this, "showExportList");
628  }
Export class for SCORM 2004 object.

◆ exportPDF()

ilSCORM2004ScoGUI::exportPDF ( )

Definition at line 630 of file class.ilSCORM2004ScoGUI.php.

631  {
632  $export = new ilScorm2004Export($this->node_object, 'PDF');
633  $export->buildExportFile();
634  $this->ctrl->redirect($this, "showExportList");
635  }
Export class for SCORM 2004 object.

◆ exportScorm12()

ilSCORM2004ScoGUI::exportScorm12 ( )

Definition at line 609 of file class.ilSCORM2004ScoGUI.php.

610  {
611  $export = new ilScorm2004Export($this->node_object, 'SCORM 1.2');
612  $export->buildExportFile();
613  $this->ctrl->redirect($this, "showExportList");
614  }
Export class for SCORM 2004 object.

◆ exportScorm2004_3rd()

ilSCORM2004ScoGUI::exportScorm2004_3rd ( )

Definition at line 602 of file class.ilSCORM2004ScoGUI.php.

603  {
604  $export = new ilScorm2004Export($this->node_object, 'SCORM 2004 3rd');
605  $export->buildExportFile();
606  $this->ctrl->redirect($this, "showExportList");
607  }
Export class for SCORM 2004 object.

◆ exportScorm2004_4th()

ilSCORM2004ScoGUI::exportScorm2004_4th ( )

Definition at line 594 of file class.ilSCORM2004ScoGUI.php.

595  {
596  $export = new ilScorm2004Export($this->node_object, 'SCORM 2004 4th');
597  $export->buildExportFile();
598  $this->ctrl->redirect($this, "showExportList");
599  }
Export class for SCORM 2004 object.

◆ getEditTree()

ilSCORM2004ScoGUI::getEditTree ( )

Definition at line 296 of file class.ilSCORM2004ScoGUI.php.

References ilTree\setTreeTablePK().

297  {
298  die("deprecated");
299  $slm_tree = new ilTree($this->node_object->getId(), $this->slm_object->getId());
300  $slm_tree->setTreeTablePK("slm_id");
301  $slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
302  return $slm_tree;
303  }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setTreeTablePK($a_column_name)
set column containing primary key in tree table public
+ Here is the call graph for this function:

◆ getExportResources()

ilSCORM2004ScoGUI::getExportResources ( )

Definition at line 708 of file class.ilSCORM2004ScoGUI.php.

References $i, $path, ilObject\_exists(), ilObjMediaObject\_lookupStandardItemPath(), array, ilPCFileList\collectFileItems(), and ilTree\setTableNames().

Referenced by downloadResource(), and sco_resources().

709  {
710  $export_files = array();
711 
712  require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
713  include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
714  include_once "./Modules/File/classes/class.ilObjFile.php";
715  $tree = new ilTree($this->slm_object->getId());
716  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
717  $tree->setTreeTablePK("slm_id");
718  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
719  $page_obj = new ilSCORM2004Page($page["obj_id"]);
720  $page_obj->buildDom();
721  $mob_ids = $page_obj->collectMediaObjects(false);
722  foreach ($mob_ids as $mob_id) {
723  if ($mob_id > 0 && ilObject::_exists($mob_id)) {
724  $path = ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false);
725 
726  $media_obj = new ilObjMediaObject($mob_id);
727  $export_files[$i]["date"] = $media_obj->getCreateDate();
728  $export_files[$i]["size"] = @filesize($path); // could be remote, e.g. youtube video
729  $export_files[$i]["file"] = $media_obj->getTitle();
730  $export_files[$i]["type"] = $media_obj->getDescription();
731  $export_files[$i]["path"] = $path;
732  $this->ctrl->setParameter(
733  $this,
734  "resource",
735  rawurlencode(ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false))
736  );
737  $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadResource");
738  $i++;
739  }
740  }
741  include_once("./Services/COPage/classes/class.ilPCFileList.php");
742  $file_ids =ilPCFileList::collectFileItems($page_obj, $page_obj->getDomDoc());
743  foreach ($file_ids as $file_id) {
744  $file_obj = new ilObjFile($file_id, false);
745  $export_files[$i]["date"] = $file_obj->getCreateDate();
746  $export_files[$i]["size"] = $file_obj->getFileSize();
747  $export_files[$i]["file"] = $file_obj->getFileName();
748  $export_files[$i]["type"] = $file_obj->getFileType();
749  $export_files[$i]["file_id"] = $file_id;
750  $this->ctrl->setParameter($this, "file_id", $file_id);
751  $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadFile", "");
752  $i++;
753  }
754  unset($page_obj);
755  }
756 
757  return $export_files;
758  }
static _lookupStandardItemPath( $a_mob_id, $a_url_encode=false, $a_web=true)
Get path for standard item.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
Class ilSCORM2004Page.
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
Class ilObjMediaObject.
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGloOverviewOv()

static ilSCORM2004ScoGUI::getGloOverviewOv (   $a_sco)
static

des

Parameters

Definition at line 1029 of file class.ilSCORM2004ScoGUI.php.

References $DIC, ilSCORM2004NodeGUI\$lng, $t, ilSCORM2004NodeGUI\$tpl, ilObjSAHSLearningModule\getAffectiveLocalization(), and getGlossaryOverviewId().

Referenced by ilSCORM2004PageGUI\getGlossaryHTML(), and ilSCORM2004PageGUI\postOutputProcessing().

1030  {
1031  global $DIC;
1032 
1033  $lng = $DIC->language();
1034 
1035  $tpl = new ilTemplate("tpl.sco_glossary_overview.html", true, true, "Modules/Scorm2004");
1036 
1037  $terms = $a_sco->getGlossaryTermIds();
1038  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($a_sco->getSLMId());
1039  foreach ($terms as $k => $t) {
1040  $tpl->setCurrentBlock("link");
1041  $tpl->setVariable("TXT_LINK", $t);
1042  $tpl->setVariable("ID_LINK", "glo_ov_t" . $k);
1043  $tpl->parseCurrentBlock();
1044  }
1045 
1046  $tpl->setVariable("DIV_ID", ilSCORM2004ScoGUI::getGlossaryOverviewId());
1047  $tpl->setVariable("TXT_SCO_GLOSSARY", $lng->txtlng("content", "cont_sco_glossary", $lk));
1048  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $lk));
1049 
1050  if (count($terms) > 1) {
1051  return $tpl->get();
1052  } else {
1053  return "";
1054  }
1055  }
global $DIC
Definition: saml.php:7
static getGlossaryOverviewId()
Get sco glossary overlay id.
special template class to simplify handling of ITX/PEAR
static getAffectiveLocalization($a_id)
Get affective localization.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlossaryOverviewId()

static ilSCORM2004ScoGUI::getGlossaryOverviewId ( )
static

Get sco glossary overlay id.

Parameters

Definition at line 1018 of file class.ilSCORM2004ScoGUI.php.

Referenced by ilSCORM2004PageNodeGUI\executeCommand(), ilSCORM2004Asset\exportHTMLPageObjects(), getGloOverviewOv(), and sco_preview().

1019  {
1020  return "sco_glo_ov";
1021  }
+ Here is the caller graph for this function:

◆ getType()

ilSCORM2004ScoGUI::getType ( )

Get Node Type.

Definition at line 62 of file class.ilSCORM2004ScoGUI.php.

63  {
64  return "sco";
65  }

◆ import()

ilSCORM2004ScoGUI::import ( )

Definition at line 902 of file class.ilSCORM2004ScoGUI.php.

References ilSCORM2004NodeGUI\$lng, ilSCORM2004NodeGUI\$tpl, array, ilUtil\getImagePath(), ilSCORM2004NodeGUI\setLocator(), and setTabs().

903  {
904  $tpl = $this->tpl;
905  $lng = $this->lng;
906 
907  $this->setTabs();
908  $this->setLocator();
909 
910  $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scormeditor_sco_import.html", "Modules/Scorm2004");
911 
912  $tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_lm.svg'));
913  $tpl->setVariable("ALT_IMG", $lng->txt("obj_sahs"));
914 
915  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
916 
917  $tpl->setVariable("BTN_NAME", "importSave");
918 
919  // this leads to _top target which removes the left organization frame
920  //$tpl->setVariable("TARGET", ' target="'.ilFrameTargetInfo::_getFrame("MainContent").'" ');
921 
922  $tpl->setVariable("TXT_UPLOAD", $lng->txt("upload"));
923  $tpl->setVariable("TXT_CANCEL", $lng->txt("cancel"));
924  $tpl->setVariable("TXT_IMPORT_SCO", $lng->txt("import_sco_object"));
925  $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("select_file"));
926  $tpl->setVariable("TXT_VALIDATE_FILE", $lng->txt("cont_validate_file"));
927 
928  // get the value for the maximal uploadable filesize from the php.ini (if available)
929  $umf=get_cfg_var("upload_max_filesize");
930  // get the value for the maximal post data from the php.ini (if available)
931  $pms=get_cfg_var("post_max_size");
932 
933  //convert from short-string representation to "real" bytes
934  $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
935 
936  $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
937  $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
938 
939  if (count($umf_parts) == 2) {
940  $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]];
941  }
942  if (count($pms_parts) == 2) {
943  $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]];
944  }
945 
946  // use the smaller one as limit
947  $max_filesize=min($umf, $pms);
948 
949  if (!$max_filesize) {
950  $max_filesize=max($umf, $pms);
951  }
952 
953  //format for display in mega-bytes
954  $max_filesize=sprintf("%.1f MB", $max_filesize/1024/1024);
955 
956  // gives out the limit as a little notice
957  $tpl->setVariable("TXT_FILE_INFO", $lng->txt("file_notice") . " $max_filesize");
958  }
setLocator()
Set Locator Items.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ importSave()

ilSCORM2004ScoGUI::importSave ( )

Definition at line 960 of file class.ilSCORM2004ScoGUI.php.

References $error, $file, $ilErr, ilSCORM2004NodeGUI\$lng, $name, $source, ilUtil\createDirectory(), ilUtil\renameExecutables(), and ilUtil\unzip().

961  {
962  $lng = $this->lng;
964 
965  // check if file was uploaded
966  $source = $_FILES["scormfile"]["tmp_name"];
967  if (($source == 'none') || (!$source)) {
968  $ilErr->raiseError("No file selected!", $ilErr->MESSAGE);
969  }
970  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
971  switch ($_FILES["scormfile"]["error"]) {
972  case UPLOAD_ERR_INI_SIZE:
973  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
974  break;
975 
976  case UPLOAD_ERR_FORM_SIZE:
977  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
978  break;
979 
980  case UPLOAD_ERR_PARTIAL:
981  $ilErr->raiseError($lng->txt("err_partial_file_upload"), $ilErr->MESSAGE);
982  break;
983 
984  case UPLOAD_ERR_NO_FILE:
985  $ilErr->raiseError($lng->txt("err_no_file_uploaded"), $ilErr->MESSAGE);
986  break;
987  }
988 
989  $file = pathinfo($_FILES["scormfile"]["name"]);
990  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
991  $file_path = $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId() . "/" . $_FILES["scormfile"]["name"];
992  ilUtil::createDirectory($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
993  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
994  ilUtil::unzip($file_path);
995  ilUtil::renameExecutables($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
996 
997  include_once("./Modules/Scorm2004/classes/ilSCORM13Package.php");
998  $newPack = new ilSCORM13Package();
999  $newPack->il_importSco($this->slm_object->getId(), $this->node_object->getId(), $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
1000 
1001  $this->ctrl->redirect($this, "showOrganization");
1002  }
global $ilErr
Definition: raiseError.php:16
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
if($format !==null) $name
Definition: metadata.php:146
static createDirectory($a_dir, $a_mod=0755)
create directory
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

◆ insertQuestion()

static ilSCORM2004ScoGUI::insertQuestion (   $matches)
staticprivate

Definition at line 523 of file class.ilSCORM2004ScoGUI.php.

524  {
525  $q_exporter = new ilQuestionExporter(false);
526  return $q_exporter->exportQuestion($matches[2]);
527  }
Scorm 2004 Question Exporter.

◆ proceedDragDrop()

ilSCORM2004ScoGUI::proceedDragDrop ( )

Perform drag and drop action.

Definition at line 401 of file class.ilSCORM2004ScoGUI.php.

References $_POST, $ctrl, and $ilCtrl.

402  {
404 
405  //echo "-".$_POST["il_hform_source_id"]."-".$_POST["il_hform_target_id"]."-".$_POST["il_hform_fc"]."-";
406  $this->slm_object->executeDragDrop(
407  $_POST["il_hform_source_id"],
408  $_POST["il_hform_target_id"],
409  $_POST["il_hform_fc"],
410  $_POST["il_hform_as_subitem"]
411  );
412  $ilCtrl->redirect($this, "showOrganization");
413  }
$ctrl
Constructor public.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ sahs_questions()

ilSCORM2004ScoGUI::sahs_questions ( )

Definition at line 240 of file class.ilSCORM2004ScoGUI.php.

References $cols, $ctrl, $i, $ilCtrl, ilSCORM2004NodeGUI\$lng, $tbl, ilSCORM2004NodeGUI\$tpl, ilPCQuestion\_getQuestionIdsForPage(), assQuestion\_getTitle(), array, ilSCORM2004NodeGUI\setLocator(), ilTree\setTableNames(), setTabs(), and ilUtil\switchColor().

241  {
242  $tpl = $this->tpl;
243  $lng = $this->lng;
245 
246  $this->setTabs();
247  $this->setLocator();
248 
249  include_once "./Services/Table/classes/class.ilTableGUI.php";
250  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
251  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
252  include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
253 
254  // load template for table
255  $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
256  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scormeditor_sco_question.html", "Modules/Scorm2004");
257 
258  $tbl = new ilTableGUI();
259  $tbl->setTitle("Questions for " . $this->node_object->getTitle());
260  $tbl->setHeaderNames(array("Question","Page"));
261  $cols = array("question","page");
262  $tbl->setHeaderVars($cols, $header_params);
263  $tbl->setColumnWidth(array("50%", "50%"));
264  $tbl->disable("sort");
265  $tbl->disable("footer");
266 
267  $tree = new ilTree($this->slm_object->getId());
268  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
269  $tree->setTreeTablePK("slm_id");
270 
271  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
272  // get question ids
273  include_once("./Services/COPage/classes/class.ilPCQuestion.php");
274  $qids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
275  if (count($qids) > 0) {
276  // output questions
277  foreach ($qids as $qid) {
278  $tpl->setCurrentBlock("tbl_content");
279  $tpl->setVariable("TXT_PAGE_TITLE", $page["title"]);
280  $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
281  $tpl->setVariable("HREF_EDIT_PAGE", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
282 
283  $qtitle = assQuestion::_getTitle($qid);
284  $tpl->setVariable("TXT_QUESTION", $qtitle);
285  $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
286  //$tpl->setVariable("HREF_EDIT_QUESTION", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
287 
288  $tpl->setVariable("CSS_ROW", ilUtil::switchColor($i++, "tblrow1", "tblrow2"));
289  $tpl->parseCurrentBlock();
290  }
291  }
292  }
293  $tbl->render();
294  }
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
$tbl
Definition: example_048.php:81
$ctrl
Constructor public.
setLocator()
Set Locator Items.
Class ilTableGUI.
global $ilCtrl
Definition: ilias.php:18
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
$i
Definition: disco.tpl.php:19
$cols
Definition: xhr_table.php:11
static _getTitle($a_q_id)
Returns the title of a question.
+ Here is the call graph for this function:

◆ sco_preview()

ilSCORM2004ScoGUI::sco_preview ( )

SCO preview.

Definition at line 418 of file class.ilSCORM2004ScoGUI.php.

References $ctrl, $html, $ilCtrl, $output, ilSCORM2004NodeGUI\$tpl, array, exit, ilObjSAHSLearningModule\getAffectiveLocalization(), ilObjStyleSheet\getContentStylePath(), ilMD\getGeneral(), ilSCORM2004PageGUI\getGlossaryHTML(), getGlossaryOverviewId(), ilUtil\getStyleSheetLocation(), IL_PAGE_PREVIEW, ilSCORM2004PageGUI\initExport(), ilOverlayGUI\initJavascript(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), ilQuestionExporter\questionsJS(), ilSCORM2004Asset\renderMetaPage(), ilSCORM2004Asset\renderNavigation(), ilPageObjectGUI\setPresentationTitle(), and ilTree\setTableNames().

419  {
420  global $tpl;
421 
423 
424  // init main template
425  $tpl = new ilTemplate("tpl.main.html", true, true);
426  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
427  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
428  $tpl->setBodyClass("");
429  $tpl->setCurrentBlock("ContentStyle");
430  $tpl->setVariable(
431  "LOCATION_CONTENT_STYLESHEET",
432  ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId())
433  );
434  $tpl->parseCurrentBlock();
435 
436  // get javascript
437  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
440  $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js");
441  $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js");
442 
443  $tpl->addOnLoadCode("pager.Init();");
444 
445  $tree = new ilTree($this->slm_object->getId());
446  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
447  $tree->setTreeTablePK("slm_id");
448  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
449  include_once "./Services/MetaData/classes/class.ilMD.php";
450 
451  $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
452  $desc_ids = $meta->getGeneral()->getDescriptionIds();
453  $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
454 
455  // get sco template
456  $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
457 
458  // navigation
459  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
460  ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
461 
462  // meta page (description and objectives)
464  $sco_tpl,
465  $this->node_object,
466  $this->node_object->getType()
467  );
468 
469  // init export (this initialises glossary template)
471  $terms = $this->node_object->getGlossaryTermIds();
472 
473  // render page
474  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
475  $page_obj = new ilSCORM2004PageGUI(
476  $this->node_object->getType(),
477  $page["obj_id"],
478  0,
479  $this->slm_object->getId()
480  );
481  $page_obj->setPresentationTitle($page["title"]);
482  $page_obj->setOutputMode(IL_PAGE_PREVIEW);
483  $page_obj->setStyleId($this->slm_object->getStyleSheetId());
484  if (count($terms) > 1) {
485  $page_obj->setGlossaryOverviewInfo(
487  $this->node_object
488  );
489  }
490  $sco_tpl->setCurrentBlock("page_preview");
491  $html = $ilCtrl->getHTML($page_obj);
492  //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
493  $sco_tpl->setVariable("PAGE_PRV", $html);
494  $sco_tpl->parseCurrentBlock();
495  }
496 
497  $output = $sco_tpl->get();
498 
499  // append glossary entries on the sco level
500  $output.= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
501 
502  //insert questions
503  require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
504  $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output);
505  $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output;
506 
507  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
508 
509  $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
510  $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
511 
512  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
514 
515  //inline JS
516  $output .='<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
517  $tpl->setVariable("CONTENT", $output);
518  $tpl->show();
519  exit;
520  }
const IL_PAGE_PREVIEW
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$ctrl
Constructor public.
static renderMetaPage($a_tpl, $a_sco, $a_asset_type="", $mode="")
Render meta page (description/objectives at beginning)
static getGlossaryOverviewId()
Get sco glossary overlay id.
global $ilCtrl
Definition: ilias.php:18
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
special template class to simplify handling of ITX/PEAR
& getGeneral()
Definition: class.ilMD.php:40
setPresentationTitle($a_title="")
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
static initjQueryUI($a_tpl=null)
inits and adds the jQuery-UI JS-File to the global template (see included_components.txt for included components)
static renderNavigation($a_tpl, $a_spacer_img="", $a_lang="")
Render navigation.
Class ilSCORM2004Page GUI class.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
static getGlossaryHTML($a_sco)
Get glossary html (only in export mode)
static getAffectiveLocalization($a_id)
Get affective localization.
$html
Definition: example_001.php:87
static questionsJS(array $a_qids=null)
static initExport()
Init export.
static initJavascript()
Init javascript.
+ Here is the call graph for this function:

◆ sco_resources()

ilSCORM2004ScoGUI::sco_resources ( )

Definition at line 760 of file class.ilSCORM2004ScoGUI.php.

References $_GET, $cols, $ctrl, $i, $ilCtrl, ilSCORM2004NodeGUI\$lng, $tbl, ilSCORM2004NodeGUI\$tpl, array, getExportResources(), ilSCORM2004NodeGUI\setLocator(), setTabs(), and ilUtil\switchColor().

761  {
762  $tpl = $this->tpl;
763  $lng = $this->lng;
765 
766  $this->setTabs();
767  $this->setLocator();
768  $i = 0;
769 
770  $export_files = $this->getExportResources();
771 
772  // create table
773  require_once("./Services/Table/classes/class.ilTableGUI.php");
774  $tbl = new ilTableGUI();
775 
776  // load files templates
777  $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
778 
779  // load template for table content data
780  $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/LearningModule");
781 
782  $num = 0;
783 
784  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
785 
786  $tbl->setTitle($lng->txt("cont_files"));
787 
788  $tbl->setHeaderNames(array($lng->txt("cont_format"),
789  $lng->txt("cont_file"),
790  $lng->txt("size"), $lng->txt("date"),
791  ""));
792 
793  $cols = array("format", "file", "size", "date", "download");
794  $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
795  "cmd" => "sco_resources", "cmdClass" => strtolower(get_class($this)),
796  "cmdNode" => $_GET["cmdNode"], "baseClass" => $_GET["baseClass"]);
797  $tbl->setHeaderVars($cols, $header_params);
798  $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
799  $tbl->disable("sort");
800 
801  $tbl->setOrderColumn($_GET["sort_by"]);
802  $tbl->setOrderDirection($_GET["sort_order"]);
803  $tbl->setLimit($_GET["limit"]);
804  $tbl->setOffset($_GET["offset"]);
805  $tbl->setMaxCount($this->maxcount); // ???
806 
807 
808  $tbl->setMaxCount(count($export_files));
809 
810  // footer
811  $tbl->setFooter("tblfooter", $lng->txt("previous"), $lng->txt("next"));
812  //$tbl->disable("footer");
813 
814  $tbl->setMaxCount(count($export_files));
815  $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
816 
817  $tbl->render();
818  if (count($export_files) > 0) {
819  $i=0;
820  foreach ($export_files as $exp_file) {
821  /* remote files (youtube videos) have no size, so we allow them now
822  if (!$exp_file["size"] > 0)
823  {
824  continue;
825  }
826  */
827 
828  $tpl->setCurrentBlock("tbl_content");
829  $tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
830 
831  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
832  $tpl->setVariable("CSS_ROW", $css_row);
833 
834  $tpl->setVariable("TXT_SIZE", $exp_file["size"]);
835  $tpl->setVariable("TXT_FORMAT", $exp_file["type"]);
836 
837  $tpl->setVariable("TXT_DATE", $exp_file["date"]);
838 
839  if ($exp_file["size"] > 0) {
840  $tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
841  $ilCtrl->setParameter($this, "resource", rawurlencode($exp_file["path"]));
842  $ilCtrl->setParameter($this, "file_id", rawurlencode($exp_file["file_id"]));
843  $tpl->setVariable(
844  "LINK_DOWNLOAD",
845  $ilCtrl->getLinkTarget($this, "downloadResource")
846  );
847  } else {
848  $tpl->setVariable("TXT_DOWNLOAD", $lng->txt("show"));
849  $tpl->setVariable("LINK_TARGET", " target=\"_blank\"");
850  $tpl->setVariable("LINK_DOWNLOAD", $exp_file["path"]);
851  }
852 
853  $tpl->parseCurrentBlock();
854  }
855  } //if is_array
856  /* not found in template?
857  else
858  {
859  $tpl->setCurrentBlock("notfound");
860  $tpl->setVariable("TXT_OBJECT_NOT_FOUND", $lng->txt("obj_not_found"));
861  $tpl->setVariable("NUM_COLS", 4);
862  $tpl->parseCurrentBlock();
863  }
864  */
865  // $tpl->parseCurrentBlock();
866  }
$_GET["client_id"]
$tbl
Definition: example_048.php:81
$ctrl
Constructor public.
setLocator()
Set Locator Items.
Class ilTableGUI.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
$i
Definition: disco.tpl.php:19
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:

◆ selectExport()

ilSCORM2004ScoGUI::selectExport ( )

Select the export type of the SCORM 2004 module.

Definition at line 532 of file class.ilSCORM2004ScoGUI.php.

References $_POST.

533  {
534  switch ($_POST['select_export']) {
535  case "exportScorm12":
536  case "exportScorm2004_3rd":
537  case "exportScorm2004_4th":
538  case "exportPDF":
539  case "exportHTML":
540  $this->ctrl->redirect($this, $_POST['select_export']);
541  break;
542  default:
543  $this->ctrl->redirect($this, 'showExportList');
544  break;
545  }
546  }
$_POST["username"]

◆ setTabs()

ilSCORM2004ScoGUI::setTabs ( )

output tabs

Definition at line 308 of file class.ilSCORM2004ScoGUI.php.

References $ctrl, $help, $ilCtrl, ilSCORM2004NodeGUI\$lng, ilSCORM2004NodeGUI\$tabs, ilSCORM2004NodeGUI\$tpl, ilUtil\getImagePath(), and ilObjectMetaDataGUI\getTab().

Referenced by executeCommand(), import(), sahs_questions(), sco_resources(), showExportList(), and showProperties().

309  {
310  $ilTabs = $this->tabs;
312  $tpl = $this->tpl;
313  $lng = $this->lng;
314  $ilHelp = $this->help;
315 
316  $ilHelp->setScreenIdComponent("sahsed");
317 
318  // subelements
319  $ilTabs->addTarget(
320  "sahs_organization",
321  $ilCtrl->getLinkTarget($this, 'showOrganization'),
322  "showOrganization",
323  get_class($this)
324  );
325 
326  // properties (named learning objectives, since here is currently
327  // no other property)
328  $ilTabs->addTarget(
329  "sahs_desc_objectives",
330  $ilCtrl->getLinkTarget($this, 'showProperties'),
331  "showProperties",
332  get_class($this)
333  );
334 
335  // questions
336  $ilTabs->addTarget(
337  "sahs_questions",
338  $ilCtrl->getLinkTarget($this, 'sahs_questions'),
339  "sahs_questions",
340  get_class($this)
341  );
342 
343  // resources
344  $ilTabs->addTarget(
345  "cont_files",
346  $ilCtrl->getLinkTarget($this, 'sco_resources'),
347  "sco_resources",
348  get_class($this)
349  );
350 
351  // metadata
352  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
353  $mdgui = new ilObjectMetaDataGUI(
354  $this->slm_object,
355  $this->node_object->getType(),
356  $this->node_object->getId()
357  );
358  $mdtab = $mdgui->getTab();
359  if ($mdtab) {
360  $ilTabs->addTarget(
361  "meta_data",
362  $mdtab,
363  "",
364  "ilmdeditorgui"
365  );
366  }
367 
368  // export
369  $ilTabs->addTarget(
370  "export",
371  $ilCtrl->getLinkTarget($this, "showExportList"),
372  "showExportList",
373  get_class($this)
374  );
375 
376  // import
377  $ilTabs->addTarget(
378  "import",
379  $ilCtrl->getLinkTarget($this, "import"),
380  "import",
381  get_class($this)
382  );
383 
384  // preview
385  $ilTabs->addNonTabbedLink(
386  "preview",
387  $lng->txt("cont_preview"),
388  $ilCtrl->getLinkTarget($this, 'sco_preview'),
389  "_blank"
390  );
391 
392  $tpl->setTitleIcon(ilUtil::getImagePath("icon_sco.svg"));
393  $tpl->setTitle(
394  $lng->txt("sahs_unit") . ": " . $this->node_object->getTitle()
395  );
396  }
Class ilObjectMetaDataGUI.
$ctrl
Constructor public.
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showExportList()

ilSCORM2004ScoGUI::showExportList ( )

Definition at line 548 of file class.ilSCORM2004ScoGUI.php.

References $ctrl, $data, $ilCtrl, ilSCORM2004NodeGUI\$lng, $template, $text, ilSCORM2004NodeGUI\$tpl, array, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\prepareFormOutput(), ilSCORM2004NodeGUI\setLocator(), and setTabs().

549  {
550  $tpl = $this->tpl;
552  $lng = $this->lng;
553 
554  $this->setTabs();
555  $this->setLocator();
556 
557 
558  $template = new ilTemplate("tpl.scorm2004_export_buttons.html", true, true, 'Modules/Scorm2004');
559 
560  $buttons = array(
561  "exportScorm2004_3rd" => $lng->txt("scorm_create_export_file_scrom2004"),
562  "exportScorm2004_4th" => $lng->txt("scorm_create_export_file_scrom2004_4th"),
563  "exportScorm12" => $lng->txt("scorm_create_export_file_scrom12"),
564  "exportPDF" => $lng->txt("scorm_create_export_file_pdf"),
565  "exportHTML" => $lng->txt("scorm_create_export_file_html")
566  );
567  foreach ($buttons as $value => $text) {
568  $template->setCurrentBlock('option');
569  $template->setVariable('OPTION_VALUE', $value);
570  $template->setVariable('OPTION_TITLE', ilUtil::prepareFormOutput($text));
571  $template->parseCurrentBlock();
572  }
573  $template->setVariable('EXPORT_TITLE', $lng->txt('export'));
574  $template->setVariable('EXPORT_LABEL', $lng->txt('type'));
575  $template->setVariable('FORMACTION', $ilCtrl->getFormAction($this, 'selectExport'));
576 
577  $export_files = $this->node_object->getExportFiles();
578 
579  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
580  $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList');
581  $data = array();
582  foreach ($export_files as $exp_file) {
583  $filetype = $exp_file['type'];
584  // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($filetype))
585  // ? " <b>(".$this->lng->txt("public").")<b>"
586  // : "";
587  $file_arr = explode("__", $exp_file["file"]);
588  array_push($data, array('file' => $exp_file['file'], 'filetype' => $filetype, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => $exp_file['size'], 'type' => $exp_file['type'] . $public_str));
589  }
590  $table_gui->setData($data);
591  $tpl->setVariable('ADM_CONTENT', $template->get() . "\n" . $table_gui->getHTML());
592  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$template
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$ctrl
Constructor public.
setLocator()
Set Locator Items.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
$text
Definition: errorreport.php:18
Date and time handling
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ showProperties()

ilSCORM2004ScoGUI::showProperties ( )

Show learning objectives.

Definition at line 126 of file class.ilSCORM2004ScoGUI.php.

References $ctrl, $form, $ilCtrl, ilSCORM2004NodeGUI\$lng, ilSCORM2004NodeGUI\$tabs, ilSCORM2004NodeGUI\$tpl, ilMD\getGeneral(), ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setInfo(), ilSCORM2004NodeGUI\setLocator(), ilTextAreaInputGUI\setRows(), and setTabs().

Referenced by updateProperties().

127  {
128  $tpl = $this->tpl;
129  $lng = $this->lng;
130  $ilTabs = $this->tabs;
132 
133  $this->setTabs();
134  $this->setLocator();
135  $ilTabs->setTabActive("sahs_desc_objectives");
136 
137  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
138  $form = new ilPropertyFormGUI();
139 
140  // hide objectives page
141  $cb = new ilCheckboxInputGUI($lng->txt("sahs_hide_objectives_page"), "hide_objectives_page");
142  $cb->setInfo($lng->txt("sahs_hide_objectives_page_info"));
143  $form->addItem($cb);
144  $cb->setChecked($this->node_object->getHideObjectivePage());
145 
146  // description
147  $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
148  $ta->setRows(4);
149  $ta->setCols(55);
150  $ta->setInfo($lng->txt("sahs_list_info"));
151  $form->setTitle($lng->txt("properties"));
152  $form->addItem($ta);
153  include_once "./Services/MetaData/classes/class.ilMD.php";
154  $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
155  $desc_ids = $meta->getGeneral()->getDescriptionIds();
156  $ta->setValue($meta->getGeneral()->getDescription($desc_ids[0])->getDescription());
157 
158  // objectives
159  $sh = new ilFormSectionHeaderGUI();
160  $sh->setTitle($lng->txt("sahs_learning_objectives"));
161  $form->addItem($sh);
162 
163  $objectives = $this->node_object->getObjectives();
164 
165  foreach ($objectives as $ob) {
166  // map info
167  $mappings = $ob->getMappings();
168  $mapinfo = null;
169  foreach ($mappings as $map) {
170  $mapinfo .= $map->getTargetObjectiveID();
171  }
172 
173  if ($mapinfo == null) {
174  $mapinfo = "local";
175  } else {
176  $mapinfo = "global to " . $mapinfo;
177  }
178 
179  // objective
180  $ta = new ilTextAreaInputGUI(
181  $mapinfo,
182  "obj_" . $ob->getId()
183  );
184  $ta->setCols(55);
185  $ta->setRows(4);
186  $ta->setInfo($lng->txt("sahs_list_info"));
187  $form->addItem($ta);
188  $ta->setValue($ob->getObjectiveID());
189  }
190  $form->setFormAction($ilCtrl->getFormAction($this));
191  $form->addCommandButton(
192  "updateProperties",
193  $lng->txt("save")
194  );
195  $tpl->setContent($form->getHTML());
196  }
This class represents a property form user interface.
This class represents a section header in a property form.
$ctrl
Constructor public.
This class represents a checkbox property in a property form.
setLocator()
Set Locator Items.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
if(isset($_POST['submit'])) $form
& getGeneral()
Definition: class.ilMD.php:40
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperties()

ilSCORM2004ScoGUI::updateProperties ( )

update Properties

Definition at line 201 of file class.ilSCORM2004ScoGUI.php.

References $_POST, $key, ilSCORM2004NodeGUI\$lng, ilSCORM2004NodeGUI\$tpl, ilMD\getGeneral(), ilUtil\sendFailure(), ilUtil\sendInfo(), showProperties(), ilUtil\stripSlashes(), and ilMDBase\update().

202  {
203  $tpl = $this->tpl;
204  $lng = $this->lng;
205  $empty = false;
206 
207  foreach ($_POST as $key=>$value) {
208  if (preg_match('/(obj_)(.+)/', $key, $match)) {
209  $objective = new ilScorm2004Objective($this->node_object->getId(), $match[2]);
210  // if (!$value)
211  // {
212  // $empty=true;
213  // } else {
214  $objective->setObjectiveID(ilUtil::stripSlashes($value));
215  $objective->updateObjective();
216  // }
217  }
218  }
219 
220  $this->node_object->setHideObjectivePage(ilUtil::stripSlashes($_POST["hide_objectives_page"]));
221  $this->node_object->update();
222 
223  include_once "./Services/MetaData/classes/class.ilMD.php";
224  $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
225  $gen = $meta->getGeneral();
226  $desc_ids = $gen->getDescriptionIds();
227  $des = $gen->getDescription($desc_ids[0]);
228  $des->setDescription(ilUtil::stripSlashes($_POST["desc"]));
229  $des->update();
230  $gen->update();
231 
232  if (!$empty) {
233  ilUtil::sendInfo($lng->txt("saved_successfully"), true);
234  } else {
235  ilUtil::sendFailure($lng->txt("sahs_empty_objectives_are_not_allowed"), true);
236  }
237  $this->showProperties();
238  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
& getGeneral()
Definition: class.ilMD.php:40
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$key
Definition: croninfo.php:18
$_POST["username"]
showProperties()
Show learning objectives.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSCORM2004ScoGUI::$ctrl = null

◆ $error

ilSCORM2004ScoGUI::$error
protected

Definition at line 31 of file class.ilSCORM2004ScoGUI.php.

Referenced by importSave().

◆ $help

ilSCORM2004ScoGUI::$help
protected

Definition at line 26 of file class.ilSCORM2004ScoGUI.php.

Referenced by setTabs().


The documentation for this class was generated from the following file: