ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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, $ilCtrl, ILIAS\GlobalScreen\Provider\__construct(), and help().

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 $ilCtrl
Definition: ilias.php:18
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilSCORM2004ScoGUI::cancel ( )

Cancel action.

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

892  {
893  $this->ctrl->redirect($this, "showOrganization");
894  }

◆ cancelDeleteExportFile()

ilSCORM2004ScoGUI::cancelDeleteExportFile ( )

cancel deletion of export files

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

References ilSession\clear().

662  {
663  ilSession::clear("ilExportFiles");
664  $this->ctrl->redirect($this, "showExportList");
665  }
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 626 of file class.ilSCORM2004ScoGUI.php.

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

627  {
628  $lng = $this->lng;
629  $tpl = $this->tpl;
630 
631  if (!isset($_POST["file"])) {
632  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
633  $this->ctrl->redirect($this, "showExportList");
634  }
635 
636  ilUtil::sendQuestion($lng->txt("info_delete_sure"));
637  $export_files = $this->node_object->getExportFiles();
638 
639  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
640  $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList', true);
641  $data = array();
642  foreach ($export_files as $exp_file) {
643  foreach ($_POST['file'] as $delete_file) {
644  if (strcmp($delete_file, $exp_file['file']) == 0) {
645  $public_str = "";
646  // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
647  // ? " <b>(".$this->lng->txt("public").")<b>"
648  // : "";
649  $file_arr = explode("__", $exp_file["file"]);
650  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));
651  }
652  }
653  }
654  $table_gui->setData($data);
655  $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
656  }
$data
Definition: storeScorm.php:23
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteExportFile()

ilSCORM2004ScoGUI::deleteExportFile ( )

delete export files

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

References $_POST, and ilSCORM2004NodeGUI\$lng.

672  {
673  $lng = $this->lng;
674  include_once "./Services/Utilities/classes/class.ilUtil.php";
675  $export = new ilSCORM2004Export($this->node_object);
676  foreach ($_POST['file'] as $idx => $file) {
677  $export_dir = $export->getExportDirectoryForType($_POST['type'][$idx]);
678  $exp_file = $export_dir . "/" . $file;
679  if (@is_file($exp_file)) {
680  unlink($exp_file);
681  }
682  }
683  ilUtil::sendSuccess($lng->txt('msg_deleted_export_files'), true);
684  $this->ctrl->redirect($this, "showExportList");
685  }
$_POST["username"]

◆ downloadExportFile()

ilSCORM2004ScoGUI::downloadExportFile ( )

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

References $_GET, and ilUtil\deliverFile().

616  {
617  $file = str_replace("..", "", $_GET['file']);
618  $export = new ilSCORM2004Export($this->node_object);
619  $export_dir = $export->getExportDirectoryForType($_GET['type']);
620  ilUtil::deliverFile($export_dir . "/" . $file, $file);
621  }
$_GET["client_id"]
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 777 of file class.ilSCORM2004ScoGUI.php.

References $_GET, and exit.

778  {
779  $file = explode("_", $_GET["file_id"]);
780  require_once("./Modules/File/classes/class.ilObjFile.php");
781  $fileObj = new ilObjFile($file[count($file) - 1], false);
782  $fileObj->sendFile();
783  exit;
784  }
exit
Definition: login.php:29
$_GET["client_id"]

◆ downloadResource()

ilSCORM2004ScoGUI::downloadResource ( )

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

References $_GET, Vendor\Package\$f, ilUtil\deliverFile(), exit, and getExportResources().

753  {
754  $export_files = $this->getExportResources();
755 
756  if ($_GET["file_id"] > 0) {
757  $file = new ilObjFile($_GET["file_id"], false);
758  }
759 
760  // check that file really belongs to SCORM module (security)
761  foreach ($export_files as $f) {
762  if (is_object($file)) {
763  if ($f["file"] == $file->getFileName()) {
764  $file->sendFile();
765  }
766  } else {
767  if ($f["path"] == $_GET["resource"]) {
768  if (is_file($f["path"])) {
769  ilUtil::deliverFile($f["path"], $f["file"]);
770  }
771  }
772  }
773  }
774  exit;
775  }
exit
Definition: login.php:29
$_GET["client_id"]
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(), ilPageObjectGUI\PREVIEW, ilSCORM2004NodeGUI\setLocator(), setTabs(), and ilSCORM2004NodeGUI\showOrganization().

71  {
72  $tpl = $this->tpl;
74  $ilTabs = $this->tabs;
75 
76  $tpl->loadStandardTemplate();
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(ilPageObjectGUI::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.
$_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 594 of file class.ilSCORM2004ScoGUI.php.

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

◆ exportISO()

ilSCORM2004ScoGUI::exportISO ( )

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

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

◆ exportPDF()

ilSCORM2004ScoGUI::exportPDF ( )

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

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

◆ exportScorm12()

ilSCORM2004ScoGUI::exportScorm12 ( )

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

588  {
589  $export = new ilScorm2004Export($this->node_object, 'SCORM 1.2');
590  $export->buildExportFile();
591  $this->ctrl->redirect($this, "showExportList");
592  }
Export class for SCORM 2004 object.

◆ exportScorm2004_3rd()

ilSCORM2004ScoGUI::exportScorm2004_3rd ( )

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

581  {
582  $export = new ilScorm2004Export($this->node_object, 'SCORM 2004 3rd');
583  $export->buildExportFile();
584  $this->ctrl->redirect($this, "showExportList");
585  }
Export class for SCORM 2004 object.

◆ exportScorm2004_4th()

ilSCORM2004ScoGUI::exportScorm2004_4th ( )

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

573  {
574  $export = new ilScorm2004Export($this->node_object, 'SCORM 2004 4th');
575  $export->buildExportFile();
576  $this->ctrl->redirect($this, "showExportList");
577  }
Export class for SCORM 2004 object.

◆ getEditTree()

ilSCORM2004ScoGUI::getEditTree ( )

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

269  {
270  die("deprecated");
271  $slm_tree = new ilTree($this->node_object->getId(), $this->slm_object->getId());
272  $slm_tree->setTreeTablePK("slm_id");
273  $slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
274  return $slm_tree;
275  }

◆ getExportResources()

ilSCORM2004ScoGUI::getExportResources ( )

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

References $i, ilObject\_exists(), ilObjMediaObject\_lookupStandardItemPath(), and ilPCFileList\collectFileItems().

Referenced by downloadResource(), and sco_resources().

688  {
689  $export_files = array();
690 
691  require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
692  include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
693  include_once "./Modules/File/classes/class.ilObjFile.php";
694  $tree = new ilTree($this->slm_object->getId());
695  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
696  $tree->setTreeTablePK("slm_id");
697  $i = 0;
698  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
699  $page_obj = new ilSCORM2004Page($page["obj_id"]);
700  $page_obj->buildDom();
701  $mob_ids = $page_obj->collectMediaObjects(false);
702  foreach ($mob_ids as $mob_id) {
703  if ($mob_id > 0 && ilObject::_exists($mob_id)) {
704  $path = ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false);
705 
706  $media_obj = new ilObjMediaObject($mob_id);
707  $export_files[$i]["date"] = $media_obj->getCreateDate();
708  $export_files[$i]["size"] = @filesize($path); // could be remote, e.g. youtube video
709  $export_files[$i]["file"] = $media_obj->getTitle();
710  $export_files[$i]["type"] = $media_obj->getDescription();
711  $export_files[$i]["path"] = $path;
712  $this->ctrl->setParameter(
713  $this,
714  "resource",
715  rawurlencode(ilObjMediaObject::_lookupStandardItemPath($mob_id, false, false))
716  );
717  $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadResource");
718  $i++;
719  }
720  }
721  include_once("./Services/COPage/classes/class.ilPCFileList.php");
722  $file_ids = ilPCFileList::collectFileItems($page_obj, $page_obj->getDomDoc());
723  foreach ($file_ids as $file_id) {
724  $file_obj = new ilObjFile($file_id, false);
725  $export_files[$i]["date"] = $file_obj->getCreateDate();
726  $export_files[$i]["size"] = $file_obj->getFileSize();
727  $export_files[$i]["file"] = $file_obj->getFileName();
728  $export_files[$i]["type"] = $file_obj->getFileType();
729  $export_files[$i]["file_id"] = $file_id;
730  $this->ctrl->setParameter($this, "file_id", $file_id);
731  $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this, "downloadFile", "");
732  $i++;
733  }
734  unset($page_obj);
735  }
736 
737  return $export_files;
738  }
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.
$i
Definition: metadata.php:24
+ 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 913 of file class.ilSCORM2004ScoGUI.php.

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

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

914  {
915  global $DIC;
916 
917  $lng = $DIC->language();
918 
919  $tpl = new ilTemplate("tpl.sco_glossary_overview.html", true, true, "Modules/Scorm2004");
920 
921  $terms = $a_sco->getGlossaryTermIds();
922  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($a_sco->getSLMId());
923  foreach ($terms as $k => $t) {
924  $tpl->setCurrentBlock("link");
925  $tpl->setVariable("TXT_LINK", $t);
926  $tpl->setVariable("ID_LINK", "glo_ov_t" . $k);
927  $tpl->parseCurrentBlock();
928  }
929 
930  $tpl->setVariable("DIV_ID", ilSCORM2004ScoGUI::getGlossaryOverviewId());
931  $tpl->setVariable("TXT_SCO_GLOSSARY", $lng->txtlng("content", "cont_sco_glossary", $lk));
932  $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $lk));
933 
934  if (count($terms) > 1) {
935  return $tpl->get();
936  } else {
937  return "";
938  }
939  }
static getGlossaryOverviewId()
Get sco glossary overlay id.
$DIC
Definition: xapitoken.php:46
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 902 of file class.ilSCORM2004ScoGUI.php.

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

903  {
904  return "sco_glo_ov";
905  }
+ 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 786 of file class.ilSCORM2004ScoGUI.php.

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

787  {
788  $tpl = $this->tpl;
789  $lng = $this->lng;
790 
791  $this->setTabs();
792  $this->setLocator();
793 
794  $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scormeditor_sco_import.html", "Modules/Scorm2004");
795 
796  $tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_lm.svg'));
797  $tpl->setVariable("ALT_IMG", $lng->txt("obj_sahs"));
798 
799  $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
800 
801  $tpl->setVariable("BTN_NAME", "importSave");
802 
803  // this leads to _top target which removes the left organization frame
804  //$tpl->setVariable("TARGET", ' target="'.ilFrameTargetInfo::_getFrame("MainContent").'" ');
805 
806  $tpl->setVariable("TXT_UPLOAD", $lng->txt("upload"));
807  $tpl->setVariable("TXT_CANCEL", $lng->txt("cancel"));
808  $tpl->setVariable("TXT_IMPORT_SCO", $lng->txt("import_sco_object"));
809  $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("select_file"));
810  $tpl->setVariable("TXT_VALIDATE_FILE", $lng->txt("cont_validate_file"));
811 
812  // get the value for the maximal uploadable filesize from the php.ini (if available)
813  $umf = get_cfg_var("upload_max_filesize");
814  // get the value for the maximal post data from the php.ini (if available)
815  $pms = get_cfg_var("post_max_size");
816 
817  //convert from short-string representation to "real" bytes
818  $multiplier_a = array("K" => 1024, "M" => 1024 * 1024, "G" => 1024 * 1024 * 1024);
819 
820  $umf_parts = preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
821  $pms_parts = preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
822 
823  if (count($umf_parts) == 2) {
824  $umf = $umf_parts[0] * $multiplier_a[$umf_parts[1]];
825  }
826  if (count($pms_parts) == 2) {
827  $pms = $pms_parts[0] * $multiplier_a[$pms_parts[1]];
828  }
829 
830  // use the smaller one as limit
831  $max_filesize = min($umf, $pms);
832 
833  if (!$max_filesize) {
834  $max_filesize = max($umf, $pms);
835  }
836 
837  //format for display in mega-bytes
838  $max_filesize = sprintf("%.1f MB", $max_filesize / 1024 / 1024);
839 
840  // gives out the limit as a little notice
841  $tpl->setVariable("TXT_FILE_INFO", $lng->txt("file_notice") . " $max_filesize");
842  }
setLocator()
Set Locator Items.
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:

◆ importSave()

ilSCORM2004ScoGUI::importSave ( )

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

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

845  {
846  $lng = $this->lng;
848 
849  // check if file was uploaded
850  $source = $_FILES["scormfile"]["tmp_name"];
851  if (($source == 'none') || (!$source)) {
852  $ilErr->raiseError("No file selected!", $ilErr->MESSAGE);
853  }
854  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
855  switch ($_FILES["scormfile"]["error"]) {
856  case UPLOAD_ERR_INI_SIZE:
857  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
858  break;
859 
860  case UPLOAD_ERR_FORM_SIZE:
861  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
862  break;
863 
864  case UPLOAD_ERR_PARTIAL:
865  $ilErr->raiseError($lng->txt("err_partial_file_upload"), $ilErr->MESSAGE);
866  break;
867 
868  case UPLOAD_ERR_NO_FILE:
869  $ilErr->raiseError($lng->txt("err_no_file_uploaded"), $ilErr->MESSAGE);
870  break;
871  }
872 
873  $file = pathinfo($_FILES["scormfile"]["name"]);
874  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
875  $file_path = $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId() . "/" . $_FILES["scormfile"]["name"];
876  ilUtil::createDirectory($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
877  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
878  ilUtil::unzip($file_path);
879  ilUtil::renameExecutables($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
880 
881  include_once("./Modules/Scorm2004/classes/ilSCORM13Package.php");
882  $newPack = new ilSCORM13Package();
883  $newPack->il_importSco($this->slm_object->getId(), $this->node_object->getId(), $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
884 
885  $this->ctrl->redirect($this, "showOrganization");
886  }
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
$ilErr
Definition: raiseError.php:18
if($format !==null) $name
Definition: metadata.php:230
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static createDirectory($a_dir, $a_mod=0755)
create directory
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
$source
Definition: metadata.php:76
+ Here is the call graph for this function:

◆ insertQuestion()

static ilSCORM2004ScoGUI::insertQuestion (   $matches)
staticprivate

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

501  {
502  $q_exporter = new ilQuestionExporter(false);
503  return $q_exporter->exportQuestion($matches[2]);
504  }
Scorm 2004 Question Exporter.

◆ proceedDragDrop()

ilSCORM2004ScoGUI::proceedDragDrop ( )

Perform drag and drop action.

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

References $_POST, $ctrl, and $ilCtrl.

374  {
376 
377  //echo "-".$_POST["il_hform_source_id"]."-".$_POST["il_hform_target_id"]."-".$_POST["il_hform_fc"]."-";
378  $this->slm_object->executeDragDrop(
379  $_POST["il_hform_source_id"],
380  $_POST["il_hform_target_id"],
381  $_POST["il_hform_fc"],
382  $_POST["il_hform_as_subitem"]
383  );
384  $ilCtrl->redirect($this, "showOrganization");
385  }
$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 $tab, ilPCQuestion\_getQuestionIdsForPage(), ilSCORM2004NodeGUI\setLocator(), and setTabs().

241  {
242  $this->setTabs();
243  $this->setLocator();
244 
245  $tree = new ilTree($this->slm_object->getId());
246  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
247  $tree->setTreeTablePK("slm_id");
248  $questions = [];
249  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
250  // get question ids
251  $qids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
252  if (count($qids) > 0) {
253  // output questions
254  foreach ($qids as $qid) {
255  $questions[] = [
256  "page" => $page,
257  "qid" => $qid
258  ];
259  }
260  }
261  }
262 
263  $tab = new ILIAS\Scorm2004\Editor\ilSCORMQuestionOverviewTableGUI($this, "sahs_questions");
264  $tab->setData($questions);
265  $this->tpl->setContent($tab->getHTML());
266  }
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
setLocator()
Set Locator Items.
+ Here is the call graph for this function:

◆ sco_preview()

ilSCORM2004ScoGUI::sco_preview ( )

SCO preview.

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

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

391  {
392  global $DIC;
393  $tpl = $DIC['tpl'];
394 
396 
397  // init main template
398  $tpl = new ilGlobalTemplate("tpl.legacy_main.html", true, true, "Modules/Scorm2004");
399  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
400  $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
401  $tpl->setBodyClass("");
402  $tpl->setCurrentBlock("ContentStyle");
403  $tpl->setVariable(
404  "LOCATION_CONTENT_STYLESHEET",
405  ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId())
406  );
407  $tpl->parseCurrentBlock();
408 
409  // get javascript
410  include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
413  $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js");
414  $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js");
415  $tpl->addJavaScript("./Services/COPage/js/ilCOPagePres.js");
416  $tpl->addJavascript(iljQueryUtil::getLocalMaphilightPath());
417  $tpl->addCss("./Modules/Test/templates/default/ta.css");
418 
419  $tpl->addOnLoadCode("pager.Init();");
420 
421  $tree = new ilTree($this->slm_object->getId());
422  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
423  $tree->setTreeTablePK("slm_id");
424  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
425  include_once "./Services/MetaData/classes/class.ilMD.php";
426 
427  $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
428  $desc_ids = $meta->getGeneral()->getDescriptionIds();
429  $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
430 
431  // get sco template
432  $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
433 
434  // navigation
435  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
436  ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
437 
438  // meta page (description and objectives)
440  $sco_tpl,
441  $this->node_object,
442  $this->node_object->getType()
443  );
444 
445  // init export (this initialises glossary template)
447  $terms = $this->node_object->getGlossaryTermIds();
448 
449  // render page
450  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
451  $page_obj = new ilSCORM2004PageGUI(
452  $this->node_object->getType(),
453  $page["obj_id"],
454  0,
455  $this->slm_object->getId()
456  );
457  $page_obj->setPresentationTitle($page["title"]);
458  $page_obj->setOutputMode(ilPageObjectGUI::PREVIEW);
459  $page_obj->setStyleId($this->slm_object->getStyleSheetId());
460  if (count($terms) > 1) {
461  $page_obj->setGlossaryOverviewInfo(
463  $this->node_object
464  );
465  }
466  $sco_tpl->setCurrentBlock("page_preview");
467  $html = $ilCtrl->getHTML($page_obj);
468  //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
469  $sco_tpl->setVariable("PAGE_PRV", $html);
470  $sco_tpl->parseCurrentBlock();
471  }
472 
473  $output = $sco_tpl->get();
474 
475  // append glossary entries on the sco level
476  $output .= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
477 
478  //insert questions
479  require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
480  $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output);
481  $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output;
482 
483  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
484 
485  $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
486  $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
487 
488  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
490 
491  //inline JS
492  $output .= '<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
493  $tpl->addOnLoadCode("ilias.questions.refresh_lang();");
494  $tpl->setVariable("CONTENT", $output);
495  $tpl->printToStdout();
496  exit;
497  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
exit
Definition: login.php:29
special template class to simplify handling of ITX/PEAR
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
& getGeneral()
Definition: class.ilMD.php:40
setPresentationTitle($a_title="")
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.
static initjQuery(ilGlobalTemplateInterface $a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
Class ilSCORM2004Page GUI class.
$DIC
Definition: xapitoken.php:46
static getLocalMaphilightPath()
Get local path of maphilight file.
static getGlossaryHTML($a_sco)
Get glossary html (only in export mode)
static getAffectiveLocalization($a_id)
Get affective localization.
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 740 of file class.ilSCORM2004ScoGUI.php.

References $tab, getExportResources(), ilSCORM2004NodeGUI\setLocator(), and setTabs().

741  {
742  $this->setTabs();
743  $this->setLocator();
744  $export_files = $this->getExportResources();
745 
746  $tab = new \ILIAS\Scorm2004\Editor\ilSCORMMediaOverviewTableGUI($this, "sco_resources");
747  $tab->setData($export_files);
748 
749  $this->tpl->setContent($tab->getHTML());
750  }
setLocator()
Set Locator Items.
+ Here is the call graph for this function:

◆ selectExport()

ilSCORM2004ScoGUI::selectExport ( )

Select the export type of the SCORM 2004 module.

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

References $_POST.

510  {
511  switch ($_POST['select_export']) {
512  case "exportScorm12":
513  case "exportScorm2004_3rd":
514  case "exportScorm2004_4th":
515  case "exportPDF":
516  case "exportHTML":
517  $this->ctrl->redirect($this, $_POST['select_export']);
518  break;
519  default:
520  $this->ctrl->redirect($this, 'showExportList');
521  break;
522  }
523  }
$_POST["username"]

◆ setTabs()

ilSCORM2004ScoGUI::setTabs ( )

output tabs

Definition at line 280 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().

281  {
282  $ilTabs = $this->tabs;
284  $tpl = $this->tpl;
285  $lng = $this->lng;
286  $ilHelp = $this->help;
287 
288  $ilHelp->setScreenIdComponent("sahsed");
289 
290  // subelements
291  $ilTabs->addTarget(
292  "sahs_organization",
293  $ilCtrl->getLinkTarget($this, 'showOrganization'),
294  "showOrganization",
295  get_class($this)
296  );
297 
298  // properties (named learning objectives, since here is currently
299  // no other property)
300  $ilTabs->addTarget(
301  "sahs_desc_objectives",
302  $ilCtrl->getLinkTarget($this, 'showProperties'),
303  "showProperties",
304  get_class($this)
305  );
306 
307  // questions
308  $ilTabs->addTarget(
309  "sahs_questions",
310  $ilCtrl->getLinkTarget($this, 'sahs_questions'),
311  "sahs_questions",
312  get_class($this)
313  );
314 
315  // resources
316  $ilTabs->addTarget(
317  "cont_files",
318  $ilCtrl->getLinkTarget($this, 'sco_resources'),
319  "sco_resources",
320  get_class($this)
321  );
322 
323  // metadata
324  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
325  $mdgui = new ilObjectMetaDataGUI(
326  $this->slm_object,
327  $this->node_object->getType(),
328  $this->node_object->getId()
329  );
330  $mdtab = $mdgui->getTab();
331  if ($mdtab) {
332  $ilTabs->addTarget(
333  "meta_data",
334  $mdtab,
335  "",
336  "ilmdeditorgui"
337  );
338  }
339 
340  // export
341  $ilTabs->addTarget(
342  "export",
343  $ilCtrl->getLinkTarget($this, "showExportList"),
344  "showExportList",
345  get_class($this)
346  );
347 
348  // import
349  $ilTabs->addTarget(
350  "import",
351  $ilCtrl->getLinkTarget($this, "import"),
352  "import",
353  get_class($this)
354  );
355 
356  // preview
357  $ilTabs->addNonTabbedLink(
358  "preview",
359  $lng->txt("cont_preview"),
360  $ilCtrl->getLinkTarget($this, 'sco_preview'),
361  "_blank"
362  );
363 
364  $tpl->setTitleIcon(ilUtil::getImagePath("icon_sco.svg"));
365  $tpl->setTitle(
366  $lng->txt("sahs_unit") . ": " . $this->node_object->getTitle()
367  );
368  }
Class ilObjectMetaDataGUI.
$ctrl
Constructor public.
getTab($a_base_class=null)
Get tab link if available.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showExportList()

ilSCORM2004ScoGUI::showExportList ( )

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

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

526  {
527  $tpl = $this->tpl;
529  $lng = $this->lng;
530 
531  $this->setTabs();
532  $this->setLocator();
533 
534 
535  $template = new ilTemplate("tpl.scorm2004_export_buttons.html", true, true, 'Modules/Scorm2004');
536 
537  $buttons = array(
538  "exportScorm2004_3rd" => $lng->txt("scorm_create_export_file_scrom2004"),
539  "exportScorm2004_4th" => $lng->txt("scorm_create_export_file_scrom2004_4th"),
540  "exportScorm12" => $lng->txt("scorm_create_export_file_scrom12"),
541  "exportPDF" => $lng->txt("scorm_create_export_file_pdf"),
542  "exportHTML" => $lng->txt("scorm_create_export_file_html")
543  );
544  foreach ($buttons as $value => $text) {
545  $template->setCurrentBlock('option');
546  $template->setVariable('OPTION_VALUE', $value);
547  $template->setVariable('OPTION_TITLE', ilUtil::prepareFormOutput($text));
548  $template->parseCurrentBlock();
549  }
550  $template->setVariable('EXPORT_TITLE', $lng->txt('export'));
551  $template->setVariable('EXPORT_LABEL', $lng->txt('type'));
552  $template->setVariable('FORMACTION', $ilCtrl->getFormAction($this, 'selectExport'));
553 
554  $export_files = $this->node_object->getExportFiles();
555 
556  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
557  $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList');
558  $data = array();
559  foreach ($export_files as $exp_file) {
560  $filetype = $exp_file['type'];
561  $public_str = "";
562  // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($filetype))
563  // ? " <b>(".$this->lng->txt("public").")<b>"
564  // : "";
565  $file_arr = explode("__", $exp_file["file"]);
566  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));
567  }
568  $table_gui->setData($data);
569  $tpl->setVariable('ADM_CONTENT', $template->get() . "\n" . $table_gui->getHTML());
570  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$data
Definition: storeScorm.php:23
$ctrl
Constructor public.
setLocator()
Set Locator Items.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
global $ilCtrl
Definition: ilias.php:18
+ 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, $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.
& 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, 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.
$_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: