ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjSAHSLearningModuleGUI Class Reference

SCORM/AICC/HACP Learning Modules. More...

+ Inheritance diagram for ilObjSAHSLearningModuleGUI:
+ Collaboration diagram for ilObjSAHSLearningModuleGUI:

Public Member Functions

 ilObjSAHSLearningModuleGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 viewObject ()
 
 properties ()
 module properties More...
 
 saveProperties ()
 save properties More...
 
 initCreationForms ($a_new_type)
 no manual SCORM creation, only import at the time More...
 
 initCreationForm ()
 Init form. More...
 
 initUploadForm ()
 Init upload form. More...
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 saveObject ()
 save new learning module to db More...
 
 info ()
 permission form More...
 
 owner ()
 show owner of learning module More...
 
 getTemplate ()
 output main header (title and locator) More...
 
 setTabs ()
 output main frameset of media pool left frame: explorer tree of folders right frame: media pool content More...
 
 certificate ()
 Shows the certificate editor. More...
 
 getTabs (&$tabs_gui)
 adds tabs to tab gui object More...
 
 addLocatorItems ()
 
 editContent ()
 List files. More...
 
 setSettingsSubTabs ()
 set Tabs for settings More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 goto target course More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjSAHSLearningModuleGUI::_goto (   $a_target)
static

goto target course

Definition at line 721 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendInfo().

722  {
723  global $ilAccess, $ilErr, $lng;
724 
725  $parts = explode("_", $a_target);
726 
727  if ($ilAccess->checkAccess("write", "", $parts[0]))
728  {
729  $_GET["cmd"] = "";
730  $_GET["baseClass"] = "ilSAHSEditGUI";
731  $_GET["ref_id"] = $parts[0];
732  $_GET["obj_id"] = $parts[1];
733  include("ilias.php");
734  exit;
735  }
736  if ($ilAccess->checkAccess("visible", "", $parts[0]) || $ilAccess->checkAccess("read", "", $parts[0]))
737  {
738  $_GET["cmd"] = "infoScreen";
739  $_GET["baseClass"] = "ilSAHSPresentationGUI";
740  $_GET["ref_id"] = $parts[0];
741  include("ilias.php");
742  exit;
743  }
744  else
745  {
746  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
747  {
748  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
751  }
752  }
753 
754  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
755  }
exit
Definition: login.php:54
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSAHSLearningModuleGUI::addLocatorItems ( )

Definition at line 757 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET.

758  {
759  global $ilLocator;
760 
761  if (is_object($this->object))
762  {
763  $ilLocator->addItem($this->object->getTitle(),
764  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
765  }
766  }
$_GET["client_id"]

◆ certificate()

ilObjSAHSLearningModuleGUI::certificate ( )

Shows the certificate editor.

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

603  {
604  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
605  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
606  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
607  $output_gui->certificateEditor();
608  }
GUI class to create PDF certificates.

◆ editContent()

ilObjSAHSLearningModuleGUI::editContent ( )

List files.

Parameters

Definition at line 774 of file class.ilObjSAHSLearningModuleGUI.php.

References $ilCtrl.

775  {
776  global $ilCtrl;
777 
778  if (!$this->object->getEditable())
779  {
780  $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
781  }
782  else
783  {
784  $ilCtrl->redirectByClass("ilobjscorm2004learningmodulegui", "editOrganization");
785  }
786  }
global $ilCtrl
Definition: ilias.php:18

◆ executeCommand()

& ilObjSAHSLearningModuleGUI::executeCommand ( )

execute command

Definition at line 37 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET, $cmd, $ilErr, $info, $ret, ilObjectGUI\getCreationMode(), ilUtil\getImagePath(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getTemplate(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\omitLocator(), ilObjectGUI\prepareOutput(), ilObjectGUI\setLocator(), setSettingsSubTabs(), setTabs(), and ilFileSystemGUI\setUseUploadDirectory().

38  {
39  global $ilAccess, $ilTabs, $ilErr;
40 
41  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
42  strtolower($_GET["baseClass"]) == "ilsahspresentationgui" ||
43  $this->getCreationMode() == true)
44  {
45  $this->prepareOutput();
46  }
47  else
48  {
49  $this->getTemplate();
50  $this->setLocator();
51  $this->setTabs();
52  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
53  $this->tpl->setTitle($this->object->getTitle());
54  }
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58 
59  switch($next_class)
60  {
61  case 'ilobjectmetadatagui':
62  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
63  {
64  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
65  }
66  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
67  $md_gui = new ilObjectMetaDataGUI($this->object);
68  $this->ctrl->forwardCommand($md_gui);
69  break;
70 
71  case 'ilpermissiongui':
72  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
73  $perm_gui =& new ilPermissionGUI($this);
74  $ret =& $this->ctrl->forwardCommand($perm_gui);
75  break;
76 
77  case "ilfilesystemgui":
78  $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
79  $this->fs_gui->setUseUploadDirectory(true);
80  $this->fs_gui->setTableId("sahsfs".$this->object->getId());
81  $ret =& $this->ctrl->forwardCommand($this->fs_gui);
82  break;
83 
84  case "ilcertificategui":
85  $this->setSettingsSubTabs();
86  $ilTabs->setSubTabActive('certificate');
87  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
88  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
89  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
90  $ret =& $this->ctrl->forwardCommand($output_gui);
91  break;
92 
93  case "illearningprogressgui":
94  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
95 
96  $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY,$this->object->getRefId());
97  $this->ctrl->forwardCommand($new_gui);
98 
99  break;
100 
101  case 'illicensegui':
102  include_once("./Services/License/classes/class.ilLicenseGUI.php");
103  $license_gui =& new ilLicenseGUI($this);
104  $ret =& $this->ctrl->forwardCommand($license_gui);
105  break;
106 
107  case "ilinfoscreengui":
108  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
109 
110  $info = new ilInfoScreenGUI($this);
111  $info->enablePrivateNotes();
112  $info->enableLearningProgress();
113 
114  // add read / back button
115  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
116  {
117  if (!$this->object->getEditable())
118  {
119  $info->addButton($this->lng->txt("view"),
120  "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
121  ' target="ilContObj'.$this->object->getId().'" ');
122  }
123  }
124 
125  $info->enableNews();
126  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
127  {
128  $info->enableNewsEditing();
129  $news_set = new ilSetting("news");
130  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
131  if ($enable_internal_rss)
132  {
133  $info->setBlockProperty("news", "settings", true);
134  }
135  }
136  // show standard meta data section
137  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
138 
139  // forward the command
140  $this->ctrl->forwardCommand($info);
141  break;
142 
143  case "ilcommonactiondispatchergui":
144  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
146  $this->ctrl->forwardCommand($gui);
147  break;
148 
149  case "ilobjstylesheetgui":
150  //$this->addLocations();
151  $this->ctrl->setReturn($this, "properties");
152  $ilTabs->clearTargets();
153  $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
154  $style_gui->omitLocator();
155  if ($cmd == "create" || $_GET["new_type"]=="sty")
156  {
157  $style_gui->setCreationMode(true);
158  }
159  //$ret =& $style_gui->executeCommand();
160 
161  if ($cmd == "confirmedDelete")
162  {
163  $this->object->setStyleSheetId(0);
164  $this->object->update();
165  }
166  $ret =& $this->ctrl->forwardCommand($style_gui);
167  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
168  {
169  $style_id = $ret;
170  $this->object->setStyleSheetId($style_id);
171  $this->object->update();
172  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
173  }
174  break;
175  default:
176  if ($this->object && !$this->object->getEditable())
177  {
178  $cmd = $this->ctrl->getCmd("properties");
179  }
180  else
181  {
182  $cmd = $this->ctrl->getCmd("frameset");
183  }
184  if ((strtolower($_GET["baseClass"]) == "iladministrationgui" ||
185  $this->getCreationMode() == true) &&
186  $cmd != "frameset")
187  {
188  $cmd.= "Object";
189  }
190 
191  // #9225
192  if($cmd == "redrawHeaderAction")
193  {
194  $cmd .= "Object";
195  }
196 
197  $ret =& $this->$cmd();
198  break;
199  }
200  }
ILIAS Setting Class.
Class ilObjectMetaDataGUI.
Class ilInfoScreenGUI.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
getTemplate()
output main header (title and locator)
setUseUploadDirectory($a_val)
Set use upload directory.
$info
Definition: example_052.php:80
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
omitLocator($a_omit=true)
GUI class to create PDF certificates.
prepareOutput()
prepare output
Class ilObjStyleSheetGUI.
getCreationMode()
get creation mode
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
File System Explorer GUI class.
setTabs()
output main frameset of media pool left frame: explorer tree of folders right frame: media pool conte...
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setLocator()
set Locator
+ Here is the call graph for this function:

◆ getTabs()

ilObjSAHSLearningModuleGUI::getTabs ( $tabs_gui)

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

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

References $ilCtrl, $ilUser, ilPrivacySettings\_getInstance(), ilLicenseAccess\_isEnabled(), and ilLearningProgressAccess\checkAccess().

Referenced by setTabs().

616  {
617  global $rbacsystem, $ilUser, $ilCtrl, $ilHelp;
618 
619  if ($this->ctrl->getCmd() == "delete")
620  {
621  return;
622  }
623 
624  switch ($this->object->getSubType())
625  {
626  case "scorm2004":
627  $ilHelp->setScreenIdComponent("sahs13");
628  break;
629 
630  case "scorm":
631  $ilHelp->setScreenIdComponent("sahs12");
632  break;
633  }
634 
635  // file system gui tabs
636  // properties
637  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
638  $tabs_gui->addTarget("cont_list_files",
639  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "",
640  "ilfilesystemgui");
641  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
642 
643  // info screen
644  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui")
645  ? true
646  : false;
647  $tabs_gui->addTarget("info_short",
648  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
649  "ilinfoscreengui", "", $force_active);
650 
651  // properties
652  $tabs_gui->addTarget("settings",
653  $this->ctrl->getLinkTarget($this, "properties"), array("", "properties"),
654  get_class($this));
655 
656  // learning progress and offline mode
657  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
658  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
659  {
660  //if scorm && offline_mode activated
661  if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
662  if ($this->object->getOfflineMode() == true) {
663  $tabs_gui->addTarget("offline_mode_manager",
664  $this->ctrl->getLinkTarget($this, "offlineModeManager"),
665  "offlineModeManager",
666  "ilobjscormlearningmodulegui");
667  }
668  }
669 
670  $tabs_gui->addTarget('learning_progress',
671  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''),
672  '',
673  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
674  }
675 
676  // tracking data
677  if($rbacsystem->checkAccess("read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess("edit_learning_progress", $this->object->getRefId()))
678  {
679  if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
680  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
681  $privacy = ilPrivacySettings::_getInstance();
682  if($privacy->enabledSahsProtocolData())
683  {
684  $tabs_gui->addTarget("cont_tracking_data",
685  $this->ctrl->getLinkTarget($this, "showTrackingItems"), "showTrackingItems",
686  get_class($this));
687  }
688  }
689  }
690  include_once("Services/License/classes/class.ilLicenseAccess.php");
691  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId())
693  {
694  $tabs_gui->addTarget("license",
695  $this->ctrl->getLinkTargetByClass('illicensegui', ''),
696  "", "illicensegui");
697  }
698 
699  // edit meta
700  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
701  $mdgui = new ilObjectMetaDataGUI($this->object);
702  $mdtab = $mdgui->getTab();
703  if($mdtab)
704  {
705  $tabs_gui->addTarget("meta_data",
706  $mdtab,
707  "", "ilmdeditorgui");
708  }
709 
710  // perm
711  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
712  {
713  $tabs_gui->addTarget("perm_settings",
714  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
715  }
716  }
Class ilObjectMetaDataGUI.
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
global $ilCtrl
Definition: ilias.php:18
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
global $ilUser
Definition: imgupload.php:15
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilObjSAHSLearningModuleGUI::getTemplate ( )

output main header (title and locator)

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

References ilObjectGUI\$lng.

Referenced by executeCommand(), and ilObjSCORM2004LearningModuleGUI\executeCommand().

568  {
569  global $lng;
570 
571  $this->tpl->getStandardTemplate();
572  }
+ Here is the caller graph for this function:

◆ ilObjSAHSLearningModuleGUI()

ilObjSAHSLearningModuleGUI::ilObjSAHSLearningModuleGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor.

public

Definition at line 25 of file class.ilObjSAHSLearningModuleGUI.php.

References ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

26  {
27  global $lng;
28 
29  $lng->loadLanguageModule("content");
30  $this->type = "sahs";
31  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
32  }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
+ Here is the call graph for this function:

◆ info()

ilObjSAHSLearningModuleGUI::info ( )

permission form

Definition at line 551 of file class.ilObjSAHSLearningModuleGUI.php.

552  {
553  $this->infoObject();
554  }

◆ initCreationForm()

ilObjSAHSLearningModuleGUI::initCreationForm ( )

Init form.

Parameters
int$a_modeEdit Mode

Definition at line 253 of file class.ilObjSAHSLearningModuleGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), ilTextAreaInputGUI\setCols(), ilTextInputGUI\setSize(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms().

254  {
255  global $lng, $ilCtrl;
256 
257  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
258  $this->form = new ilPropertyFormGUI();
259 
260  // title
261  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
262  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
263  $ti->setMaxLength(ilObject::TITLE_LENGTH);
264  $ti->setRequired(true);
265  $this->form->addItem($ti);
266 
267  // text area
268  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
269  $ta->setCols(40);
270  $ta->setRows(2);
271  $this->form->addItem($ta);
272 
273 
274  $this->form->addCommandButton("save", $lng->txt("create"));
275  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
276 
277  $this->form->setTitle($lng->txt("scorm_new"));
278  $this->form->setFormAction($ilCtrl->getFormAction($this));
279  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
280  }
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
global $ilCtrl
Definition: ilias.php:18
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static _getFrame($a_class, $a_type='')
Get content frame name.
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:

◆ initCreationForms()

ilObjSAHSLearningModuleGUI::initCreationForms (   $a_new_type)

no manual SCORM creation, only import at the time

Definition at line 235 of file class.ilObjSAHSLearningModuleGUI.php.

References initCreationForm(), and initUploadForm().

236  {
237  $forms = array();
238 
239  $this->initUploadForm();
240  $forms[self::CFORM_IMPORT] = $this->form;
241 
242  $this->initCreationForm();
243  $forms[self::CFORM_NEW] = $this->form;
244 
245  return $forms;
246  }
+ Here is the call graph for this function:

◆ initUploadForm()

ilObjSAHSLearningModuleGUI::initUploadForm ( )

Init upload form.

Definition at line 285 of file class.ilObjSAHSLearningModuleGUI.php.

References $file, $ilCtrl, ilObjectGUI\$lng, $options, $si, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilRadioOption\addSubItem(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilCheckboxInputGUI\setValue(), and ilRadioGroupInputGUI\setValue().

Referenced by initCreationForms().

286  {
287  global $lng, $ilCtrl;
288 
289  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
290  $this->form = new ilPropertyFormGUI();
291 
292  // type selection
293  $options = array(
294  "scorm2004" => $lng->txt("lm_type_scorm2004"),
295  "scorm" => $lng->txt("lm_type_scorm")
296  // "aicc" => $lng->txt("lm_type_aicc"),
297  // "hacp" => $lng->txt("lm_type_hacp")
298  );
299  $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
300  $si->setOptions($options);
301  $this->form->addItem($si);
302 
303  // input file
304  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
305  $fi->setRequired(true);
306  $this->form->addItem($fi);
307 
308  // todo "uploaded file"
309  // todo wysiwyg editor removement
310 
311  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
313  {
314  $options = array();
315  $fi->setRequired(false);
317  $options[""] = $this->lng->txt("cont_select_from_upload_dir");
318  foreach($files as $file)
319  {
320  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
321  $options[$file] = $file;
322  }
323  //
324  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
325  $si->setOptions($options);
326  $this->form->addItem($si);
327  }
328 
329 
330  // validate file
331  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
332  $cb->setValue("y");
333  //$cb->setChecked(true);
334  $this->form->addItem($cb);
335 
336  // import for editing
337  $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
338  $cb->setValue("y");
339  $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
340  $this->form->addItem($cb);
341 
342  //
343  $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
344  $radg->setValue(0);
345  $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0,$lng->txt("sahs_std_sequencing_info"));
346  $radg->addOption($op1);
347  $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1,$lng->txt("sahs_import_sequencing_info"));
348  $radg->addOption($op1);
349  $cb->addSubItem($radg);
350 
351 
352  $this->form->addCommandButton("upload", $lng->txt("import"));
353  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
354 
355  $this->form->setTitle($lng->txt("import_sahs"));
356  $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
357  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
358  }
This class represents an option in a radio group.
print $file
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a file property in a property form.
This class represents a checkbox property in a property form.
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
if(!is_array($argv)) $options
addSubItem($a_item)
Add Subitem.
setValue($a_value)
Set Value.
setOptions($a_options)
Set Options.
static _getFrame($a_class, $a_type='')
Get content frame name.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ owner()

ilObjSAHSLearningModuleGUI::owner ( )

show owner of learning module

Definition at line 559 of file class.ilObjSAHSLearningModuleGUI.php.

560  {
561  $this->ownerObject();
562  }

◆ properties()

ilObjSAHSLearningModuleGUI::properties ( )

module properties

Definition at line 217 of file class.ilObjSAHSLearningModuleGUI.php.

218  {
219  }

◆ saveObject()

ilObjSAHSLearningModuleGUI::saveObject ( )

save new learning module to db

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

References $_GET, $_POST, ilUtil\redirect(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

524  {
525  if (trim($_POST["title"]) == "")
526  {
527  $this->ilias->raiseError($this->lng->txt("msg_no_title"),$this->ilias->error_obj->MESSAGE);
528  }
529 
530  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
531  $newObj = new ilObjSCORM2004LearningModule();
532  $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
533  $newObj->setSubType("scorm2004");
534  $newObj->setEditable(true);
535  $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
536  $newObj->create();
537  $newObj->createReference();
538  $newObj->putInTree($_GET["ref_id"]);
539  $newObj->setPermissions($_GET["ref_id"]);
540  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
541  $newObj->createDataDirectory();
542  $newObj->createScorm2004Tree();
543  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
544  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
545  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilObjSCORM2004LearningModule.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ saveProperties()

ilObjSAHSLearningModuleGUI::saveProperties ( )

save properties

Definition at line 224 of file class.ilObjSAHSLearningModuleGUI.php.

225  {
226  }

◆ setSettingsSubTabs()

ilObjSAHSLearningModuleGUI::setSettingsSubTabs ( )

set Tabs for settings

Definition at line 791 of file class.ilObjSAHSLearningModuleGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilCertificate\isActive().

Referenced by executeCommand(), ilObjSCORMLearningModuleGUI\newModuleVersion(), ilObjSCORMLearningModuleGUI\properties(), and ilObjSCORM2004LearningModuleGUI\properties().

792  {
793  global $lng, $ilTabs, $ilCtrl;
794 
795  $ilTabs->addSubTabTarget("cont_settings",
796  $this->ctrl->getLinkTarget($this, "properties"), array("edit", ""),
797  get_class($this));
798 
799  $ilTabs->addSubTabTarget("cont_sc_new_version",
800  $this->ctrl->getLinkTarget($this, "newModuleVersion"), array("edit", ""),
801  get_class($this));
802 
803  include_once "Services/Certificate/classes/class.ilCertificate.php";
805  {
806  // // create and insert object in objecttree
807  // $ilTabs->addSubTabTarget("certificate",
808  // $this->ctrl->getLinkTarget($this, "certificate"),
809  // array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
810  // "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
811  // );
812  $ilTabs->addSubTabTarget(
813  "certificate",
814  $this->ctrl->getLinkTargetByClass("ilcertificategui", "certificateeditor"),
815  "", "ilcertificategui");
816  }
817 
818  $ilTabs->setTabActive('settings');
819  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjSAHSLearningModuleGUI::setTabs ( )

output main frameset of media pool left frame: explorer tree of folders right frame: media pool content

output tabs

Definition at line 592 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET, ilUtil\getImagePath(), and getTabs().

Referenced by executeCommand(), and ilObjSCORM2004LearningModuleGUI\executeCommand().

593  {
594  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
595  $this->tpl->setTitle($this->object->getTitle());
596  if(strtolower($_GET["baseClass"]) == "ilsahseditgui") $this->getTabs($this->tabs_gui);
597  }
$_GET["client_id"]
getTabs(&$tabs_gui)
adds tabs to tab gui object
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:

◆ upload()

ilObjSAHSLearningModuleGUI::upload ( )

Definition at line 513 of file class.ilObjSAHSLearningModuleGUI.php.

References uploadObject().

514  {
515  $this->uploadObject();
516  }
uploadObject()
display status information or report errors messages in case of error
+ Here is the call graph for this function:

◆ uploadObject()

ilObjSAHSLearningModuleGUI::uploadObject ( )

display status information or report errors messages in case of error

public

Definition at line 366 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET, $_POST, $file, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilObject\_writeTitle(), ilUtil\moveUploadedFile(), ilUtil\redirect(), ilUtil\renameExecutables(), ilUtil\sendInfo(), and ilUtil\unzip().

Referenced by upload().

367  {
368  global $_FILES, $rbacsystem;
369 
370  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
371 
372  // check create permission
373  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs"))
374  {
375  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
376  }
377  elseif ($_FILES["scormfile"]["name"])
378  {
379  // check if file was uploaded
380  $source = $_FILES["scormfile"]["tmp_name"];
381  if (($source == 'none') || (!$source))
382  {
383  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
384  }
385  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
386  switch ($__FILES["scormfile"]["error"])
387  {
388  case UPLOAD_ERR_INI_SIZE:
389  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
390  break;
391 
392  case UPLOAD_ERR_FORM_SIZE:
393  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
394  break;
395 
396  case UPLOAD_ERR_PARTIAL:
397  $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
398  break;
399 
400  case UPLOAD_ERR_NO_FILE:
401  $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
402  break;
403  }
404 
405  $file = pathinfo($_FILES["scormfile"]["name"]);
406  }
407  elseif ($_POST["uploaded_file"])
408  {
409  // check if the file is in the upload directory and readable
410  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
411  {
412  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
413  }
414 
415  $file = pathinfo($_POST["uploaded_file"]);
416  }
417  else
418  {
419  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
420  }
421 
422  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
423  if ($name == "")
424  {
425  $name = $this->lng->txt("no_title");
426  }
427 
428  // create and insert object in objecttree
429  switch ($_POST["sub_type"])
430  {
431 
432  case "scorm2004":
433  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
434  $newObj = new ilObjSCORM2004LearningModule();
435  $newObj->setEditable($_POST["editable"]=='y');
436  $newObj->setImportSequencing($_POST["import_sequencing"]);
437  $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
438  break;
439 
440  case "scorm":
441  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
442  $newObj = new ilObjSCORMLearningModule();
443  break;
444 
445  case "aicc":
446  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
447  $newObj = new ilObjAICCLearningModule();
448  break;
449 
450  case "hacp":
451  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
452  $newObj = new ilObjHACPLearningModule();
453  break;
454  }
455 
456  $newObj->setTitle($name);
457  $newObj->setSubType($_POST["sub_type"]);
458  $newObj->setDescription("");
459  $newObj->create(true);
460  $newObj->createReference();
461  $newObj->putInTree($_GET["ref_id"]);
462  $newObj->setPermissions($_GET["ref_id"]);
463  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
464 
465  // create data directory, copy file to directory
466  $newObj->createDataDirectory();
467 
468  if ($_FILES["scormfile"]["name"])
469  {
470  // copy uploaded file to data directory
471  $file_path = $newObj->getDataDirectory()."/".$_FILES["scormfile"]["name"];
472 
473  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],
474  $_FILES["scormfile"]["name"], $file_path);
475  }
476  else
477  {
478  // copy uploaded file to data directory
479  $file_path = $newObj->getDataDirectory()."/". $_POST["uploaded_file"];
480 
481  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
482  }
483 
484  ilUtil::unzip($file_path);
485  ilUtil::renameExecutables($newObj->getDataDirectory());
486 
487  $title = $newObj->readObject();
488  if ($title != "")
489  {
490  ilObject::_writeTitle($newObj->getId(), $title);
491  /*$md = new ilMD($newObj->getId(),0, $newObj->getType());
492  if(is_object($md_gen = $md->getGeneral()))
493  {
494  $md_gen->setTitle($title);
495  $md_gen->update();
496  }*/
497  }
498 
499  //auto set learning progress settings
500  switch ($_POST["sub_type"])
501  {
502  case "scorm2004":
503  case "scorm":
504  $newObj->setLearningProgressSettingsAtUpload();
505  break;
506  }
507 
508 
509  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
510  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
511  }
_writeTitle($a_obj_id, $a_title)
write title to db (static)
print $file
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
Class ilObjAICCLearningModule.
Class ilObjAICCLearningModule.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
redirection script todo: (a better solution should control the processing via a xml file) ...
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
Class ilObjSCORM2004LearningModule.
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
static redirect($a_script)
http redirect to other script
static _copyUploadFile($a_file, $a_target, $a_raise_errors=true)
copy an uploaded file to the target directory (including virus check)
Class ilObjSCORMLearningModule.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewObject()

ilObjSAHSLearningModuleGUI::viewObject ( )

Definition at line 203 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET.

204  {
205  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
206  {
207  parent::viewObject();
208  }
209  else
210  {
211  }
212  }
$_GET["client_id"]

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