ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjSCORMLearningModuleGUI Class Reference

Class ilObjSCORMLearningModuleGUI. More...

+ Inheritance diagram for ilObjSCORMLearningModuleGUI:
+ Collaboration diagram for ilObjSCORMLearningModuleGUI:

Public Member Functions

 ilObjSCORMLearningModuleGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
 assignObject ()
 assign scorm object to scorm gui object More...
 
 properties ()
 scorm module properties More...
 
 newModuleVersion ()
 upload new version of module More...
 
 getMaxFileSize ()
 
 newModuleVersionUpload ()
 
 saveProperties ()
 save properties More...
 
 deleteTrackingForUser ()
 display deletion confirmation screen More...
 
 cancelDelete ()
 cancel deletion of export files More...
 
 confirmedDelete ()
 
 cancel ()
 overwrite..jump back to trackingdata not parent More...
 
 decreaseAttempts ()
 
 setSubTabs ()
 
 cancelStopUserOfflineMode ()
 
 confirmedStopUserOfflineMode ()
 
- Public Member Functions inherited from ilObjSAHSLearningModuleGUI
 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...
 

Data Fields

const EXPORT_UNDEF = 0
 
const EXPORT_ALL = 1
 
const EXPORT_SELECTED = 2
 
const EXPORT_TYPE_RAW = 1
 
const EXPORT_TYPE_SUCCESS = 2
 
- 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

 showTrackingItemsBySco ()
 show tracking data More...
 
 showTrackingItems ()
 Show tracking table ilTabs $ilTabs $global ilToolbar $ilToolbar. More...
 
 applyUserTableFilter ()
 Apply table filter. More...
 
 resetUserTableFilter ()
 Reset table filter. More...
 
 import ()
 gui functions for GUI export More...
 
 importForm ()
 Show import form. More...
 
 initImportForm ()
 Init import form. More...
 
 exportSelectionAll ()
 Show export section for all users. More...
 
 exportSelectionUsers ()
 Export selection for selected users. More...
 
 exportSelection ($a_type)
 Show export selection. More...
 
 initExportForm ($a_type)
 Init export form. More...
 
 export ()
 Do export. More...
 
 showTrackingItem ()
 show tracking data of item More...
 
 showTrackingItemSco ()
 show tracking data of item More...
 
 showTrackingItemPerUser ()
 show tracking data of item per user More...
 
 offlineModeManager ()
 Manage offline mode for users ilTabs $ilTabs $global ilToolbar $ilToolbar. More...
 
 stopUserOfflineMode ()
 Stop offline mode for selected users. More...
 
- 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...
 

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

Detailed Description

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected

Apply table filter.

Definition at line 593 of file class.ilObjSCORMLearningModuleGUI.php.

References showTrackingItems(), and ilTable2GUI\writeFilterToSession().

594  {
595  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
596  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'showtrackingItems');
597  $tbl->writeFilterToSession();
598  $tbl->resetOffset();
599  $this->showTrackingItems();
600  }
showTrackingItems()
Show tracking table ilTabs $ilTabs $global ilToolbar $ilToolbar.
writeFilterToSession()
Write filter values to session.
+ Here is the call graph for this function:

◆ assignObject()

ilObjSCORMLearningModuleGUI::assignObject ( )

assign scorm object to scorm gui object

Definition at line 54 of file class.ilObjSCORMLearningModuleGUI.php.

55  {
56  if ($this->id != 0)
57  {
58  if ($this->call_by_reference)
59  {
60  $this->object =& new ilObjSCORMLearningModule($this->id, true);
61  }
62  else
63  {
64  $this->object =& new ilObjSCORMLearningModule($this->id, false);
65  }
66  }
67  }
Class ilObjSCORMLearningModule.

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

Definition at line 690 of file class.ilObjSCORMLearningModuleGUI.php.

References ilUtil\sendInfo().

691  {
692  ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
693  $this->ctrl->redirect($this, "properties");
694  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ cancelDelete()

ilObjSCORMLearningModuleGUI::cancelDelete ( )

cancel deletion of export files

Definition at line 653 of file class.ilObjSCORMLearningModuleGUI.php.

References ilUtil\sendInfo().

654  {
655  ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
656  $this->ctrl->redirect($this, "showTrackingItems");
657  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ cancelStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::cancelStopUserOfflineMode ( )

Definition at line 1045 of file class.ilObjSCORMLearningModuleGUI.php.

References ilUtil\sendInfo().

1046  {
1047  ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
1048  $this->ctrl->redirect($this, "offlineModeManager");
1049  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ confirmedDelete()

ilObjSCORMLearningModuleGUI::confirmedDelete ( )

Definition at line 659 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, and ilLPStatusWrapper\_updateStatus().

660  {
661  global $ilDB;
662 
663  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
664 
665  foreach($_POST["user"] as $user)
666  {
667  $ilDB->manipulateF('
668  DELETE FROM scorm_tracking
669  WHERE user_id = %s
670  AND obj_id = %s',
671  array('integer', 'integer'),
672  array($user, $this->object->getID()));
673 
674  $ilDB->manipulateF('
675  DELETE FROM sahs_user
676  WHERE user_id = %s
677  AND obj_id = %s',
678  array('integer', 'integer'),
679  array($user, $this->object->getID()));
680 
681  ilLPStatusWrapper::_updateStatus($this->object->getId(), $user);
682  }
683 
684  $this->ctrl->redirect($this, "showTrackingItems");
685  }
$_POST['username']
Definition: cron.php:12
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
+ Here is the call graph for this function:

◆ confirmedStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::confirmedStopUserOfflineMode ( )

Definition at line 1051 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, offlineModeManager(), and ilSCORMOfflineMode\stopOfflineModeForUser().

1052  {
1053 
1054  include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php';
1055  foreach($_POST["user"] as $id)
1056  {
1057  ilSCORMOfflineMode::stopOfflineModeForUser($this->object->getId(),$id);
1058  }
1059 
1060  $this->offlineModeManager();
1061  }
$_POST['username']
Definition: cron.php:12
offlineModeManager()
Manage offline mode for users ilTabs $ilTabs $global ilToolbar $ilToolbar.
stopOfflineModeForUser($obj_id, $user_id)
+ Here is the call graph for this function:

◆ decreaseAttempts()

ilObjSCORMLearningModuleGUI::decreaseAttempts ( )

Definition at line 875 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, $ilUser, ilLPStatusWrapper\_updateStatus(), and ilUtil\sendInfo().

876  {
877  global $ilDB, $ilUser;
878  if (!isset($_POST["user"]))
879  {
880  ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
881  }
882 
883  foreach ($_POST["user"] as $user)
884  {
885  //first check if there is a package_attempts entry
886  $val_set = $ilDB->queryF('SELECT package_attempts FROM sahs_user WHERE user_id = %s AND obj_id = %s',
887  array('integer','integer'),
888  array($user,$this->object->getID()));
889 
890  $val_rec = $ilDB->fetchAssoc($val_set);
891 
892  if ($val_rec["package_attempts"] != null && $val_rec["package_attempts"] != 0)
893  {
894  $new_rec = 0;
895  //decrease attempt by 1
896  if ((int)$val_rec["package_attempts"] > 0) $new_rec = (int)$val_rec["package_attempts"]-1;
897  $ilDB->manipulateF('UPDATE sahs_user SET package_attempts = %s WHERE user_id = %s AND obj_id = %s',
898  array('integer','integer','integer'),
899  array($new_rec,$user,$this->object->getID()));
900 
901  //following 2 lines were before 4.4 only for SCORM 1.2
902  include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
903  ilLPStatusWrapper::_updateStatus($this->object->getId(), $user);
904  }
905  }
906 
907  //$this->ctrl->saveParameter($this, "cdir");
908  $this->ctrl->redirect($this, "showTrackingItems");
909  }
$_POST['username']
Definition: cron.php:12
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

Definition at line 617 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, ilObject\_exists(), and ilUtil\getImageTagByType().

618  {
619  if(!isset($_POST["user"]))
620  {
621  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
622  }
623 
624  // display confirmation message
625  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
626  $cgui = new ilConfirmationGUI();
627  $cgui->setFormAction($this->ctrl->getFormAction($this));
628  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
629  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
630  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
631 
632  foreach($_POST["user"] as $id)
633  {
634  if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
635  {
636  $user = new ilObjUser($id);
637 
638  $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath).
639  " ".$this->lng->txt("cont_tracking_data").
640  ": ".$user->getLastname().", ".$user->getFirstname();
641 
642 
643  $cgui->addItem("user[]", $id, $caption);
644  }
645  }
646 
647  $this->tpl->setContent($cgui->getHTML());
648  }
$_POST['username']
Definition: cron.php:12
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
redirection script todo: (a better solution should control the processing via a xml file) ...
Confirmation screen class.
+ Here is the call graph for this function:

◆ export()

ilObjSCORMLearningModuleGUI::export ( )
protected

Do export.

Definition at line 841 of file class.ilObjSCORMLearningModuleGUI.php.

References initExportForm(), and ilUtil\sendFailure().

842  {
843  $form = $this->initExportForm(self::EXPORT_UNDEF);
844  if($form->checkInput())
845  {
846  if($form->getInput('type') == self::EXPORT_TYPE_RAW)
847  {
848  if($form->getInput('etype') == self::EXPORT_ALL)
849  {
850  return $this->object->exportSelectedRaw(true);
851  }
852  else
853  {
854  $users = (array) unserialize(html_entity_decode($form->getInput('users')));
855  return $this->object->exportSelectedRaw(false,$users);
856  }
857  }
858  else
859  {
860  if($form->getInput('etype') == self::EXPORT_ALL)
861  {
862  return $this->object->exportSelected(true);
863  }
864  else
865  {
866  $users = (array) unserialize(html_entity_decode($form->getInput('users')));
867  return $this->object->exportSelected(false,$users);
868  }
869  }
870  }
871  ilUtil::sendFailure($this->lng->txt('err_check_input'));
872  $this->ctrl->redirect($this,'showTrackingItems');
873  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ exportSelection()

ilObjSCORMLearningModuleGUI::exportSelection (   $a_type)
protected

Show export selection.

Parameters
int$a_type

Definition at line 783 of file class.ilObjSCORMLearningModuleGUI.php.

References initExportForm().

Referenced by exportSelectionAll(), and exportSelectionUsers().

784  {
785  global $ilTabs;
786 
787  $ilTabs->clearTargets();
788  $ilTabs->setBackTarget(
789  $this->lng->txt('back'),
790  $this->ctrl->getLinkTarget($this,'showTrackingItems')
791  );
792 
793  $form = $this->initExportForm($a_type);
794  $this->tpl->setContent($form->getHTML());
795  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportSelectionAll()

ilObjSCORMLearningModuleGUI::exportSelectionAll ( )
protected

Show export section for all users.

Definition at line 760 of file class.ilObjSCORMLearningModuleGUI.php.

References exportSelection().

761  {
762  $this->exportSelection(self::EXPORT_ALL);
763  }
exportSelection($a_type)
Show export selection.
+ Here is the call graph for this function:

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

Definition at line 768 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, exportSelection(), and ilUtil\sendFailure().

769  {
770  if(!count((array) $_POST['user']))
771  {
772  ilUtil::sendFailure($this->lng->txt('select_one'),true);
773  $this->ctrl->redirect($this,'showTrackingItems');
774  }
775 
776  $this->exportSelection(self::EXPORT_SELECTED);
777  }
$_POST['username']
Definition: cron.php:12
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exportSelection($a_type)
Show export selection.
+ Here is the call graph for this function:

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

Definition at line 349 of file class.ilObjSCORMLearningModuleGUI.php.

Referenced by newModuleVersion().

350  {
351  // get the value for the maximal uploadable filesize from the php.ini (if available)
352  $umf=get_cfg_var("upload_max_filesize");
353  // get the value for the maximal post data from the php.ini (if available)
354  $pms=get_cfg_var("post_max_size");
355 
356  //convert from short-string representation to "real" bytes
357  $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
358 
359  $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
360  $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
361 
362  if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
363  if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
364 
365  // use the smaller one as limit
366  $max_filesize=min($umf, $pms);
367 
368  if (!$max_filesize) $max_filesize=max($umf, $pms);
369 
370  //format for display in mega-bytes
371  return $max_filesize=sprintf("%.1f MB",$max_filesize/1024/1024);
372  }
+ Here is the caller graph for this function:

◆ ilObjSCORMLearningModuleGUI()

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

Constructor.

public

Definition at line 40 of file class.ilObjSCORMLearningModuleGUI.php.

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

41  {
42  global $lng;
43 
44  $lng->loadLanguageModule("content");
45  $lng->loadLanguageModule("search");
46 
47  $this->type = "sahs";
48  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
49  }
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:

◆ import()

ilObjSCORMLearningModuleGUI::import ( )
protected

gui functions for GUI export

Definition at line 699 of file class.ilObjSCORMLearningModuleGUI.php.

References importForm(), initImportForm(), and ilUtil\sendInfo().

700  {
701  $form = $this->initImportForm();
702  if($form->checkInput())
703  {
704  $source = $form->getInput('csv');
705  $error = $this->object->importTrackingData($source['tmp_name']);
706  switch($error)
707  {
708  case 0 :
709  ilUtil::sendInfo('Tracking data imported', true);
710  $this->ctrl->redirect($this, "showTrackingItems");
711  break;
712  case -1 :
713  ilUtil::sendInfo($this->lng->txt('err_check_input'));
714  $this->importForm();
715  break;
716  }
717  }
718  ilUtil::sendInfo($this->lng->txt('err_check_input'));
719  $form->setValuesByPost();
720  $this->importForm();
721  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ importForm()

ilObjSCORMLearningModuleGUI::importForm ( )
protected

Show import form.

Definition at line 726 of file class.ilObjSCORMLearningModuleGUI.php.

References initImportForm().

Referenced by import().

727  {
728  global $ilTabs;
729 
730  $ilTabs->clearTargets();
731  $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'showTrackingItems'));
732 
733  $form = $this->initImportForm();
734  $this->tpl->setContent($form->getHTML());
735  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initExportForm()

ilObjSCORMLearningModuleGUI::initExportForm (   $a_type)
protected

Init export form.

Parameters
int$a_type

Definition at line 801 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, and ilFormPropertyGUI\setRequired().

Referenced by export(), and exportSelection().

802  {
803  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
804 
805  $form = new ilPropertyFormGUI();
806  $form->setFormAction($this->ctrl->getFormAction($this,'showTrackingItems'));
807  $form->setTitle($this->lng->txt('cont_export_tracking'));
808  $form->addCommandButton('export', $this->lng->txt('export'));
809  $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
810 
811  $type = new ilRadioGroupInputGUI($this->lng->txt('cont_export_type'), 'type');
812  $type->setRequired(true);
813  $type->setValue(self::EXPORT_TYPE_RAW);
814  $form->addItem($type);
815 
816  $raw = new ilRadioOption($this->lng->txt('cont_export_raw'), self::EXPORT_TYPE_RAW);
817  $type->addOption($raw);
818 
819  $suc = new ilRadioOption($this->lng->txt('cont_export_success'), self::EXPORT_TYPE_SUCCESS);
820  $type->addOption($suc);
821 
822  $etype = new ilHiddenInputGUI('etype');
823  $etype->setValue($a_type);
824  $form->addItem($etype);
825 
826  switch($a_type)
827  {
828  case self::EXPORT_SELECTED:
829  $users = new ilHiddenInputGUI('users');
830  $users->setValue(htmlentities(serialize($_POST['user'])));
831  $form->addItem($users);
832  break;
833  }
834  return $form;
835  }
This class represents an option in a radio group.
$_POST['username']
Definition: cron.php:12
This class represents a property form user interface.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSCORMLearningModuleGUI::initImportForm ( )
protected

Init import form.

Definition at line 740 of file class.ilObjSCORMLearningModuleGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by import(), and importForm().

741  {
742  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
743  $form = new ilPropertyFormGUI();
744  $form->setFormAction($this->ctrl->getFormAction($this));
745  $form->setTitle($this->lng->txt('cont_import_tracking'));
746  $form->addCommandButton('import', $this->lng->txt('import'));
747  $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
748 
749  $csv = new ilFileInputGUI($this->lng->txt('select_file'),'csv');
750  $csv->setRequired(true);
751  $csv->setSuffixes(array('csv'));
752  $form->addItem($csv);
753 
754  return $form;
755  }
This class represents a property form user interface.
This class represents a file property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newModuleVersion()

ilObjSCORMLearningModuleGUI::newModuleVersion ( )

upload new version of module

Definition at line 295 of file class.ilObjSCORMLearningModuleGUI.php.

References $_GET, $file, ilObjectGUI\$obj_id, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilObject\_lookupObjectId(), ilObjSAHSLearningModule\_lookupSubType(), ilUtil\getImagePath(), and getMaxFileSize().

Referenced by newModuleVersionUpload().

296  {
299 
300  // display import form
301  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_new_version_import.html", "Modules/ScormAicc");
302 
303  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_slm.png'));
304  $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
305 
306  $this->ctrl->setParameter($this, "new_type", "sahs");
307  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
308 
309  $this->tpl->setVariable("BTN_NAME", "newModuleVersionUpload");
310  $this->tpl->setVariable("TARGET", ' target="'.
311  ilFrameTargetInfo::_getFrame("MainContent").'" ');
312 
313  $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
314 
315  if ($type == "scorm2004") {
316  $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm2004"));
317  } else {
318  $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm"));
319  }
320 
321  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
323  {
325  foreach($files as $file)
326  {
327  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
328  $this->tpl->setCurrentBlock("option_uploaded_file");
329  $this->tpl->setVariable("UPLOADED_FILENAME", $file);
330  $this->tpl->setVariable("TXT_UPLOADED_FILENAME", $file);
331  $this->tpl->parseCurrentBlock();
332  }
333  $this->tpl->setCurrentBlock("select_uploaded_file");
334  $this->tpl->setVariable("TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt("cont_select_from_upload_dir"));
335  $this->tpl->setVariable("TXT_UPLOADED_FILE", $this->lng->txt("cont_uploaded_file"));
336  $this->tpl->parseCurrentBlock();
337  }
338 
339  $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
340  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
341  $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
342  $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
343 
344  // gives out the limit as a little notice
345  $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." ".$this->getMaxFileSize());
346  }
print $file
$_GET["client_id"]
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
static _lookupObjectId($a_ref_id)
lookup object id
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newModuleVersionUpload()

ilObjSCORMLearningModuleGUI::newModuleVersionUpload ( )

Definition at line 375 of file class.ilObjSCORMLearningModuleGUI.php.

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

376  {
377  global $_FILES, $rbacsystem;
378 
379  $unzip = PATH_TO_UNZIP;
380  $tocheck = "imsmanifest.xml";
381 
382  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
383 
384  // check create permission before because the uploaded file will be copied
385  if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
386  {
387  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
388  }
389  elseif ($_FILES["scormfile"]["name"])
390  {
391  // check if file was uploaded
392  $source = $_FILES["scormfile"]["tmp_name"];
393  if (($source == 'none') || (!$source))
394  {
395  ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
396  $this->newModuleVersion();
397  return;
398  }
399  }
400  elseif ($_POST["uploaded_file"])
401  {
402  // check if the file is in the ftp directory and readable
403  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
404  {
405  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
406  }
407  // copy the uploaded file to the client web dir to analyze the imsmanifest
408  // the copy will be moved to the lm directory or deleted
409  $source = CLIENT_WEB_DIR . "/" . $_POST["uploaded_file"];
410  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $source);
411  $source_is_copy = true;
412  }
413  else
414  {
415  ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
416  $this->newModuleVersion();
417  return;
418  }
419  // fim.
420 
421  //unzip the imsmanifest-file from new uploaded file
422  $pathinfo = pathinfo($source);
423  $dir = $pathinfo["dirname"];
424  $file = $pathinfo["basename"];
425  $cdir = getcwd();
426  chdir($dir);
427 
428  //we need more flexible unzip here than ILIAS standard classes allow
429  $unzipcmd = $unzip." -o ".ilUtil::escapeShellArg($source)." ".$tocheck;
430  exec($unzipcmd);
431  chdir($cdir);
432  $tmp_file = $dir."/".$tocheck.".".$_GET["ref_id"];
433 
434  rename($dir."/".$tocheck,$tmp_file);
435  $new_manifest = file_get_contents($tmp_file);
436 
437  //remove temp file
438  unlink($tmp_file);
439 
440  //get old manifest file
441  $old_manifest = file_get_contents($this->object->getDataDirectory()."/".$tocheck);
442 
443  //reload fixed version of file
444  $check ='/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
445  $replace="xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
446  $reload_manifest = preg_replace($check, $replace, $new_manifest);
447 
448  //do testing for converted versions as well as earlier ILIAS version messed up utf8 conversion
449  if (strcmp($new_manifest,$old_manifest) == 0 || strcmp(utf8_encode($new_manifest),$old_manifest) == 0 ||
450  strcmp ($reload_manifest, $old_manifest) == 0 || strcmp(utf8_encode($reload_manifest),$old_manifest) == 0 ){
451 
452  //get exisiting module version
453  $module_version = $this->object->getModuleVersion();
454 
455  if ($_FILES["scormfile"]["name"])
456  {
457  //build targetdir in lm_data
458  $file_path = $this->object->getDataDirectory()."/".$_FILES["scormfile"]["name"].".".$module_version;
459 
460  //move to data directory and add subfix for versioning
461  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],$_FILES["scormfile"]["name"], $file_path);
462  }
463  else
464  {
465  //build targetdir in lm_data
466  $file_path = $this->object->getDataDirectory()."/".$_POST["uploaded_file"].".".$module_version;
467  // move the already copied file to the lm_data directory
468  rename($source, $file_path);
469  }
470 
471  //unzip and replace old extracted files
472  ilUtil::unzip($file_path, true);
473  ilUtil::renameExecutables($this->object->getDataDirectory()); //(security)
474 
475  //increase module version
476  $this->object->setModuleVersion($module_version+1);
477  $this->object->update();
478 
479  //redirect to properties and display success
480  ilUtil::sendInfo( $this->lng->txt("cont_new_module_added"), true);
481  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$_GET["ref_id"]);
482  exit;
483  }
484  else
485  {
486  if ($source_is_copy)
487  {
488  unlink($source);
489  }
490 
491  ilUtil::sendInfo($this->lng->txt("cont_invalid_new_module"),true);
492  $this->newModuleVersion();
493  }
494  }
print $file
exit
Definition: login.php:54
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
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) ...
newModuleVersion()
upload new version of module
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
static escapeShellArg($a_arg)
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)
+ Here is the call graph for this function:

◆ offlineModeManager()

ilObjSCORMLearningModuleGUI::offlineModeManager ( )
protected

Manage offline mode for users ilTabs $ilTabs $global ilToolbar $ilToolbar.

Definition at line 998 of file class.ilObjSCORMLearningModuleGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilLearningProgressAccess\checkAccess(), and ilSCORMOfflineModeUsersTableGUI\parse().

Referenced by confirmedStopUserOfflineMode().

999  {
1000  global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting;
1001 
1002  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1003  if(!ilLearningProgressAccess::checkAccess($this->object->getRefId()))
1004  {
1005  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
1006  }
1007 
1008  include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineModeUsersTableGUI.php';
1009  $tbl = new ilSCORMOfflineModeUsersTableGUI($this->object->getId(), $this, 'offlineModeManager');
1010  $tbl->parse();
1011  $this->tpl->setContent($tbl->getHTML());
1012 
1013  }
global $ilCtrl
Definition: ilias.php:18
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
redirection script todo: (a better solution should control the processing via a xml file) ...
GUI class ilSCORMOfflineModeUsersTableGUI.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ properties()

ilObjSCORMLearningModuleGUI::properties ( )

scorm module properties

Definition at line 72 of file class.ilObjSCORMLearningModuleGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, $options, $si, ilObjectGUI\$tpl, ilObjectGUI\$tree, ilObjSAHSLearningModule\_lookupSubType(), ilSCORMOfflineMode\checkIfAnyoneIsInOfflineMode(), ilNumberInputGUI\setMaxLength(), ilSelectInputGUI\setOptions(), ilCheckboxInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

73  {
74  global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting;
75 
76  //$this->setSubTabs("settings", "general_settings");
77 
78  $lng->loadLanguageModule("style");
79 
80  // view
81  $ilToolbar->addButton($this->lng->txt("view"),
82  "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
83  "_blank");
84 
85  // upload new version
86  $ilToolbar->addButton($this->lng->txt("cont_sc_new_version"),
87  $this->ctrl->getLinkTarget($this, "newModuleVersion"));
88 
89  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
90  $this->form = new ilPropertyFormGUI();
91  $this->form->setFormAction($ilCtrl->getFormAction($this));
92  $this->form->setTitle($this->lng->txt("cont_lm_properties"));
93 
94  // SCORM-type
95  $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
96  $ne->setValue($this->lng->txt( "lm_type_" . ilObjSAHSLearningModule::_lookupSubType( $this->object->getID() ) ) );
97  $this->form->addItem($ne);
98 
99  // version
100  $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
101  $ne->setValue($this->object->getModuleVersion());
102  $this->form->addItem($ne);
103 
104  // online
105  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
106  $cb->setValue("y");
107  if ($this->object->getOnline())
108  {
109  $cb->setChecked(true);
110  }
111  $this->form->addItem($cb);
112 
113  // offline Mode
114  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_offline_mode_allow"), "cobj_offline_mode");
115  $cb->setValue("y");
116  $cb->setChecked($this->object->getOfflineMode());
117  include_once("./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php");
118  if ($this->object->getOfflineMode()== true && ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode($this->object->getID()) == true) {
119  $cb->setDisabled(true);
120  $cb->setInfo($this->lng->txt("cont_offline_mode_disable_not_allowed_info"));
121  } else {
122  $cb->setInfo($this->lng->txt("cont_offline_mode_allow_info"));
123  }
124  $this->form->addItem($cb);
125 
126  //
127  // presentation
128  //
129  $sh = new ilFormSectionHeaderGUI();
130  $sh->setTitle($this->lng->txt("cont_presentation"));
131  $this->form->addItem($sh);
132 
133  // display mode (open)
134  $options = array(
135  "0" => $this->lng->txt("cont_open_normal"),
136  "1" => $this->lng->txt("cont_open_iframe_max"),
137  "2" => $this->lng->txt("cont_open_iframe_defined"),
138  "5" => $this->lng->txt("cont_open_window_undefined"),
139  "6" => $this->lng->txt("cont_open_window_defined")
140  );
141  $si = new ilSelectInputGUI($this->lng->txt("cont_open"), "open_mode");
142  $si->setOptions($options);
143  $si->setValue($this->object->getOpenMode());
144  $this->form->addItem($si);
145 
146  // width
147  $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width");
148  $ni->setMaxLength(4);
149  $ni->setSize(4);
150  $ni->setValue($this->object->getWidth());
151  $this->form->addItem($ni);
152 
153  // height
154  $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height");
155  $ni->setMaxLength(4);
156  $ni->setSize(4);
157  $ni->setValue($this->object->getHeight());
158  $this->form->addItem($ni);
159 
160  // auto navigation to last visited item
161  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
162  $cb->setValue("y");
163  $cb->setChecked($this->object->getAuto_last_visited());
164  $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
165  $this->form->addItem($cb);
166 
167  // auto continue
168  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
169  $cb->setValue("y");
170  $cb->setChecked($this->object->getAutoContinue());
171  $this->form->addItem($cb);
172 
173  //
174  // scorm options
175  //
176  $sh = new ilFormSectionHeaderGUI();
177  $sh->setTitle($this->lng->txt("cont_scorm_options"));
178  $this->form->addItem($sh);
179 
180  // max attempts
181  $ni = new ilNumberInputGUI($this->lng->txt("cont_sc_max_attempt"), "max_attempt");
182  $ni->setMaxLength(3);
183  $ni->setSize(3);
184  $ni->setValue($this->object->getMaxAttempt());
185  $this->form->addItem($ni);
186 
187  // lesson mode
188  $options = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"),
189  "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
190  $si = new ilSelectInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
191  $si->setOptions($options);
192  $si->setValue($this->object->getDefaultLessonMode());
193  $this->form->addItem($si);
194 
195  // credit mode
196  $options = array("credit" => $this->lng->txt("cont_credit_on"),
197  "no_credit" => $this->lng->txt("cont_credit_off"));
198  $si = new ilSelectInputGUI($this->lng->txt("cont_credit_mode"), "credit_mode");
199  $si->setOptions($options);
200  $si->setValue($this->object->getCreditMode());
201  $si->setInfo($this->lng->txt("cont_credit_mode_info"));
202  $this->form->addItem($si);
203 
204  // set lesson mode review when completed
205  $options = array(
206  "n" => $this->lng->txt("cont_sc_auto_review_no"),
207 // "r" => $this->lng->txt("cont_sc_auto_review_completed_not_failed_or_passed"),
208 // "p" => $this->lng->txt("cont_sc_auto_review_passed"),
209 // "q" => $this->lng->txt("cont_sc_auto_review_passed_or_failed"),
210 // "c" => $this->lng->txt("cont_sc_auto_review_completed"),
211 // "d" => $this->lng->txt("cont_sc_auto_review_completed_and_passed"),
212  "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"),
213  );
214  $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
215  $si->setOptions($options);
216  $si->setValue($this->object->getAutoReviewChar());
217  $si->setInfo($this->lng->txt("cont_sc_auto_review_info_12"));
218  $this->form->addItem($si);
219 
220  //
221  // rte settings
222  //
223  $sh = new ilFormSectionHeaderGUI();
224  $sh->setTitle($this->lng->txt("cont_rte_settings"));
225  $this->form->addItem($sh);
226 
227  // unlimited session timeout
228  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
229  $cb->setValue("y");
230  $cb->setChecked($this->object->getSession());
231  $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
232  $this->form->addItem($cb);
233 
234  // storage of interactions
235  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
236  $cb->setValue("y");
237  $cb->setChecked($this->object->getInteractions());
238  $this->form->addItem($cb);
239 
240  // objectives
241  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
242  $cb->setValue("y");
243  $cb->setChecked($this->object->getObjectives());
244  $this->form->addItem($cb);
245 
246  // time from lms
247  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
248  $cb->setValue("y");
249  $cb->setChecked($this->object->getTime_from_lms());
250  $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
251  $this->form->addItem($cb);
252 
253  // check values
254  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
255  $cb->setValue("y");
256  $cb->setChecked($this->object->getCheck_values());
257  $this->form->addItem($cb);
258  // api adapter name
259  // $this->tpl->setVariable("TXT_API_ADAPTER", $this->lng->txt("cont_api_adapter"));
260  // $this->tpl->setVariable("VAL_API_ADAPTER", $this->object->getAPIAdapterName());
261  // api functions prefix
262  // $this->tpl->setVariable("TXT_API_PREFIX", $this->lng->txt("cont_api_func_prefix"));
263  // $this->tpl->setVariable("VAL_API_PREFIX", $this->object->getAPIFunctionsPrefix());
264 
265  //
266  // debugging
267  //
268  $sh = new ilFormSectionHeaderGUI();
269  $sh->setTitle($this->lng->txt("cont_debugging"));
270  $this->form->addItem($sh);
271 
272  // test tool
273  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
274  $cb->setValue("y");
275  $cb->setChecked($this->object->getDebug());
276  if ($this->object->getDebugActivated() == false)
277  {
278  $cb->setDisabled(true);
279  $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
280  }
281  else
282  {
283  $cb->setInfo($this->lng->txt("cont_debug_deactivate"));
284  }
285  $this->form->addItem($cb);
286  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
287 
288  $tpl->setContent($this->form->getHTML());
289 
290  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
This class represents a number property in a property form.
setValue($a_value)
Set Value.
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
setOptions($a_options)
Set Options.
setMaxLength($a_maxlength)
Set Max Length.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

Definition at line 605 of file class.ilObjSCORMLearningModuleGUI.php.

References ilTable2GUI\resetFilter(), and showTrackingItems().

606  {
607  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
608  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'showtrackingItems');
609  $tbl->resetFilter();
610  $tbl->resetOffset();
611  $this->showTrackingItems();
612  }
showTrackingItems()
Show tracking table ilTabs $ilTabs $global ilToolbar $ilToolbar.
resetFilter()
Reset filter.
+ Here is the call graph for this function:

◆ saveProperties()

ilObjSCORMLearningModuleGUI::saveProperties ( )

save properties

Definition at line 499 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, ilUtil\sendInfo(), and ilUtil\yn2tf().

500  {
501  //check if OfflineMode-Zip has to be created
502  $tmpOfflineMode= ilUtil::yn2tf($_POST["cobj_offline_mode"]);
503  if ($tmpOfflineMode == true) {
504  if ($this->object->getOfflineMode() == false) {
505  $this->object->zipLmForOfflineMode();
506  }
507  }
508  $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
509  $this->object->setOfflineMode($tmpOfflineMode);
510  $this->object->setOpenMode($_POST["open_mode"]);
511  $this->object->setWidth($_POST["width"]);
512  $this->object->setHeight($_POST["height"]);
513  $this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
514  $this->object->setAutoContinue(ilUtil::yn2tf($_POST["auto_continue"]));
515  $this->object->setMaxAttempt($_POST["max_attempt"]);
516  $this->object->setDefaultLessonMode($_POST["lesson_mode"]);
517  $this->object->setCreditMode($_POST["credit_mode"]);
518  $this->object->setAutoReview(ilUtil::yn2tf($_POST["auto_review"]));
519 // $this->object->setAPIAdapterName($_POST["api_adapter"]);
520 // $this->object->setAPIFunctionsPrefix($_POST["api_func_prefix"]);
521  $this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
522  $this->object->setInteractions(ilUtil::yn2tf($_POST["cobj_interactions"]));
523  $this->object->setObjectives(ilUtil::yn2tf($_POST["cobj_objectives"]));
524  $this->object->setTime_from_lms(ilUtil::yn2tf($_POST["cobj_time_from_lms"]));
525  $this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
526  $this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
527  $this->object->update();
528  ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
529  $this->ctrl->redirect($this, "properties");
530  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static yn2tf($a_yn)
convert "y"/"n" to true/false
+ Here is the call graph for this function:

◆ setSubTabs()

ilObjSCORMLearningModuleGUI::setSubTabs ( )

Definition at line 980 of file class.ilObjSCORMLearningModuleGUI.php.

References $ilCtrl, and ilObjectGUI\$lng.

Referenced by ilObjSCORM2004LearningModuleGUI\initStylePropertiesForm(), ilObjSCORM2004LearningModuleGUI\properties(), showTrackingItem(), showTrackingItemPerUser(), showTrackingItems(), showTrackingItemsBySco(), and showTrackingItemSco().

981  {
982  global $lng, $ilTabs, $ilCtrl;
983 
984  $ilTabs->addSubTabTarget("cont_tracking_byuser",
985  $this->ctrl->getLinkTarget($this, "showTrackingItems"), array("edit", ""),
986  get_class($this));
987 
988  $ilTabs->addSubTabTarget("cont_tracking_bysco",
989  $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"), array("edit", ""),
990  get_class($this));
991  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ showTrackingItem()

ilObjSCORMLearningModuleGUI::showTrackingItem ( )
protected

show tracking data of item

Definition at line 915 of file class.ilObjSCORMLearningModuleGUI.php.

References $_REQUEST, setSubTabs(), and ilSCORMTrackingItemsPerUserTableGUI\setUserId().

916  {
917  global $ilTabs;
918 
919  include_once "./Services/Table/classes/class.ilTableGUI.php";
920 
921  $this->setSubTabs();
922  $ilTabs->setTabActive("cont_tracking_data");
923  $ilTabs->setSubTabActive("cont_tracking_byuser");
924 
925  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserTableGUI.php';
926  $tbl = new ilSCORMTrackingItemsPerUserTableGUI($this->object->getId(), $this, 'showTrackingItem');
927  $tbl->setUserId((int) $_REQUEST['user_id']);
928  $tbl->parse();
929  $this->tpl->setContent($tbl->getHTML());
930  return true;
931  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ showTrackingItemPerUser()

ilObjSCORMLearningModuleGUI::showTrackingItemPerUser ( )
protected

show tracking data of item per user

Definition at line 957 of file class.ilObjSCORMLearningModuleGUI.php.

References $_REQUEST, setSubTabs(), and ilSCORMTrackingItemPerUserTableGUI\setUserId().

958  {
959  global $ilTabs;
960 
961  include_once "./Services/Table/classes/class.ilTableGUI.php";
962 
963  $this->setSubTabs();
964  $ilTabs->setTabActive("cont_tracking_data");
965  $ilTabs->setSubTabActive("cont_tracking_byuser");
966 
967  $this->ctrl->setParameter($this,'obj_id',(int) $_REQUEST['obj_id']);
968  $this->ctrl->setParameter($this,'user_id',(int) $_REQUEST['user_id']);
969 
970  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemPerUserTableGUI.php';
971  $tbl = new ilSCORMTrackingItemPerUserTableGUI($this->object->getId(), $this, 'showTrackingItemPerUser');
972  $tbl->setUserId((int) $_REQUEST['user_id']);
973  $tbl->setScoId((int) $_REQUEST['obj_id']);
974  $tbl->parse();
975  $this->tpl->setContent($tbl->getHTML());
976  return true;
977  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ showTrackingItems()

ilObjSCORMLearningModuleGUI::showTrackingItems ( )
protected

Show tracking table ilTabs $ilTabs $global ilToolbar $ilToolbar.

Definition at line 558 of file class.ilObjSCORMLearningModuleGUI.php.

References ilPrivacySettings\_getInstance(), ilSCORMTrackingUsersTableGUI\parse(), and setSubTabs().

Referenced by applyUserTableFilter(), and resetUserTableFilter().

559  {
560  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
561  $privacy = ilPrivacySettings::_getInstance();
562  if(!$privacy->enabledSahsProtocolData())
563  {
564  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
565  }
566 
567  global $ilTabs, $ilToolbar;
568 
569  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
570  $ilToolbar->addButton(
571  $this->lng->txt('import'),
572  $this->ctrl->getLinkTarget($this, 'importForm')
573  );
574  $ilToolbar->addButton(
575  $this->lng->txt('cont_export_all'),
576  $this->ctrl->getLinkTarget($this, 'exportSelectionAll')
577  );
578 
579  $this->setSubTabs();
580  $ilTabs->setTabActive('cont_tracking_data');
581  $ilTabs->setSubTabActive('cont_tracking_byuser');
582 
583  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
584  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'showtrackingItems');
585  $tbl->parse();
586  $this->tpl->setContent($tbl->getHTML());
587  }
redirection script todo: (a better solution should control the processing via a xml file) ...
static _getInstance()
Get instance of ilPrivacySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTrackingItemsBySco()

ilObjSCORMLearningModuleGUI::showTrackingItemsBySco ( )
protected

show tracking data

Definition at line 535 of file class.ilObjSCORMLearningModuleGUI.php.

References ilSCORMTrackingItemsPerScoTableGUI\parse(), and setSubTabs().

536  {
537  global $ilTabs;
538 
539  include_once "./Services/Table/classes/class.ilTableGUI.php";
540 
541  $this->setSubTabs();
542  $ilTabs->setTabActive("cont_tracking_data");
543  $ilTabs->setSubTabActive("cont_tracking_bysco");
544 
545  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerScoTableGUI.php';
546  $tbl = new ilSCORMTrackingItemsPerScoTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco');
547  $tbl->parse();
548  $this->tpl->setContent($tbl->getHTML());
549  return true;
550  }
+ Here is the call graph for this function:

◆ showTrackingItemSco()

ilObjSCORMLearningModuleGUI::showTrackingItemSco ( )
protected

show tracking data of item

Definition at line 936 of file class.ilObjSCORMLearningModuleGUI.php.

References $_GET, ilSCORMTrackingItemsScoTableGUI\setScoId(), and setSubTabs().

937  {
938  global $ilTabs;
939 
940  include_once "./Services/Table/classes/class.ilTableGUI.php";
941 
942  $this->setSubTabs();
943  $ilTabs->setTabActive("cont_tracking_data");
944  $ilTabs->setSubTabActive("cont_tracking_bysco");
945 
946  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsScoTableGUI.php';
947  $tbl = new ilSCORMTrackingItemsScoTableGUI($this->object->getId(), $this, 'showTrackingItemSco');
948  $tbl->setScoId((int) $_GET['obj_id']);
949  $tbl->parse();
950  $this->tpl->setContent($tbl->getHTML());
951  return true;
952  }
$_GET["client_id"]
+ Here is the call graph for this function:

◆ stopUserOfflineMode()

ilObjSCORMLearningModuleGUI::stopUserOfflineMode ( )
protected

Stop offline mode for selected users.

Definition at line 1017 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, ilObject\_exists(), ilUtil\getImageTagByType(), and ilUtil\sendFailure().

1018  {
1019  if(!count((array) $_POST['user']))
1020  {
1021  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1022  $this->ctrl->redirect($this,'offlineModeManager');
1023  }
1024  // display confirmation message
1025  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1026  $cgui = new ilConfirmationGUI();
1027  $cgui->setFormAction($this->ctrl->getFormAction($this));
1028  $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
1029  $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
1030  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
1031  foreach($_POST["user"] as $id)
1032  {
1033  if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
1034  {
1035  $user = new ilObjUser($id);
1036  $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath).
1037  " ".$this->lng->txt("stop_user_offline_mode_for_user").
1038  ": ".$user->getLastname().", ".$user->getFirstname();
1039  $cgui->addItem("user[]", $id, $caption);
1040  }
1041  }
1042  $this->tpl->setContent($cgui->getHTML());
1043  }
$_POST['username']
Definition: cron.php:12
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

Field Documentation

◆ EXPORT_ALL

const ilObjSCORMLearningModuleGUI::EXPORT_ALL = 1

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

◆ EXPORT_SELECTED

const ilObjSCORMLearningModuleGUI::EXPORT_SELECTED = 2

Definition at line 30 of file class.ilObjSCORMLearningModuleGUI.php.

◆ EXPORT_TYPE_RAW

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_RAW = 1

Definition at line 32 of file class.ilObjSCORMLearningModuleGUI.php.

◆ EXPORT_TYPE_SUCCESS

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_SUCCESS = 2

Definition at line 33 of file class.ilObjSCORMLearningModuleGUI.php.

◆ EXPORT_UNDEF

const ilObjSCORMLearningModuleGUI::EXPORT_UNDEF = 0

Definition at line 28 of file class.ilObjSCORMLearningModuleGUI.php.


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