ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 _goto ($a_target)
 goto target course More...
 
 addLocatorItems ()
 
 editContent ()
 List files. 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...
 
 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...
 

Additional Inherited Members

- 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...
 
- 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...
 
 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)
 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...
 

Detailed Description

Member Function Documentation

◆ _goto()

ilObjSAHSLearningModuleGUI::_goto (   $a_target)

goto target course

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

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

720  {
721  global $ilAccess, $ilErr, $lng;
722 
723  $parts = explode("_", $a_target);
724 
725  if ($ilAccess->checkAccess("write", "", $parts[0]))
726  {
727  $_GET["cmd"] = "";
728  $_GET["baseClass"] = "ilSAHSEditGUI";
729  $_GET["ref_id"] = $parts[0];
730  $_GET["obj_id"] = $parts[1];
731  include("ilias.php");
732  exit;
733  }
734  if ($ilAccess->checkAccess("visible", "", $parts[0]))
735  {
736  $_GET["cmd"] = "infoScreen";
737  $_GET["baseClass"] = "ilSAHSPresentationGUI";
738  $_GET["ref_id"] = $parts[0];
739  include("ilias.php");
740  exit;
741  }
742  else
743  {
744  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
745  {
746  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
749  }
750  }
751 
752  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
753  }
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 755 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET.

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

◆ certificate()

ilObjSAHSLearningModuleGUI::certificate ( )

Shows the certificate editor.

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

591  {
592  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
593  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
594  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
595  $output_gui->certificateEditor();
596  }
GUI class to create PDF certificates.

◆ editContent()

ilObjSAHSLearningModuleGUI::editContent ( )

List files.

Parameters

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

References $ilCtrl.

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

◆ executeCommand()

& ilObjSAHSLearningModuleGUI::executeCommand ( )

execute command

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

References $_GET, $cmd, $ilErr, $ret, ilMDEditorGUI\addObserver(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getTemplate(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\omitLocator(), ilObjectGUI\prepareOutput(), ilObjectGUI\setLocator(), ilFileSystemGUI\setTableId(), and setTabs().

38  {
39  global $ilAccess, $ilTabs, $ilErr;
40 
41  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
42  $this->getCreationMode() == true)
43  {
44  $this->prepareOutput();
45  }
46  else
47  {
48  $this->getTemplate();
49  $this->setLocator();
50  $this->setTabs();
51  }
52 
53  $next_class = $this->ctrl->getNextClass($this);
54  $cmd = $this->ctrl->getCmd();
55 
56  switch($next_class)
57  {
58  case 'ilmdeditorgui':
59  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
60  {
61  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
62  }
63 
64  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
65 
66  $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
67  $md_gui->addObserver($this->object,'MDUpdateListener','General');
68 
69  $this->ctrl->forwardCommand($md_gui);
70  break;
71 
72  case 'ilpermissiongui':
73  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
74  $perm_gui =& new ilPermissionGUI($this);
75  $ret =& $this->ctrl->forwardCommand($perm_gui);
76  break;
77 
78  case "ilfilesystemgui":
79  $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
80  $this->fs_gui->setTableId("sahsfs".$this->object->getId());
81  $ret =& $this->ctrl->forwardCommand($this->fs_gui);
82  break;
83 
84  case "ilcertificategui":
85  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
86  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
87  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
88  $ret =& $this->ctrl->forwardCommand($output_gui);
89  break;
90 
91  case "illearningprogressgui":
92  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
93 
94  $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY,$this->object->getRefId());
95  $this->ctrl->forwardCommand($new_gui);
96 
97  break;
98 
99  case 'illicensegui':
100  include_once("./Services/License/classes/class.ilLicenseGUI.php");
101  $license_gui =& new ilLicenseGUI($this);
102  $ret =& $this->ctrl->forwardCommand($license_gui);
103  break;
104 
105  case "ilinfoscreengui":
106  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
107 
108  $info = new ilInfoScreenGUI($this);
109  $info->enablePrivateNotes();
110  $info->enableLearningProgress();
111 
112  // add read / back button
113  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
114  {
115  if (!$this->object->getEditable())
116  {
117  $info->addButton($this->lng->txt("view"),
118  "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
119  ' target="ilContObj'.$this->object->getId().'" ');
120  }
121  }
122 
123  $info->enableNews();
124  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
125  {
126  $info->enableNewsEditing();
127  $news_set = new ilSetting("news");
128  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
129  if ($enable_internal_rss)
130  {
131  $info->setBlockProperty("news", "settings", true);
132  }
133  }
134  // show standard meta data section
135  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
136 
137  // forward the command
138  $this->ctrl->forwardCommand($info);
139  break;
140 
141  case "ilcommonactiondispatchergui":
142  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
144  $this->ctrl->forwardCommand($gui);
145  break;
146 
147  case "ilobjstylesheetgui":
148  //$this->addLocations();
149  $this->ctrl->setReturn($this, "properties");
150  $ilTabs->clearTargets();
151  $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
152  $style_gui->omitLocator();
153  if ($cmd == "create" || $_GET["new_type"]=="sty")
154  {
155  $style_gui->setCreationMode(true);
156  }
157  //$ret =& $style_gui->executeCommand();
158 
159  if ($cmd == "confirmedDelete")
160  {
161  $this->object->setStyleSheetId(0);
162  $this->object->update();
163  }
164  $ret =& $this->ctrl->forwardCommand($style_gui);
165  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
166  {
167  $style_id = $ret;
168  $this->object->setStyleSheetId($style_id);
169  $this->object->update();
170  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
171  }
172  break;
173  default:
174  if ($this->object && !$this->object->getEditable())
175  {
176  $cmd = $this->ctrl->getCmd("properties");
177  }
178  else
179  {
180  $cmd = $this->ctrl->getCmd("frameset");
181  }
182  if ((strtolower($_GET["baseClass"]) == "iladministrationgui" ||
183  $this->getCreationMode() == true) &&
184  $cmd != "frameset")
185  {
186  $cmd.= "Object";
187  }
188 
189  // #9225
190  if($cmd == "redrawHeaderAction")
191  {
192  $cmd .= "Object";
193  }
194 
195  $ret =& $this->$cmd();
196  break;
197  }
198  }
ILIAS Setting Class.
Class ilInfoScreenGUI.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
addObserver(&$a_class, $a_method, $a_element)
getTemplate()
output main header (title and locator)
setTableId($a_val)
Set table id.
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 603 of file class.ilObjSAHSLearningModuleGUI.php.

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

Referenced by setTabs().

604  {
605  global $rbacsystem, $ilUser, $ilCtrl, $ilHelp;
606 
607  if ($this->ctrl->getCmd() == "delete")
608  {
609  return;
610  }
611 
612  switch ($this->object->getSubType())
613  {
614  case "scorm2004":
615  $ilHelp->setScreenIdComponent("sahs13");
616  break;
617 
618  case "scorm":
619  $ilHelp->setScreenIdComponent("sahs12");
620  break;
621  }
622 
623  // file system gui tabs
624  // properties
625  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
626  $tabs_gui->addTarget("cont_list_files",
627  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "",
628  "ilfilesystemgui");
629  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
630 
631  // info screen
632  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui")
633  ? true
634  : false;
635  $tabs_gui->addTarget("info_short",
636  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
637  "ilinfoscreengui", "", $force_active);
638 
639  // properties
640  $tabs_gui->addTarget("settings",
641  $this->ctrl->getLinkTarget($this, "properties"), array("", "properties"),
642  get_class($this));
643 
644  // learning progress and ofline mode
645  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
646  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
647  {
648  //if scorm && offline_mode activated
649  if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
650  if ($this->object->getOfflineMode() == true) {
651  $tabs_gui->addTarget("offline_mode_manager",
652  $this->ctrl->getLinkTarget($this, "offlineModeManager"),
653  "offlineModeManager",
654  "ilobjscormlearningmodulegui");
655  }
656  }
657 
658  $tabs_gui->addTarget('learning_progress',
659  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''),
660  '',
661  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
662  }
663 
664  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
665  $privacy = ilPrivacySettings::_getInstance();
666  if($privacy->enabledSahsProtocolData())
667  {
668  // tracking data
669  $tabs_gui->addTarget("cont_tracking_data",
670  $this->ctrl->getLinkTarget($this, "showTrackingItems"), "showTrackingItems",
671  get_class($this));
672  }
673 
674  // certificate subtab
675  include_once "Services/Certificate/classes/class.ilCertificate.php";
677  {
678  // create and insert object in objecttree
679  switch ($this->object->getSubType())
680  {
681 
682  case "scorm2004":
683  case "scorm":
684  // certificate
685  $tabs_gui->addTarget("certificate",
686  $this->ctrl->getLinkTarget($this, "certificate"),
687  array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
688  "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
689  );
690  break;
691  }
692  }
693 
694  include_once("Services/License/classes/class.ilLicenseAccess.php");
695  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId())
697  {
698  $tabs_gui->addTarget("license",
699  $this->ctrl->getLinkTargetByClass('illicensegui', ''),
700  "", "illicensegui");
701  }
702 
703  // edit meta
704  $tabs_gui->addTarget("meta_data",
705  $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
706  "", "ilmdeditorgui");
707 
708  // perm
709  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
710  {
711  $tabs_gui->addTarget("perm_settings",
712  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
713  }
714  }
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 555 of file class.ilObjSAHSLearningModuleGUI.php.

References ilObjectGUI\$lng.

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

556  {
557  global $lng;
558 
559  $this->tpl->getStandardTemplate();
560  }
+ 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 539 of file class.ilObjSAHSLearningModuleGUI.php.

540  {
541  $this->infoObject();
542  }

◆ initCreationForm()

ilObjSAHSLearningModuleGUI::initCreationForm ( )

Init form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by initCreationForms().

252  {
253  global $lng, $ilCtrl;
254 
255  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
256  $this->form = new ilPropertyFormGUI();
257 
258  // title
259  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
260  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
261  $ti->setMaxLength(ilObject::TITLE_LENGTH);
262  $ti->setRequired(true);
263  $this->form->addItem($ti);
264 
265  // text area
266  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
267  $ta->setCols(40);
268  $ta->setRows(2);
269  $this->form->addItem($ta);
270 
271 
272  $this->form->addCommandButton("save", $lng->txt("create"));
273  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
274 
275  $this->form->setTitle($lng->txt("scorm_new"));
276  $this->form->setFormAction($ilCtrl->getFormAction($this));
277  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
278  }
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 233 of file class.ilObjSAHSLearningModuleGUI.php.

References initCreationForm(), and initUploadForm().

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

◆ initUploadForm()

ilObjSAHSLearningModuleGUI::initUploadForm ( )

Init upload form.

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

284  {
285  global $lng, $ilCtrl;
286 
287  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
288  $this->form = new ilPropertyFormGUI();
289 
290  // type selection
291  $options = array(
292  "scorm2004" => $lng->txt("lm_type_scorm2004"),
293  "scorm" => $lng->txt("lm_type_scorm"),
294  "aicc" => $lng->txt("lm_type_aicc"),
295  "hacp" => $lng->txt("lm_type_hacp")
296  );
297  $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
298  $si->setOptions($options);
299  $this->form->addItem($si);
300 
301  // input file
302  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
303  $fi->setRequired(true);
304  $this->form->addItem($fi);
305 
306  // todo "uploaded file"
307  // todo wysiwyg editor removement
308 
309  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
311  {
312  $options = array();
313  $fi->setRequired(false);
315  $options[""] = $this->lng->txt("cont_select_from_upload_dir");
316  foreach($files as $file)
317  {
318  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
319  $options[$file] = $file;
320  }
321  //
322  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
323  $si->setOptions($options);
324  $this->form->addItem($si);
325  }
326 
327 
328  // validate file
329  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
330  $cb->setValue("y");
331  //$cb->setChecked(true);
332  $this->form->addItem($cb);
333 
334  // import for editing
335  $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
336  $cb->setValue("y");
337  $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
338  $this->form->addItem($cb);
339 
340  //
341  $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
342  $radg->setValue(0);
343  $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0,$lng->txt("sahs_std_sequencing_info"));
344  $radg->addOption($op1);
345  $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1,$lng->txt("sahs_import_sequencing_info"));
346  $radg->addOption($op1);
347  $cb->addSubItem($radg);
348 
349 
350  $this->form->addCommandButton("upload", $lng->txt("import"));
351  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
352 
353  $this->form->setTitle($lng->txt("import_sahs"));
354  $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
355  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
356  }
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 547 of file class.ilObjSAHSLearningModuleGUI.php.

548  {
549  $this->ownerObject();
550  }

◆ properties()

ilObjSAHSLearningModuleGUI::properties ( )

module properties

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

216  {
217  }

◆ saveObject()

ilObjSAHSLearningModuleGUI::saveObject ( )

save new learning module to db

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

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

512  {
513  if (trim($_POST["title"]) == "")
514  {
515  $this->ilias->raiseError($this->lng->txt("msg_no_title"),$this->ilias->error_obj->MESSAGE);
516  }
517 
518  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
519  $newObj = new ilObjSCORM2004LearningModule();
520  $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
521  $newObj->setSubType("scorm2004");
522  $newObj->setEditable(true);
523  $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
524  $newObj->create();
525  $newObj->createReference();
526  $newObj->putInTree($_GET["ref_id"]);
527  $newObj->setPermissions($_GET["ref_id"]);
528  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
529  $newObj->createDataDirectory();
530  $newObj->createScorm2004Tree();
531  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
532  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
533  }
$_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 222 of file class.ilObjSAHSLearningModuleGUI.php.

223  {
224  }

◆ 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 580 of file class.ilObjSAHSLearningModuleGUI.php.

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

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

581  {
582  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm_b.png"));
583  $this->tpl->setTitle($this->object->getTitle());
584  $this->getTabs($this->tabs_gui);
585  }
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 501 of file class.ilObjSAHSLearningModuleGUI.php.

References uploadObject().

502  {
503  $this->uploadObject();
504  }
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 364 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().

365  {
366  global $_FILES, $rbacsystem;
367 
368  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
369 
370  // check create permission
371  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs"))
372  {
373  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
374  }
375  elseif ($_FILES["scormfile"]["name"])
376  {
377  // check if file was uploaded
378  $source = $_FILES["scormfile"]["tmp_name"];
379  if (($source == 'none') || (!$source))
380  {
381  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
382  }
383  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
384  switch ($__FILES["scormfile"]["error"])
385  {
386  case UPLOAD_ERR_INI_SIZE:
387  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
388  break;
389 
390  case UPLOAD_ERR_FORM_SIZE:
391  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
392  break;
393 
394  case UPLOAD_ERR_PARTIAL:
395  $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
396  break;
397 
398  case UPLOAD_ERR_NO_FILE:
399  $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
400  break;
401  }
402 
403  $file = pathinfo($_FILES["scormfile"]["name"]);
404  }
405  elseif ($_POST["uploaded_file"])
406  {
407  // check if the file is in the upload directory and readable
408  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
409  {
410  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
411  }
412 
413  $file = pathinfo($_POST["uploaded_file"]);
414  }
415  else
416  {
417  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
418  }
419 
420  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
421  if ($name == "")
422  {
423  $name = $this->lng->txt("no_title");
424  }
425 
426  // create and insert object in objecttree
427  switch ($_POST["sub_type"])
428  {
429 
430  case "scorm2004":
431  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
432  $newObj = new ilObjSCORM2004LearningModule();
433  $newObj->setEditable($_POST["editable"]=='y');
434  $newObj->setImportSequencing($_POST["import_sequencing"]);
435  $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
436  break;
437 
438  case "scorm":
439  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
440  $newObj = new ilObjSCORMLearningModule();
441  break;
442 
443  case "aicc":
444  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
445  $newObj = new ilObjAICCLearningModule();
446  break;
447 
448  case "hacp":
449  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
450  $newObj = new ilObjHACPLearningModule();
451  break;
452  }
453 
454  $newObj->setTitle($name);
455  $newObj->setSubType($_POST["sub_type"]);
456  $newObj->setDescription("");
457  $newObj->create(true);
458  $newObj->createReference();
459  $newObj->putInTree($_GET["ref_id"]);
460  $newObj->setPermissions($_GET["ref_id"]);
461  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
462 
463  // create data directory, copy file to directory
464  $newObj->createDataDirectory();
465 
466  if ($_FILES["scormfile"]["name"])
467  {
468  // copy uploaded file to data directory
469  $file_path = $newObj->getDataDirectory()."/".$_FILES["scormfile"]["name"];
470 
471  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],
472  $_FILES["scormfile"]["name"], $file_path);
473  }
474  else
475  {
476  // copy uploaded file to data directory
477  $file_path = $newObj->getDataDirectory()."/". $_POST["uploaded_file"];
478 
479  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
480  }
481 
482  ilUtil::unzip($file_path);
483  ilUtil::renameExecutables($newObj->getDataDirectory());
484 
485  $title = $newObj->readObject();
486  if ($title != "")
487  {
488  ilObject::_writeTitle($newObj->getId(), $title);
489  /*$md = new ilMD($newObj->getId(),0, $newObj->getType());
490  if(is_object($md_gen = $md->getGeneral()))
491  {
492  $md_gen->setTitle($title);
493  $md_gen->update();
494  }*/
495  }
496 
497  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
498  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
499  }
_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 201 of file class.ilObjSAHSLearningModuleGUI.php.

References $_GET.

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

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