ILIAS  release_7 Revision v7.30-3-g800a261c036
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, 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  }
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilSCORM2004ScoGUI::cancel ( )

Cancel action.

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

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

◆ cancelDeleteExportFile()

ilSCORM2004ScoGUI::cancelDeleteExportFile ( )

cancel deletion of export files

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

References ilSession\clear().

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

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

626  {
627  $lng = $this->lng;
628  $tpl = $this->tpl;
629 
630  if (!isset($_POST["file"])) {
631  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
632  $this->ctrl->redirect($this, "showExportList");
633  }
634 
635  ilUtil::sendQuestion($lng->txt("info_delete_sure"));
636  $export_files = $this->node_object->getExportFiles();
637 
638  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
639  $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList', true);
640  $data = array();
641  foreach ($export_files as $exp_file) {
642  foreach ($_POST['file'] as $delete_file) {
643  if (strcmp($delete_file, $exp_file['file']) == 0) {
644  $public_str = "";
645  // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
646  // ? " <b>(".$this->lng->txt("public").")<b>"
647  // : "";
648  $file_arr = explode("__", $exp_file["file"]);
649  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));
650  }
651  }
652  }
653  $table_gui->setData($data);
654  $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
655  }
$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 670 of file class.ilSCORM2004ScoGUI.php.

References $_POST, and ilSCORM2004NodeGUI\$lng.

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

◆ downloadExportFile()

ilSCORM2004ScoGUI::downloadExportFile ( )

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

References $_GET, and ilFileDelivery\deliverFileAttached().

615  {
616  $file = basename($_GET['file']);
617  $export = new ilSCORM2004Export($this->node_object);
618  $export_dir = $export->getExportDirectoryForType($_GET['type']);
619  ilFileDelivery::deliverFileAttached($export_dir . "/" . $file, $file);
620  }
$_GET["client_id"]
static deliverFileAttached($path_to_file, $download_file_name='', $mime_type='', $delete_file=false)
void
+ Here is the call graph for this function:

◆ downloadFile()

ilSCORM2004ScoGUI::downloadFile ( )

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

References $_GET, and exit.

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

◆ downloadResource()

ilSCORM2004ScoGUI::downloadResource ( )

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

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

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

71  {
72  $tpl = $this->tpl;
73  $ilCtrl = $this->ctrl;
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.
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 593 of file class.ilSCORM2004ScoGUI.php.

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

◆ exportISO()

ilSCORM2004ScoGUI::exportISO ( )

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

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

◆ exportPDF()

ilSCORM2004ScoGUI::exportPDF ( )

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

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

◆ exportScorm12()

ilSCORM2004ScoGUI::exportScorm12 ( )

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

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

◆ exportScorm2004_3rd()

ilSCORM2004ScoGUI::exportScorm2004_3rd ( )

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

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

◆ exportScorm2004_4th()

ilSCORM2004ScoGUI::exportScorm2004_4th ( )

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

572  {
573  $export = new ilScorm2004Export($this->node_object, 'SCORM 2004 4th');
574  $export->buildExportFile();
575  $this->ctrl->redirect($this, "showExportList");
576  }
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 686 of file class.ilSCORM2004ScoGUI.php.

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

Referenced by downloadResource(), and sco_resources().

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

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

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

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

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

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

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

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

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

844  {
845  $lng = $this->lng;
847 
848  // check if file was uploaded
849  $source = $_FILES["scormfile"]["tmp_name"];
850  if (($source == 'none') || (!$source)) {
851  $ilErr->raiseError("No file selected!", $ilErr->MESSAGE);
852  }
853  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
854  switch ($_FILES["scormfile"]["error"]) {
855  case UPLOAD_ERR_INI_SIZE:
856  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
857  break;
858 
859  case UPLOAD_ERR_FORM_SIZE:
860  $ilErr->raiseError($lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
861  break;
862 
863  case UPLOAD_ERR_PARTIAL:
864  $ilErr->raiseError($lng->txt("err_partial_file_upload"), $ilErr->MESSAGE);
865  break;
866 
867  case UPLOAD_ERR_NO_FILE:
868  $ilErr->raiseError($lng->txt("err_no_file_uploaded"), $ilErr->MESSAGE);
869  break;
870  }
871 
872  $file = pathinfo($_FILES["scormfile"]["name"]);
873  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
874  $file_path = $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId() . "/" . $_FILES["scormfile"]["name"];
875  ilUtil::createDirectory($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
876  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
877  ilUtil::unzip($file_path);
878  ilUtil::renameExecutables($this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
879 
880  include_once("./Modules/Scorm2004/classes/ilSCORM13Package.php");
881  $newPack = new ilSCORM13Package();
882  $newPack->il_importSco($this->slm_object->getId(), $this->node_object->getId(), $this->slm_object->getDataDirectory() . "/" . $this->node_object->getId());
883 
884  $this->ctrl->redirect($this, "showOrganization");
885  }
$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 unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
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 499 of file class.ilSCORM2004ScoGUI.php.

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

◆ proceedDragDrop()

ilSCORM2004ScoGUI::proceedDragDrop ( )

Perform drag and drop action.

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

References $_POST, and $ctrl.

374  {
375  $ilCtrl = $this->ctrl;
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.
$_POST["username"]

◆ sahs_questions()

ilSCORM2004ScoGUI::sahs_questions ( )

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

References 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, 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 
395  $ilCtrl = $this->ctrl;
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 
418  $tpl->addOnLoadCode("pager.Init();");
419 
420  $tree = new ilTree($this->slm_object->getId());
421  $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
422  $tree->setTreeTablePK("slm_id");
423  include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
424  include_once "./Services/MetaData/classes/class.ilMD.php";
425 
426  $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
427  $desc_ids = $meta->getGeneral()->getDescriptionIds();
428  $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
429 
430  // get sco template
431  $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
432 
433  // navigation
434  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
435  ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
436 
437  // meta page (description and objectives)
439  $sco_tpl,
440  $this->node_object,
441  $this->node_object->getType()
442  );
443 
444  // init export (this initialises glossary template)
446  $terms = $this->node_object->getGlossaryTermIds();
447 
448  // render page
449  foreach ($tree->getSubTree($tree->getNodeData($this->node_object->getId()), true, 'page') as $page) {
450  $page_obj = new ilSCORM2004PageGUI(
451  $this->node_object->getType(),
452  $page["obj_id"],
453  0,
454  $this->slm_object->getId()
455  );
456  $page_obj->setPresentationTitle($page["title"]);
457  $page_obj->setOutputMode(ilPageObjectGUI::PREVIEW);
458  $page_obj->setStyleId($this->slm_object->getStyleSheetId());
459  if (count($terms) > 1) {
460  $page_obj->setGlossaryOverviewInfo(
462  $this->node_object
463  );
464  }
465  $sco_tpl->setCurrentBlock("page_preview");
466  $html = $ilCtrl->getHTML($page_obj);
467  //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
468  $sco_tpl->setVariable("PAGE_PRV", $html);
469  $sco_tpl->parseCurrentBlock();
470  }
471 
472  $output = $sco_tpl->get();
473 
474  // append glossary entries on the sco level
475  $output .= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
476 
477  //insert questions
478  require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
479  $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/", array(get_class($this), 'insertQuestion'), $output);
480  $output = "<script>var ScormApi=null;" . ilQuestionExporter::questionsJS() . "</script>" . $output;
481 
482  $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
483 
484  $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
485  $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
486 
487  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
489 
490  //inline JS
491  $output .= '<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
492  $tpl->addOnLoadCode("ilias.questions.refresh_lang();");
493  $tpl->setVariable("CONTENT", $output);
494  $tpl->printToStdout();
495  exit;
496  }
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 $DIC
Definition: goto.php:24
& 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.
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 739 of file class.ilSCORM2004ScoGUI.php.

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

740  {
741  $this->setTabs();
742  $this->setLocator();
743  $export_files = $this->getExportResources();
744 
745  $tab = new \ILIAS\Scorm2004\Editor\ilSCORMMediaOverviewTableGUI($this, "sco_resources");
746  $tab->setData($export_files);
747 
748  $this->tpl->setContent($tab->getHTML());
749  }
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 508 of file class.ilSCORM2004ScoGUI.php.

References $_POST.

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

◆ setTabs()

ilSCORM2004ScoGUI::setTabs ( )

output tabs

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

References $ctrl, $help, 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;
283  $ilCtrl = $this->ctrl;
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.
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 524 of file class.ilSCORM2004ScoGUI.php.

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

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