ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 constructor More...
 
 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 @access public. More...
 
- Data Fields inherited from ilSCORM2004NodeGUI
 $node_object
 
 $slm_object
 

Static Private Member Functions

static insertQuestion ($matches)
 

Detailed Description

Class ilSCORM2004ScoGUI.

User Interface for Scorm 2004 SCO Nodes

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilSCORM2004ScoGUI: ilObjectMetaDataGUI, ilNoteGUI, ilPCQuestionGUI, ilSCORM2004PageGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

constructor

Parameters
object$a_content_objnode object

Reimplemented from ilSCORM2004NodeGUI.

Reimplemented in ilSCORM2004AssetGUI.

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

32 {
33 global $ilCtrl;
34
35 $ilCtrl->saveParameter($this, "obj_id");
36 $this->ctrl = &$ilCtrl;
37
38 parent::__construct($a_slm_obj, $a_node_id);
39 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

Member Function Documentation

◆ cancel()

ilSCORM2004ScoGUI::cancel ( )

Cancel action.

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

955 {
956 $this->ctrl->redirect($this, "showOrganization");
957 }

◆ cancelDeleteExportFile()

ilSCORM2004ScoGUI::cancelDeleteExportFile ( )

cancel deletion of export files

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

623 {
624 ilSession::clear("ilExportFiles");
625 $this->ctrl->redirect($this, "showExportList");
626 }
static clear($a_var)
Unset a value.

References ilSession\clear().

+ Here is the call graph for this function:

◆ confirmDeleteExportFile()

ilSCORM2004ScoGUI::confirmDeleteExportFile ( )

confirmation screen for export file deletion

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

586 {
587 global $lng, $tpl;
588
589 if(!isset($_POST["file"]))
590 {
591 ilUtil::sendInfo($lng->txt("no_checkbox"),true);
592 $this->ctrl->redirect($this, "showExportList");
593 }
594
595 ilUtil::sendQuestion($lng->txt("info_delete_sure"));
596 $export_files = $this->node_object->getExportFiles();
597
598 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
599 $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList', true);
600 $data = array();
601 foreach ($export_files as $exp_file)
602 {
603 foreach ($_POST['file'] as $delete_file)
604 {
605 if (strcmp($delete_file, $exp_file['file']) == 0)
606 {
607 // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
608 // ? " <b>(".$this->lng->txt("public").")<b>"
609 // : "";
610 $file_arr = explode("__", $exp_file["file"]);
611 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));
612 }
613 }
614 }
615 $table_gui->setData($data);
616 $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
617 }
global $tpl
Definition: ilias.php:8
$_POST["username"]
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17

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

+ Here is the call graph for this function:

◆ deleteExportFile()

ilSCORM2004ScoGUI::deleteExportFile ( )

delete export files

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

633 {
634 global $lng;
635 include_once "./Services/Utilities/classes/class.ilUtil.php";
636 $export = new ilSCORM2004Export($this->node_object);
637 foreach($_POST['file'] as $idx => $file)
638 {
639 $export_dir = $export->getExportDirectoryForType($_POST['type'][$idx]);
640 $exp_file = $export_dir."/".$file;
641 if (@is_file($exp_file))
642 {
643 unlink($exp_file);
644 }
645 }
646 ilUtil::sendSuccess($lng->txt('msg_deleted_export_files'), true);
647 $this->ctrl->redirect($this, "showExportList");
648 }
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

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

+ Here is the call graph for this function:

◆ downloadExportFile()

ilSCORM2004ScoGUI::downloadExportFile ( )

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

575 {
576 $file = str_replace("..", "", $_GET['file']);
577 $export = new ilSCORM2004Export($this->node_object);
578 $export_dir = $export->getExportDirectoryForType($_GET['type']);
579 ilUtil::deliverFile($export_dir."/".$file, $file);
580 }
$_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.

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

+ Here is the call graph for this function:

◆ downloadFile()

ilSCORM2004ScoGUI::downloadFile ( )

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

846 {
847 $file = explode("_", $_GET["file_id"]);
848 require_once("./Modules/File/classes/class.ilObjFile.php");
849 $fileObj = new ilObjFile($file[count($file) - 1], false);
850 $fileObj->sendFile();
851 exit;
852 }
Class ilObjFile.

References $_GET, $file, and exit.

◆ downloadResource()

ilSCORM2004ScoGUI::downloadResource ( )

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

813 {
814 $export_files = $this->getExportResources();
815
816 if ($_GET["file_id"] > 0)
817 {
818 $file = new ilObjFile($_GET["file_id"], false);
819 }
820
821 // check that file really belongs to SCORM module (security)
822 foreach ($export_files as $f)
823 {
824 if (is_object($file))
825 {
826 if ($f["file"] == $file->getFileName())
827 {
828 $file->sendFile();
829 }
830 }
831 else
832 {
833 if ($f["path"] == $_GET["resource"])
834 {
835 if (is_file($f["path"]))
836 {
837 ilUtil::deliverFile($f["path"], $f["file"]);
838 }
839 }
840 }
841 }
842 exit;
843 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilSCORM2004ScoGUI::executeCommand ( )

execute command

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

53 {
54 global $tpl, $ilCtrl, $ilTabs;
55
56 $tpl->getStandardTemplate();
57
58 $next_class = $ilCtrl->getNextClass($this);
59 $cmd = $ilCtrl->getCmd();
60
61 switch($next_class)
62 {
63 // notes
64 case "ilnotegui":
65 switch($_GET["notes_mode"])
66 {
67 default:
68 $ilTabs->setTabActive("sahs_organization");
69 return $this->showOrganization();
70 }
71 break;
72
73 case 'ilobjectmetadatagui':
74 $this->setTabs();
75 $this->setLocator();
76 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
77 $md_gui = new ilObjectMetaDataGUI($this->slm_object,
78 $this->node_object->getType(), $this->node_object->getId());
79 $md_gui->addMDObserver($this->node_object,'MDUpdateListener','General');
80 $ilCtrl->forwardCommand($md_gui);
81 break;
82
83 case 'ilscorm2004pagegui':
84 include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
85 $page_obj = new ilSCORM2004PageGUI("sahs",$_GET["pg_id"]);
86 //$page_obj->setPresentationTitle($page["title"]);
87 $page_obj->setOutputMode(IL_PAGE_PREVIEW);
88 $ilCtrl->forwardCommand($page_obj);
89 break;
90
91 default:
92 $cmd = $ilCtrl->getCmd("showOrganization");
93 $ret = $this->$cmd();
94 break;
95 }
96 }
const IL_PAGE_PREVIEW
Class ilObjectMetaDataGUI.
showOrganization()
Confirm deletion screen (delete page or structure objects)
setLocator()
Set Locator Items.
Class ilSCORM2004Page GUI class.
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ilCtrl, $ret, $tpl, IL_PAGE_PREVIEW, ilSCORM2004NodeGUI\setLocator(), setTabs(), and ilSCORM2004NodeGUI\showOrganization().

+ Here is the call graph for this function:

◆ exportHTML()

ilSCORM2004ScoGUI::exportHTML ( )

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

554 {
555 $export = new ilScorm2004Export($this->node_object,'HTML');
556 $export->buildExportFile();
557 $this->ctrl->redirect($this, "showExportList");
558 }
Export class for SCORM 2004 object.

◆ exportISO()

ilSCORM2004ScoGUI::exportISO ( )

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

561 {
562 $export = new ilScorm2004Export($this->node_object,'ISO');
563 $export->buildExportFile();
564 $this->ctrl->redirect($this, "showExportList");
565 }

◆ exportPDF()

ilSCORM2004ScoGUI::exportPDF ( )

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

568 {
569 $export = new ilScorm2004Export($this->node_object,'PDF');
570 $export->buildExportFile();
571 $this->ctrl->redirect($this, "showExportList");
572 }

◆ exportScorm12()

ilSCORM2004ScoGUI::exportScorm12 ( )

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

547 {
548 $export = new ilScorm2004Export($this->node_object,'SCORM 1.2');
549 $export->buildExportFile();
550 $this->ctrl->redirect($this, "showExportList");
551 }

◆ exportScorm2004_3rd()

ilSCORM2004ScoGUI::exportScorm2004_3rd ( )

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

540 {
541 $export = new ilScorm2004Export($this->node_object,'SCORM 2004 3rd');
542 $export->buildExportFile();
543 $this->ctrl->redirect($this, "showExportList");
544 }

◆ exportScorm2004_4th()

ilSCORM2004ScoGUI::exportScorm2004_4th ( )

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

532 {
533 $export = new ilScorm2004Export($this->node_object,'SCORM 2004 4th');
534 $export->buildExportFile();
535 $this->ctrl->redirect($this, "showExportList");
536 }

◆ getEditTree()

ilSCORM2004ScoGUI::getEditTree ( )

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

273 {
274die("deprecated");
275 $slm_tree = new ilTree($this->node_object->getId(),$this->slm_object->getId());
276 $slm_tree->setTreeTablePK("slm_id");
277 $slm_tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
278 return $slm_tree;
279 }
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

◆ getExportResources()

ilSCORM2004ScoGUI::getExportResources ( )

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

651 {
652 $export_files = array();
653
654 require_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
655 include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
656 include_once "./Modules/File/classes/class.ilObjFile.php";
657 $tree = new ilTree($this->slm_object->getId());
658 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
659 $tree->setTreeTablePK("slm_id");
660 foreach($tree->getSubTree($tree->getNodeData($this->node_object->getId()),true,'page') as $page)
661 {
662 $page_obj = new ilSCORM2004Page($page["obj_id"]);
663 $page_obj->buildDom();
664 $mob_ids = $page_obj->collectMediaObjects(false);
665 foreach($mob_ids as $mob_id)
666 {
667 if ($mob_id > 0 && ilObject::_exists($mob_id))
668 {
670
671 $media_obj = new ilObjMediaObject($mob_id);
672 $export_files[$i]["date"] = $media_obj->getCreateDate();
673 $export_files[$i]["size"] = @filesize($path); // could be remote, e.g. youtube video
674 $export_files[$i]["file"] = $media_obj->getTitle();
675 $export_files[$i]["type"] = $media_obj->getDescription();
676 $export_files[$i]["path"] = $path;
677 $this->ctrl->setParameter($this, "resource",
678 rawurlencode(ilObjMediaObject::_lookupStandardItemPath($mob_id,false,false)));
679 $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this,"downloadResource");
680 $i++;
681 }
682 }
683 include_once("./Services/COPage/classes/class.ilPCFileList.php");
684 $file_ids =ilPCFileList::collectFileItems($page_obj, $page_obj->getDomDoc());
685 foreach($file_ids as $file_id)
686 {
687 $file_obj = new ilObjFile($file_id, false);
688 $export_files[$i]["date"] = $file_obj->getCreateDate();
689 $export_files[$i]["size"] = $file_obj->getFileSize();
690 $export_files[$i]["file"] = $file_obj->getFileName();
691 $export_files[$i]["type"] = $file_obj->getFileType();
692 $export_files[$i]["file_id"] = $file_id;
693 $this->ctrl->setParameter($this, "file_id",$file_id);
694 $export_files[$i]["link"] = $this->ctrl->getLinkTarget($this,"downloadFile","");
695 $i++;
696 }
697 unset($page_obj);
698 }
699
700 return $export_files;
701 }
$path
Definition: aliased.php:25
Class ilObjMediaObject.
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@access public
static collectFileItems($a_page, $a_domdoc)
Get all file items that are used within the page.
Class ilSCORM2004Page.

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

Referenced by downloadResource(), and sco_resources().

+ 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

return

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

977 {
978 global $lng;
979
980 $tpl = new ilTemplate("tpl.sco_glossary_overview.html", true, true, "Modules/Scorm2004");
981
982 $terms = $a_sco->getGlossaryTermIds();
984 foreach ($terms as $k => $t)
985 {
986 $tpl->setCurrentBlock("link");
987 $tpl->setVariable("TXT_LINK", $t);
988 $tpl->setVariable("ID_LINK", "glo_ov_t".$k);
989 $tpl->parseCurrentBlock();
990 }
991
992 $tpl->setVariable("DIV_ID", ilSCORM2004ScoGUI::getGlossaryOverviewId());
993 $tpl->setVariable("TXT_SCO_GLOSSARY", $lng->txtlng("content", "cont_sco_glossary", $lk));
994 $tpl->setVariable("TXT_CLOSE", $lng->txtlng("common", "close", $lk));
995
996 if (count($terms) > 1)
997 {
998 return $tpl->get();
999 }
1000 else
1001 {
1002 return "";
1003 }
1004 }
static getAffectiveLocalization($a_id)
Get affective localization.
static getGlossaryOverviewId()
Get sco glossary overlay id.
special template class to simplify handling of ITX/PEAR

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

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

+ 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

return

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

966 {
967 return "sco_glo_ov";
968 }

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

+ Here is the caller graph for this function:

◆ getType()

ilSCORM2004ScoGUI::getType ( )

Get Node Type.

Reimplemented in ilSCORM2004AssetGUI.

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

45 {
46 return "sco";
47 }

◆ import()

ilSCORM2004ScoGUI::import ( )

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

855 {
856 global $tpl, $lng;
857
858 $this->setTabs();
859 $this->setLocator();
860
861 $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scormeditor_sco_import.html", "Modules/Scorm2004");
862
863 $tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_lm.svg'));
864 $tpl->setVariable("ALT_IMG", $lng->txt("obj_sahs"));
865
866 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
867
868 $tpl->setVariable("BTN_NAME", "importSave");
869
870 // this leads to _top target which removes the left organization frame
871 //$tpl->setVariable("TARGET", ' target="'.ilFrameTargetInfo::_getFrame("MainContent").'" ');
872
873 $tpl->setVariable("TXT_UPLOAD", $lng->txt("upload"));
874 $tpl->setVariable("TXT_CANCEL", $lng->txt("cancel"));
875 $tpl->setVariable("TXT_IMPORT_SCO", $lng->txt("import_sco_object"));
876 $tpl->setVariable("TXT_SELECT_FILE", $lng->txt("select_file"));
877 $tpl->setVariable("TXT_VALIDATE_FILE", $lng->txt("cont_validate_file"));
878
879 // get the value for the maximal uploadable filesize from the php.ini (if available)
880 $umf=get_cfg_var("upload_max_filesize");
881 // get the value for the maximal post data from the php.ini (if available)
882 $pms=get_cfg_var("post_max_size");
883
884 //convert from short-string representation to "real" bytes
885 $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
886
887 $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
888 $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
889
890 if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
891 if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
892
893 // use the smaller one as limit
894 $max_filesize=min($umf, $pms);
895
896 if (!$max_filesize) $max_filesize=max($umf, $pms);
897
898 //format for display in mega-bytes
899 $max_filesize=sprintf("%.1f MB",$max_filesize/1024/1024);
900
901 // gives out the limit as a little notice
902 $tpl->setVariable("TXT_FILE_INFO", $lng->txt("file_notice")." $max_filesize");
903 }
sprintf('%.4f', $callTime)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
echo;exit;}function LogoutNotification($SessionID) { global $ilDB; $q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE

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

+ Here is the call graph for this function:

◆ importSave()

ilSCORM2004ScoGUI::importSave ( )

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

906 {
907 global $_FILES, $rbacsystem;
908 global $ilias, $lng;
909
910 // check if file was uploaded
911 $source = $_FILES["scormfile"]["tmp_name"];
912 if (($source == 'none') || (!$source))
913 {
914 $ilias->raiseError("No file selected!",$ilias->error_obj->MESSAGE);
915 }
916 // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
917 switch ($_FILES["scormfile"]["error"])
918 {
919 case UPLOAD_ERR_INI_SIZE:
920 $ilias->raiseError($lng->txt("err_max_file_size_exceeds"),$ilias->error_obj->MESSAGE);
921 break;
922
923 case UPLOAD_ERR_FORM_SIZE:
924 $ilias->raiseError($lng->txt("err_max_file_size_exceeds"),$ilias->error_obj->MESSAGE);
925 break;
926
927 case UPLOAD_ERR_PARTIAL:
928 $ilias->raiseError($lng->txt("err_partial_file_upload"),$ilias->error_obj->MESSAGE);
929 break;
930
931 case UPLOAD_ERR_NO_FILE:
932 $ilias->raiseError($lng->txt("err_no_file_uploaded"),$ilias->error_obj->MESSAGE);
933 break;
934 }
935
936 $file = pathinfo($_FILES["scormfile"]["name"]);
937 $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
938 $file_path = $this->slm_object->getDataDirectory()."/".$this->node_object->getId()."/".$_FILES["scormfile"]["name"];
939 ilUtil::createDirectory($this->slm_object->getDataDirectory()."/".$this->node_object->getId());
940 ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"], $_FILES["scormfile"]["name"], $file_path);
941 ilUtil::unzip($file_path);
942 ilUtil::renameExecutables($this->slm_object->getDataDirectory()."/".$this->node_object->getId());
943
944 include_once ("./Modules/Scorm2004/classes/ilSCORM13Package.php");
945 $newPack = new ilSCORM13Package();
946 $newPack->il_importSco($this->slm_object->getId(),$this->node_object->getId(),$this->slm_object->getDataDirectory()."/".$this->node_object->getId());
947
948 $this->ctrl->redirect($this, "showOrganization");
949 }
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static createDirectory($a_dir, $a_mod=0755)
create directory
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.

References $file, $lng, ilUtil\createDirectory(), ilUtil\moveUploadedFile(), ilUtil\renameExecutables(), and ilUtil\unzip().

+ Here is the call graph for this function:

◆ insertQuestion()

static ilSCORM2004ScoGUI::insertQuestion (   $matches)
staticprivate

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

458 {
459 $q_exporter = new ilQuestionExporter(false);
460 return $q_exporter->exportQuestion($matches[2]);
461 }
Scorm 2004 Question Exporter.

◆ proceedDragDrop()

ilSCORM2004ScoGUI::proceedDragDrop ( )

Perform drag and drop action.

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

347 {
348 global $ilCtrl;
349
350 //echo "-".$_POST["il_hform_source_id"]."-".$_POST["il_hform_target_id"]."-".$_POST["il_hform_fc"]."-";
351 $this->slm_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
352 $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
353 $ilCtrl->redirect($this, "showOrganization");
354 }

References $_POST, and $ilCtrl.

◆ sahs_questions()

ilSCORM2004ScoGUI::sahs_questions ( )

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

216 {
217 global $tpl,$lng, $ilCtrl;
218
219 $this->setTabs();
220 $this->setLocator();
221
222 include_once "./Services/Table/classes/class.ilTableGUI.php";
223 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Page.php";
224 include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
225 include_once("./Services/COPage/classes/class.ilPCQuestionGUI.php");
226
227 // load template for table
228 $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
229 $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scormeditor_sco_question.html", "Modules/Scorm2004");
230
231 $tbl = new ilTableGUI();
232 $tbl->setTitle("Questions for ".$this->node_object->getTitle());
233 $tbl->setHeaderNames(array("Question","Page"));
234 $cols = array("question","page");
235 $tbl->setHeaderVars($cols, $header_params);
236 $tbl->setColumnWidth(array("50%", "50%"));
237 $tbl->disable("sort");
238 $tbl->disable("footer");
239
240 $tree = new ilTree($this->slm_object->getId());
241 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
242 $tree->setTreeTablePK("slm_id");
243
244 foreach($tree->getSubTree($tree->getNodeData($this->node_object->getId()),true,'page') as $page)
245 {
246 // get question ids
247 include_once("./Services/COPage/classes/class.ilPCQuestion.php");
248 $qids = ilPCQuestion::_getQuestionIdsForPage("sahs", $page["obj_id"]);
249 if (count($qids) > 0)
250 {
251 // output questions
252 foreach ($qids as $qid)
253 {
254 $tpl->setCurrentBlock("tbl_content");
255 $tpl->setVariable("TXT_PAGE_TITLE", $page["title"]);
256 $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
257 $tpl->setVariable("HREF_EDIT_PAGE", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
258
259 $qtitle = assQuestion::_getTitle($qid);
260 $tpl->setVariable("TXT_QUESTION", $qtitle);
261 $ilCtrl->setParameterByClass("ilscorm2004pagenodegui", "obj_id", $page["obj_id"]);
262 //$tpl->setVariable("HREF_EDIT_QUESTION", $ilCtrl->getLinkTargetByClass("ilscorm2004pagenodegui", "edit"));
263
264 $tpl->setVariable("CSS_ROW", ilUtil::switchColor($i++, "tblrow1", "tblrow2"));
265 $tpl->parseCurrentBlock();
266 }
267 }
268 }
269 $tbl->render();
270 }
static _getTitle($a_q_id)
Returns the title of a question.
static _getQuestionIdsForPage($a_parent_type, $a_page_id, $a_lang="-")
Get all questions of a page.
Class ilTableGUI.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
$tbl
Definition: example_048.php:81

References $ilCtrl, $lng, $tbl, $tpl, ilPCQuestion\_getQuestionIdsForPage(), assQuestion\_getTitle(), ilSCORM2004NodeGUI\setLocator(), setTabs(), and ilUtil\switchColor().

+ Here is the call graph for this function:

◆ sco_preview()

ilSCORM2004ScoGUI::sco_preview ( )

SCO preview.

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

360 {
361 global $tpl, $ilCtrl, $lng;
362
363 // init main template
364 $tpl = new ilTemplate("tpl.main.html", true, true);
365 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
366 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
367 $tpl->setBodyClass("");
368 $tpl->setCurrentBlock("ContentStyle");
369 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
370 ilObjStyleSheet::getContentStylePath($this->slm_object->getStyleSheetId()));
371 $tpl->parseCurrentBlock();
372
373 // get javascript
374 include_once("./Services/jQuery/classes/class.iljQueryUtil.php");
377 $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/pure.js");
378 $tpl->addJavaScript("./Modules/Scorm2004/scripts/pager.js");
379
380 $tpl->addOnLoadCode("pager.Init();");
381
382 $tree = new ilTree($this->slm_object->getId());
383 $tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
384 $tree->setTreeTablePK("slm_id");
385 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php";
386 include_once "./Services/MetaData/classes/class.ilMD.php";
387
388 $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
389 $desc_ids = $meta->getGeneral()->getDescriptionIds();
390 $sco_description = $meta->getGeneral()->getDescription($desc_ids[0])->getDescription();
391
392 // get sco template
393 $sco_tpl = new ilTemplate("tpl.sco.html", true, true, "Modules/Scorm2004");
394
395 // navigation
396 $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
397 ilSCORM2004Asset::renderNavigation($sco_tpl, "", $lk);
398
399 // meta page (description and objectives)
400 ilSCORM2004Asset::renderMetaPage($sco_tpl, $this->node_object,
401 $this->node_object->getType());
402
403 // init export (this initialises glossary template)
405 $terms = $this->node_object->getGlossaryTermIds();
406
407 // render page
408 foreach($tree->getSubTree($tree->getNodeData($this->node_object->getId()),true,'page') as $page)
409 {
410 $page_obj = new ilSCORM2004PageGUI($this->node_object->getType(),$page["obj_id"],
411 0, $this->slm_object->getId());
412 $page_obj->setPresentationTitle($page["title"]);
413 $page_obj->setOutputMode(IL_PAGE_PREVIEW);
414 $page_obj->setStyleId($this->slm_object->getStyleSheetId());
415 if (count($terms) > 1)
416 {
417 $page_obj->setGlossaryOverviewInfo(
418 ilSCORM2004ScoGUI::getGlossaryOverviewId(), $this->node_object);
419 }
420 $sco_tpl->setCurrentBlock("page_preview");
421 $html = $ilCtrl->getHTML($page_obj);
422 //$sco_tpl->setVariable("PAGE_PRV", $page_obj->showPage("export"));
423 $sco_tpl->setVariable("PAGE_PRV", $html);
424 $sco_tpl->parseCurrentBlock();
425 }
426
427 $output = $sco_tpl->get();
428
429 // append glossary entries on the sco level
430 $output.= ilSCORM2004PageGUI::getGlossaryHTML($this->node_object);
431
432 //insert questions
433 require_once './Modules/Scorm2004/classes/class.ilQuestionExporter.php';
434 $output = preg_replace_callback("/{{{{{(Question;)(il__qst_[0-9]+)}}}}}/",array(get_class($this), 'insertQuestion'),$output);
435// $output = preg_replace("/&#123;/","",$output);
436// $output = preg_replace("/&#125;/","",$output);
437 $output = "<script>var ScormApi=null;".ilQuestionExporter::questionsJS()."</script>".$output;
438
439 $lk = ilObjSAHSLearningModule::getAffectiveLocalization($this->node_object->getSLMId());
440// include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
441// ilSCORM2004PageGUI::addPreparationJavascript($tpl, $lk);
442
443 $tpl->addJavaScript("./Modules/Scorm2004/scripts/questions/question_handling.js");
444 $tpl->addCss("./Modules/Scorm2004/templates/default/question_handling.css");
445
446 include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
448
449 //inline JS
450 $output .='<script type="text/javascript" src="./Modules/Scorm2004/scripts/questions/question_handling.js"></script>';
451 $tpl->setVariable("CONTENT", $output);
452 $tpl->show();
453 exit;
454 }
static getContentStylePath($a_style_id)
get content style path
static initJavascript()
Init javascript.
static renderMetaPage($a_tpl, $a_sco, $a_asset_type="", $mode="")
Render meta page (description/objectives at beginning)
static renderNavigation($a_tpl, $a_spacer_img="", $a_lang="")
Render navigation.
static initExport()
Init export.
static getGlossaryHTML($a_sco)
Get glossary html (only in export mode)
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
static initjQuery($a_tpl=null)
Init jQuery.
$html
Definition: example_001.php:87
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output

References $html, $ilCtrl, $lng, $output, $tpl, exit, ilObjSAHSLearningModule\getAffectiveLocalization(), ilObjStyleSheet\getContentStylePath(), ilSCORM2004PageGUI\getGlossaryHTML(), getGlossaryOverviewId(), ilUtil\getStyleSheetLocation(), IL_PAGE_PREVIEW, ilSCORM2004PageGUI\initExport(), ilOverlayGUI\initJavascript(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), ilSCORM2004Asset\renderMetaPage(), and ilSCORM2004Asset\renderNavigation().

+ Here is the call graph for this function:

◆ sco_resources()

ilSCORM2004ScoGUI::sco_resources ( )

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

704 {
705 global $tpl, $lng, $ilCtrl;;
706
707 $this->setTabs();
708 $this->setLocator();
709 $i = 0;
710
711 $export_files = $this->getExportResources();
712
713 // create table
714 require_once("./Services/Table/classes/class.ilTableGUI.php");
715 $tbl = new ilTableGUI();
716
717 // load files templates
718 $tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
719
720 // load template for table content data
721 $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.download_file_row.html", "Modules/LearningModule");
722
723 $num = 0;
724
725 $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
726
727 $tbl->setTitle($lng->txt("cont_files"));
728
729 $tbl->setHeaderNames(array($lng->txt("cont_format"),
730 $lng->txt("cont_file"),
731 $lng->txt("size"), $lng->txt("date"),
732 ""));
733
734 $cols = array("format", "file", "size", "date", "download");
735 $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
736 "cmd" => "sco_resources", "cmdClass" => strtolower(get_class($this)),
737 "cmdNode" => $_GET["cmdNode"], "baseClass" => $_GET["baseClass"]);
738 $tbl->setHeaderVars($cols, $header_params);
739 $tbl->setColumnWidth(array("10%", "30%", "20%", "20%","20%"));
740 $tbl->disable("sort");
741
742 $tbl->setOrderColumn($_GET["sort_by"]);
743 $tbl->setOrderDirection($_GET["sort_order"]);
744 $tbl->setLimit($_GET["limit"]);
745 $tbl->setOffset($_GET["offset"]);
746 $tbl->setMaxCount($this->maxcount); // ???
747
748
749 $tbl->setMaxCount(count($export_files));
750
751 // footer
752 $tbl->setFooter("tblfooter",$lng->txt("previous"),$lng->txt("next"));
753 //$tbl->disable("footer");
754
755 $tbl->setMaxCount(count($export_files));
756 $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
757
758 $tbl->render();
759 if(count($export_files) > 0)
760 {
761 $i=0;
762 foreach($export_files as $exp_file)
763 {
764 /* remote files (youtube videos) have no size, so we allow them now
765 if (!$exp_file["size"] > 0)
766 {
767 continue;
768 }
769 */
770
771 $tpl->setCurrentBlock("tbl_content");
772 $tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
773
774 $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
775 $tpl->setVariable("CSS_ROW", $css_row);
776
777 $tpl->setVariable("TXT_SIZE", $exp_file["size"]);
778 $tpl->setVariable("TXT_FORMAT", $exp_file["type"]);
779
780 $tpl->setVariable("TXT_DATE", $exp_file["date"]);
781
782 if($exp_file["size"] > 0)
783 {
784 $tpl->setVariable("TXT_DOWNLOAD", $lng->txt("download"));
785 $ilCtrl->setParameter($this, "resource", rawurlencode($exp_file["path"]));
786 $ilCtrl->setParameter($this, "file_id", rawurlencode($exp_file["file_id"]));
787 $tpl->setVariable("LINK_DOWNLOAD",
788 $ilCtrl->getLinkTarget($this, "downloadResource"));
789 }
790 else
791 {
792 $tpl->setVariable("TXT_DOWNLOAD", $lng->txt("show"));
793 $tpl->setVariable("LINK_TARGET", " target=\"_blank\"");
794 $tpl->setVariable("LINK_DOWNLOAD", $exp_file["path"]);
795 }
796
797 $tpl->parseCurrentBlock();
798 }
799 } //if is_array
800 /* not found in template?
801 else
802 {
803 $tpl->setCurrentBlock("notfound");
804 $tpl->setVariable("TXT_OBJECT_NOT_FOUND", $lng->txt("obj_not_found"));
805 $tpl->setVariable("NUM_COLS", 4);
806 $tpl->parseCurrentBlock();
807 }
808 */
809 // $tpl->parseCurrentBlock();
810 }

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

+ Here is the call graph for this function:

◆ selectExport()

ilSCORM2004ScoGUI::selectExport ( )

Select the export type of the SCORM 2004 module.

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

467 {
468 switch ($_POST['select_export'])
469 {
470 case "exportScorm12":
471 case "exportScorm2004_3rd":
472 case "exportScorm2004_4th":
473 case "exportPDF":
474 case "exportHTML":
475 $this->ctrl->redirect($this, $_POST['select_export']);
476 break;
477 default:
478 $this->ctrl->redirect($this, 'showExportList');
479 break;
480 }
481 }

References $_POST.

◆ setTabs()

ilSCORM2004ScoGUI::setTabs ( )

output tabs

Reimplemented in ilSCORM2004AssetGUI.

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

285 {
286 global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
287
288 $ilHelp->setScreenIdComponent("sahsed");
289
290 // subelements
291 $ilTabs->addTarget("sahs_organization",
292 $ilCtrl->getLinkTarget($this,'showOrganization'),
293 "showOrganization", get_class($this));
294
295 // properties (named learning objectives, since here is currently
296 // no other property)
297 $ilTabs->addTarget("sahs_desc_objectives",
298 $ilCtrl->getLinkTarget($this,'showProperties'),
299 "showProperties", get_class($this));
300
301 // questions
302 $ilTabs->addTarget("sahs_questions",
303 $ilCtrl->getLinkTarget($this,'sahs_questions'),
304 "sahs_questions", get_class($this));
305
306 // resources
307 $ilTabs->addTarget("cont_files",
308 $ilCtrl->getLinkTarget($this,'sco_resources'),
309 "sco_resources", get_class($this));
310
311 // metadata
312 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
313 $mdgui = new ilObjectMetaDataGUI($this->slm_object,
314 $this->node_object->getType(), $this->node_object->getId());
315 $mdtab = $mdgui->getTab();
316 if($mdtab)
317 {
318 $ilTabs->addTarget("meta_data",
319 $mdtab,
320 "", "ilmdeditorgui");
321 }
322
323 // export
324 $ilTabs->addTarget("export",
325 $ilCtrl->getLinkTarget($this, "showExportList"), "showExportList",
326 get_class($this));
327
328 // import
329 $ilTabs->addTarget("import",
330 $ilCtrl->getLinkTarget($this, "import"), "import",
331 get_class($this));
332
333 // preview
334 $ilTabs->addNonTabbedLink("preview",
335 $lng->txt("cont_preview"),
336 $ilCtrl->getLinkTarget($this,'sco_preview'), "_blank");
337
338 $tpl->setTitleIcon(ilUtil::getImagePath("icon_sco.svg"));
339 $tpl->setTitle(
340 $lng->txt("sahs_unit").": ".$this->node_object->getTitle());
341 }

References $ilCtrl, $lng, $tpl, and ilUtil\getImagePath().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showExportList()

ilSCORM2004ScoGUI::showExportList ( )

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

484 {
485 global $tpl, $ilCtrl, $lng;
486
487 $this->setTabs();
488 $this->setLocator();
489
490
491 $template = new ilTemplate("tpl.scorm2004_export_buttons.html", true, true, 'Modules/Scorm2004');
492
493 $buttons = array(
494 "exportScorm2004_3rd" => $lng->txt("scorm_create_export_file_scrom2004"),
495 "exportScorm2004_4th" => $lng->txt("scorm_create_export_file_scrom2004_4th"),
496 "exportScorm12" => $lng->txt("scorm_create_export_file_scrom12"),
497 "exportPDF" => $lng->txt("scorm_create_export_file_pdf"),
498 "exportHTML" => $lng->txt("scorm_create_export_file_html")
499 );
500 foreach ($buttons as $value => $text)
501 {
502 $template->setCurrentBlock('option');
503 $template->setVariable('OPTION_VALUE', $value);
504 $template->setVariable('OPTION_TITLE', ilUtil::prepareFormOutput($text));
505 $template->parseCurrentBlock();
506 }
507 $template->setVariable('EXPORT_TITLE', $lng->txt('export'));
508 $template->setVariable('EXPORT_LABEL', $lng->txt('type'));
509 $template->setVariable('FORMACTION', $ilCtrl->getFormAction($this, 'selectExport'));
510
511 $export_files = $this->node_object->getExportFiles();
512
513 include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php";
514 $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList');
515 $data = array();
516 foreach ($export_files as $exp_file)
517 {
518 $filetype = $exp_file['type'];
519 // $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($filetype))
520 // ? " <b>(".$this->lng->txt("public").")<b>"
521 // : "";
522 $file_arr = explode("__", $exp_file["file"]);
523 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));
524 }
525 $table_gui->setData($data);
526 $tpl->setVariable('ADM_CONTENT', $template->get() . "\n" . $table_gui->getHTML());
527
528
529 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$text

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

+ Here is the call graph for this function:

◆ showProperties()

ilSCORM2004ScoGUI::showProperties ( )

Show learning objectives.

Reimplemented in ilSCORM2004AssetGUI.

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

102 {
103 global $tpl, $lng, $ilTabs, $ilCtrl;
104
105 $this->setTabs();
106 $this->setLocator();
107 $ilTabs->setTabActive("sahs_desc_objectives");
108
109 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
110 $form = new ilPropertyFormGUI();
111
112 // hide objectives page
113 $cb = new ilCheckboxInputGUI($lng->txt("sahs_hide_objectives_page"), "hide_objectives_page");
114 $cb->setInfo($lng->txt("sahs_hide_objectives_page_info"));
115 $form->addItem($cb);
116 $cb->setChecked($this->node_object->getHideObjectivePage());
117
118 // description
119 $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
120 $ta->setRows(4);
121 $ta->setCols(55);
122 $ta->setInfo($lng->txt("sahs_list_info"));
123 $form->setTitle($lng->txt("properties"));
124 $form->addItem($ta);
125 include_once "./Services/MetaData/classes/class.ilMD.php";
126 $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
127 $desc_ids = $meta->getGeneral()->getDescriptionIds();
128 $ta->setValue($meta->getGeneral()->getDescription($desc_ids[0])->getDescription());
129
130 // objectives
131 $sh = new ilFormSectionHeaderGUI();
132 $sh->setTitle($lng->txt("sahs_learning_objectives"));
133 $form->addItem($sh);
134
135 $objectives = $this->node_object->getObjectives();
136
137 foreach ($objectives as $ob)
138 {
139 // map info
140 $mappings = $ob->getMappings();
141 $mapinfo = null;
142 foreach($mappings as $map)
143 {
144 $mapinfo .= $map->getTargetObjectiveID();
145 }
146
147 if ($mapinfo == null)
148 {
149 $mapinfo = "local";
150 }
151 else
152 {
153 $mapinfo = "global to ".$mapinfo;
154 }
155
156 // objective
157 $ta = new ilTextAreaInputGUI($mapinfo,
158 "obj_".$ob->getId());
159 $ta->setCols(55);
160 $ta->setRows(4);
161 $ta->setInfo($lng->txt("sahs_list_info"));
162 $form->addItem($ta);
163 $ta->setValue($ob->getObjectiveID());
164 }
165 $form->setFormAction($ilCtrl->getFormAction($this));
166 $form->addCommandButton("updateProperties",
167 $lng->txt("save"));
168 $tpl->setContent($form->getHTML());
169 }
This class represents a checkbox property in a property form.
This class represents a section header in a property form.
This class represents a property form user interface.
This class represents a text area property in a property form.

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

Referenced by updateProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateProperties()

ilSCORM2004ScoGUI::updateProperties ( )

update Properties

Reimplemented in ilSCORM2004AssetGUI.

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

175 {
176 global $tpl,$lng;
177 $empty = false;
178
179 foreach ($_POST as $key=>$value) {
180 if(preg_match('/(obj_)(.+)/', $key,$match)){
181 $objective = new ilScorm2004Objective($this->node_object->getId(),$match[2]);
182// if (!$value)
183// {
184// $empty=true;
185// } else {
186 $objective->setObjectiveID(ilUtil::stripSlashes($value));
187 $objective->updateObjective();
188// }
189 }
190 }
191
192 $this->node_object->setHideObjectivePage(ilUtil::stripSlashes($_POST["hide_objectives_page"]));
193 $this->node_object->update();
194
195 include_once "./Services/MetaData/classes/class.ilMD.php";
196 $meta = new ilMD($this->node_object->getSLMId(), $this->node_object->getId(), $this->node_object->getType());
197 $gen = $meta->getGeneral();
198 $desc_ids = $gen->getDescriptionIds();
199 $des = $gen->getDescription($desc_ids[0]);
200 $des->setDescription(ilUtil::stripSlashes($_POST["desc"]));
201 $des->update();
202 $gen->update();
203
204 if (!$empty)
205 {
206 ilUtil::sendInfo($lng->txt("saved_successfully"),true);
207 }
208 else
209 {
210 ilUtil::sendFailure($lng->txt("sahs_empty_objectives_are_not_allowed"), true);
211 }
212 $this->showProperties();
213 }
showProperties()
Show learning objectives.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $lng, $tpl, ilUtil\sendFailure(), ilUtil\sendInfo(), showProperties(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSCORM2004ScoGUI::$ctrl = null

Constructor @access public.

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


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