ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 showTrackingItems ()
 Show tracking table ilTabs $ilTabs $global ilToolbar $ilToolbar. More...
 
 deleteTrackingForUser ()
 display deletion confirmation screen More...
 
 cancelDeleteTracking ()
 cancel deletion of export files More...
 
 confirmedDeleteTracking ()
 
 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...
 
 addLocatorItems ()
 
 editContent ()
 List files. More...
 
 setSettingsSubTabs ()
 set Tabs for settings More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

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...
 
 modifyTrackingItems ()
 
 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...
 
 exportAll ()
 Show export section for all users. More...
 
 exportSelectionUsers ()
 Export selection for selected users. 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...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ applyUserTableFilter()

ilObjSCORMLearningModuleGUI::applyUserTableFilter ( )
protected

Apply table filter.

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

References $tbl, and modifyTrackingItems().

758  {
759  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
760  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
761  $tbl->writeFilterToSession();
762  $tbl->resetOffset();
763  $this->modifyTrackingItems();
764  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

◆ assignObject()

ilObjSCORMLearningModuleGUI::assignObject ( )

assign scorm object to scorm gui object

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

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

◆ cancel()

ilObjSCORMLearningModuleGUI::cancel ( )

overwrite..jump back to trackingdata not parent

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

References ilUtil\sendInfo().

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

◆ cancelDeleteTracking()

ilObjSCORMLearningModuleGUI::cancelDeleteTracking ( )

cancel deletion of export files

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

References ilUtil\sendInfo().

818  {
819  ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
820  $this->ctrl->redirect($this, "modifyTrackingItems");
821  }
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 1074 of file class.ilObjSCORMLearningModuleGUI.php.

References ilUtil\sendInfo().

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

◆ confirmedDeleteTracking()

ilObjSCORMLearningModuleGUI::confirmedDeleteTracking ( )

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

References $_POST.

824  {
825  $this->object->deleteTrackingDataOfUsers($_POST["user"]);
826  $this->ctrl->redirect($this, "modifyTrackingItems");
827  }
$_POST['username']
Definition: cron.php:12

◆ confirmedStopUserOfflineMode()

ilObjSCORMLearningModuleGUI::confirmedStopUserOfflineMode ( )

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

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

1081  {
1082 
1083  include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php';
1084  foreach($_POST["user"] as $id)
1085  {
1086  ilSCORMOfflineMode::stopOfflineModeForUser($this->object->getId(),$id);
1087  }
1088 
1089  $this->offlineModeManager();
1090  }
$_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 923 of file class.ilObjSCORMLearningModuleGUI.php.

References $_POST, and ilUtil\sendInfo().

924  {
925  if (!isset($_POST["user"])) {
926  ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
927  }
928  $this->object->decreaseAttemptsForUser($_POST["user"]);
929  $this->ctrl->redirect($this, "modifyTrackingItems");
930  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ deleteTrackingForUser()

ilObjSCORMLearningModuleGUI::deleteTrackingForUser ( )

display deletion confirmation screen

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

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

782  {
783  if(!isset($_POST["user"]))
784  {
785  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
786  }
787 
788  // display confirmation message
789  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
790  $cgui = new ilConfirmationGUI();
791  $cgui->setFormAction($this->ctrl->getFormAction($this));
792  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
793  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteTracking");
794  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeleteTracking");
795 
796  foreach($_POST["user"] as $id)
797  {
798  if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
799  {
800  $user = new ilObjUser($id);
801 
802  $caption = ilUtil::getImageTagByType("sahs", $this->tpl->tplPath).
803  " ".$this->lng->txt("cont_tracking_data").
804  ": ".$user->getLastname().", ".$user->getFirstname();
805 
806 
807  $cgui->addItem("user[]", $id, $caption);
808  }
809  }
810 
811  $this->tpl->setContent($cgui->getHTML());
812  }
$_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:

◆ exportAll()

ilObjSCORMLearningModuleGUI::exportAll ( )
protected

Show export section for all users.

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

903  {
904  $this->object->exportSelected(1);
905  }

◆ exportSelectionUsers()

ilObjSCORMLearningModuleGUI::exportSelectionUsers ( )
protected

Export selection for selected users.

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

References $_POST, and ilUtil\sendInfo().

911  {
912  if(!count((array) $_POST['user']))
913  {
914  //ilUtil::sendFailure($this->lng->txt('select_one'),true);
915  ilUtil::sendInfo($this->lng->txt("no_checkbox"),true);
916  $this->ctrl->redirect($this,'modifyTrackingItems');
917  } else {
918  $this->object->exportSelected(0,$_POST["user"]);
919  }
920  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getMaxFileSize()

ilObjSCORMLearningModuleGUI::getMaxFileSize ( )

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

Referenced by newModuleVersion().

413  {
414  // get the value for the maximal uploadable filesize from the php.ini (if available)
415  $umf=get_cfg_var("upload_max_filesize");
416  // get the value for the maximal post data from the php.ini (if available)
417  $pms=get_cfg_var("post_max_size");
418 
419  //convert from short-string representation to "real" bytes
420  $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
421 
422  $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
423  $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
424 
425  if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
426  if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
427 
428  // use the smaller one as limit
429  $max_filesize=min($umf, $pms);
430 
431  if (!$max_filesize) $max_filesize=max($umf, $pms);
432 
433  //format for display in mega-bytes
434  return $max_filesize=sprintf("%.1f MB",$max_filesize/1024/1024);
435  }
+ 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 41 of file class.ilObjSCORMLearningModuleGUI.php.

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

42  {
43  global $lng;
44 
45  $lng->loadLanguageModule("content");
46  $lng->loadLanguageModule("search");
47 
48  $this->type = "sahs";
49  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
50  }
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 841 of file class.ilObjSCORMLearningModuleGUI.php.

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

842  {
843  $form = $this->initImportForm();
844  if($form->checkInput())
845  {
846  $source = $form->getInput('csv');
847  $error = $this->object->importTrackingData($source['tmp_name']);
848  switch($error)
849  {
850  case 0 :
851  ilUtil::sendInfo('Tracking data imported', true);
852  $this->ctrl->redirect($this, "showTrackingItems");
853  break;
854  case -1 :
855  ilUtil::sendInfo($this->lng->txt('err_check_input'));
856  $this->importForm();
857  break;
858  }
859  }
860  ilUtil::sendInfo($this->lng->txt('err_check_input'));
861  $form->setValuesByPost();
862  $this->importForm();
863  }
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 868 of file class.ilObjSCORMLearningModuleGUI.php.

References initImportForm().

Referenced by import().

869  {
870  global $ilTabs;
871 
872  $ilTabs->clearTargets();
873  $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'showTrackingItems'));
874 
875  $form = $this->initImportForm();
876  $this->tpl->setContent($form->getHTML());
877  }
+ 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 882 of file class.ilObjSCORMLearningModuleGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by import(), and importForm().

883  {
884  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
885  $form = new ilPropertyFormGUI();
886  $form->setFormAction($this->ctrl->getFormAction($this));
887  $form->setTitle($this->lng->txt('cont_import_tracking'));
888  $form->addCommandButton('import', $this->lng->txt('import'));
889  $form->addCommandButton('showTrackingItems', $this->lng->txt('cancel'));
890 
891  $csv = new ilFileInputGUI($this->lng->txt('select_file'),'csv');
892  $csv->setRequired(true);
893  $csv->setSuffixes(array('csv'));
894  $form->addItem($csv);
895 
896  return $form;
897  }
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:

◆ modifyTrackingItems()

ilObjSCORMLearningModuleGUI::modifyTrackingItems ( )
protected

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

References $_GET, $tbl, ilPrivacySettings\_getInstance(), and setSubTabs().

Referenced by applyUserTableFilter(), ilObjSCORM2004LearningModuleGUI\deleteTrackingData(), resetUserTableFilter(), showTrackingItems(), and ilObjSCORM2004LearningModuleGUI\showTrackingItems().

720  {
721  global $ilAccess;
722  if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
723  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
724  $privacy = ilPrivacySettings::_getInstance();
725  if(!$privacy->enabledSahsProtocolData())
726  {
727  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
728  }
729 
730  global $ilTabs, $ilToolbar;
731 
732  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
733  $ilToolbar->addButton(
734  $this->lng->txt('import'),
735  $this->ctrl->getLinkTarget($this, 'importForm')
736  );
737  $ilToolbar->addButton(
738  $this->lng->txt('cont_export_all'),
739  $this->ctrl->getLinkTarget($this, 'exportAll')
740  );
741 
743  $ilTabs->setTabActive('cont_tracking_data');
744  $ilTabs->setSubTabActive('cont_tracking_modify');
745 
746  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
747  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
748  $tbl->parse();
749  $this->tpl->setContent($tbl->getHTML());
750  }
751  }
$_GET["client_id"]
$tbl
Definition: example_048.php:81
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:

◆ newModuleVersion()

ilObjSCORMLearningModuleGUI::newModuleVersion ( )

upload new version of module

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

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

Referenced by newModuleVersionUpload().

355  {
356  global $ilTabs;
358  $ilTabs->setSubTabActive('cont_sc_new_version');
359 
362 
363  // display import form
364  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_new_version_import.html", "Modules/ScormAicc");
365 
366  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_lm.svg'));
367  $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
368 
369  $this->ctrl->setParameter($this, "new_type", "sahs");
370  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
371 
372  $this->tpl->setVariable("BTN_NAME", "newModuleVersionUpload");
373  $this->tpl->setVariable("TARGET", ' target="'.
374  ilFrameTargetInfo::_getFrame("MainContent").'" ');
375 
376  $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
377 
378  if ($type == "scorm2004") {
379  $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm2004"));
380  } else {
381  $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm"));
382  }
383 
384  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
386  {
388  foreach($files as $file)
389  {
390  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
391  $this->tpl->setCurrentBlock("option_uploaded_file");
392  $this->tpl->setVariable("UPLOADED_FILENAME", $file);
393  $this->tpl->setVariable("TXT_UPLOADED_FILENAME", $file);
394  $this->tpl->parseCurrentBlock();
395  }
396  $this->tpl->setCurrentBlock("select_uploaded_file");
397  $this->tpl->setVariable("TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt("cont_select_from_upload_dir"));
398  $this->tpl->setVariable("TXT_UPLOADED_FILE", $this->lng->txt("cont_uploaded_file"));
399  $this->tpl->parseCurrentBlock();
400  }
401 
402  $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
403  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
404  $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
405  $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
406 
407  // gives out the limit as a little notice
408  $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." ".$this->getMaxFileSize());
409  }
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 438 of file class.ilObjSCORMLearningModuleGUI.php.

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

439  {
440  global $_FILES, $rbacsystem;
441 
442  $unzip = PATH_TO_UNZIP;
443  $tocheck = "imsmanifest.xml";
444 
445  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
446 
447  // check create permission before because the uploaded file will be copied
448  if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
449  {
450  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
451  }
452  elseif ($_FILES["scormfile"]["name"])
453  {
454  // check if file was uploaded
455  $source = $_FILES["scormfile"]["tmp_name"];
456  if (($source == 'none') || (!$source))
457  {
458  ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
459  $this->newModuleVersion();
460  return;
461  }
462  }
463  elseif ($_POST["uploaded_file"])
464  {
465  // check if the file is in the ftp directory and readable
466  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
467  {
468  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
469  }
470  // copy the uploaded file to the client web dir to analyze the imsmanifest
471  // the copy will be moved to the lm directory or deleted
472  $source = CLIENT_WEB_DIR . "/" . $_POST["uploaded_file"];
473  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $source);
474  $source_is_copy = true;
475  }
476  else
477  {
478  ilUtil::sendInfo($this->lng->txt("upload_error_file_not_found"),true);
479  $this->newModuleVersion();
480  return;
481  }
482  // fim.
483 
484  //unzip the imsmanifest-file from new uploaded file
485  $pathinfo = pathinfo($source);
486  $dir = $pathinfo["dirname"];
487  $file = $pathinfo["basename"];
488  $cdir = getcwd();
489  chdir($dir);
490 
491  //we need more flexible unzip here than ILIAS standard classes allow
492  $unzipcmd = $unzip." -o ".ilUtil::escapeShellArg($source)." ".$tocheck;
493  exec($unzipcmd);
494  chdir($cdir);
495  $tmp_file = $dir."/".$_GET["ref_id"].".".$tocheck;
496  require_once('./Services/Utilities/classes/class.ilFileUtils.php');
497  ilFileUtils::rename($dir."/".$tocheck,$tmp_file);
498  $new_manifest = file_get_contents($tmp_file);
499 
500  //remove temp file
501  unlink($tmp_file);
502 
503  //get old manifest file
504  $old_manifest = file_get_contents($this->object->getDataDirectory()."/".$tocheck);
505 
506  //reload fixed version of file
507  $check ='/xmlns="http:\/\/www.imsglobal.org\/xsd\/imscp_v1p1"/';
508  $replace="xmlns=\"http://www.imsproject.org/xsd/imscp_rootv1p1p2\"";
509  $reload_manifest = preg_replace($check, $replace, $new_manifest);
510 
511  //do testing for converted versions as well as earlier ILIAS version messed up utf8 conversion
512  if (strcmp($new_manifest,$old_manifest) == 0 || strcmp(utf8_encode($new_manifest),$old_manifest) == 0 ||
513  strcmp ($reload_manifest, $old_manifest) == 0 || strcmp(utf8_encode($reload_manifest),$old_manifest) == 0 ){
514 
515  //get exisiting module version
516  $module_version = $this->object->getModuleVersion();
517 
518  if ($_FILES["scormfile"]["name"])
519  {
520  //build targetdir in lm_data
521  $file_path = $this->object->getDataDirectory()."/".$_FILES["scormfile"]["name"].".".$module_version;
522  $file_path = str_replace(".zip.".$module_version, ".".$module_version.".zip",$file_path);
523  //move to data directory and add subfix for versioning
524  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],$_FILES["scormfile"]["name"], $file_path);
525  }
526  else
527  {
528  //build targetdir in lm_data
529  $file_path = $this->object->getDataDirectory()."/".$_POST["uploaded_file"].".".$module_version;
530  $file_path = str_replace(".zip.".$module_version, ".".$module_version.".zip",$file_path);
531  // move the already copied file to the lm_data directory
532  require_once('./Services/Utilities/classes/class.ilFileUtils.php');
533  ilFileUtils::rename($source, $file_path);
534  }
535 
536  //unzip and replace old extracted files
537  ilUtil::unzip($file_path, true);
538  ilUtil::renameExecutables($this->object->getDataDirectory()); //(security)
539 
540  //increase module version
541  $this->object->setModuleVersion($module_version+1);
542  $this->object->update();
543 
544  //redirect to properties and display success
545  ilUtil::sendInfo( $this->lng->txt("cont_new_module_added"), true);
546  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$_GET["ref_id"]);
547  exit;
548  }
549  else
550  {
551  if ($source_is_copy)
552  {
553  unlink($source);
554  }
555 
556  ilUtil::sendInfo($this->lng->txt("cont_invalid_new_module"),true);
557  $this->newModuleVersion();
558  }
559  }
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 rename($a_source, $a_target)
Rename a 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 1027 of file class.ilObjSCORMLearningModuleGUI.php.

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

Referenced by confirmedStopUserOfflineMode().

1028  {
1029  global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting;
1030 
1031  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1032  if(!ilLearningProgressAccess::checkAccess($this->object->getRefId()))
1033  {
1034  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
1035  }
1036 
1037  include_once './Modules/ScormAicc/classes/class.ilSCORMOfflineModeUsersTableGUI.php';
1038  $tbl = new ilSCORMOfflineModeUsersTableGUI($this->object->getId(), $this, 'offlineModeManager');
1039  $tbl->parse();
1040  $this->tpl->setContent($tbl->getHTML());
1041 
1042  }
$tbl
Definition: example_048.php:81
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 73 of file class.ilObjSCORMLearningModuleGUI.php.

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

74  {
75  global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting, $ilTabs;
76 
77  $lng->loadLanguageModule("style");
78 
80  $ilTabs->setSubTabActive('cont_settings');
81 
82  // view
83  $ilToolbar->addButton($this->lng->txt("view"),
84  "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
85  "_blank");
86 
87  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
88  $this->form = new ilPropertyFormGUI();
89  $this->form->setFormAction($ilCtrl->getFormAction($this));
90  $this->form->setTitle($this->lng->txt("cont_lm_properties"));
91 
92  //check/select only once
93  $this->object->checkMasteryScoreValues();
94 
95  //title
96  $ti = new ilTextInputGUI($this->lng->txt("title"), "Fobject_title");
97  $ti->setMaxLength(200);
98  $ti->setValue($this->object->getTitle());
99  $this->form->addItem($ti);
100 
101  //description
102  $ti = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject_description");
103  $ti->setValue($this->object->getDescription());
104  $this->form->addItem($ti);
105 
106  // SCORM-type
107  $ne = new ilNonEditableValueGUI($this->lng->txt("type"), "");
108  $ne->setValue($this->lng->txt( "lm_type_" . ilObjSAHSLearningModule::_lookupSubType( $this->object->getID() ) ) );
109  $this->form->addItem($ne);
110 
111  // version
112  $ne = new ilNonEditableValueGUI($this->lng->txt("cont_sc_version"), "");
113  $ne->setValue($this->object->getModuleVersion());
114  $ne->setInfo($this->lng->txt("cont_sc_version_info"));
115  $this->form->addItem($ne);
116 
117  //
118  // activation
119  //
120  $sh = new ilFormSectionHeaderGUI();
121  $sh->setTitle($this->lng->txt("activation"));
122  $this->form->addItem($sh);
123 
124  // online
125  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_online"), "cobj_online");
126  $cb->setValue("y");
127  if ($this->object->getOnline())
128  {
129  $cb->setChecked(true);
130  }
131  $cb->setInfo($this->lng->txt("cont_online_info"));
132  $this->form->addItem($cb);
133 
134  // offline Mode
135  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_offline_mode_allow"), "cobj_offline_mode");
136  $cb->setValue("y");
137  $cb->setChecked($this->object->getOfflineMode());
138  include_once("./Modules/ScormAicc/classes/class.ilSCORMOfflineMode.php");
139  if ($this->object->getOfflineMode()== true && ilSCORMOfflineMode::checkIfAnyoneIsInOfflineMode($this->object->getID()) == true) {
140  $cb->setDisabled(true);
141  $cb->setInfo($this->lng->txt("cont_offline_mode_disable_not_allowed_info"));
142  } else {
143  $cb->setInfo($this->lng->txt("cont_offline_mode_allow_info"));
144  }
145  $this->form->addItem($cb);
146 
147  //
148  // presentation
149  //
150  $sh = new ilFormSectionHeaderGUI();
151  $sh->setTitle($this->lng->txt("cont_presentation"));
152  $this->form->addItem($sh);
153 
154  // display mode (open)
155  // $options = array(
156  // "0" => $this->lng->txt("cont_open_normal"),
157  // "1" => $this->lng->txt("cont_open_iframe_max"),
158  // "2" => $this->lng->txt("cont_open_iframe_defined"),
159  // "5" => $this->lng->txt("cont_open_window_undefined"),
160  // "6" => $this->lng->txt("cont_open_window_defined")
161  // );
162  // $si = new ilSelectInputGUI($this->lng->txt("cont_open"), "open_mode");
163  // $si->setOptions($options);
164  // $si->setValue($this->object->getOpenMode());
165  // $this->form->addItem($si);
166 
167  // // width
168  // $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width");
169  // $ni->setMaxLength(4);
170  // $ni->setSize(4);
171  // $ni->setValue($this->object->getWidth());
172  // $this->form->addItem($ni);
173 
174  // // height
175  // $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height");
176  // $ni->setMaxLength(4);
177  // $ni->setSize(4);
178  // $ni->setValue($this->object->getHeight());
179  // $this->form->addItem($ni);
180  $radg = new ilRadioGroupInputGUI($lng->txt("cont_open"), "open_mode");
181  $op0 = new ilRadioOption($this->lng->txt("cont_open_normal"), "0");
182  $radg->addOption($op0);
183  $op1 = new ilRadioOption($this->lng->txt("cont_open_iframe"), "1");
184  $radg->addOption($op1);
185  $op2 = new ilRadioOption($this->lng->txt("cont_open_window"), "5");
186  $radg->addOption($op2);
187  $radg->setValue($this->object->getOpenMode()); //ACHTUNG: DATENBANK
188  // width
189  $ni = new ilNumberInputGUI($this->lng->txt("cont_width"), "width");
190  $ni->setMaxLength(4);
191  $ni->setSize(4);
192  //ACHTUNG: DATENBANKUPDATE
193  $ni->setValue($this->object->getWidth());
194  $op1->addSubItem($ni);
195  $op2->addSubItem($ni);
196  // height
197  $ni = new ilNumberInputGUI($this->lng->txt("cont_height"), "height");
198  $ni->setMaxLength(4);
199  $ni->setSize(4);
200  $ni->setValue($this->object->getHeight());
201  $ni->setInfo($this->lng->txt("cont_width_height_info"));
202  $op1->addSubItem($ni);
203  $op2->addSubItem($ni);
204  $this->form->addItem($radg);
205 
206  // auto navigation to last visited item
207  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_auto_last_visited"), "cobj_auto_last_visited");
208  $cb->setValue("y");
209  $cb->setChecked($this->object->getAuto_last_visited());
210  $cb->setInfo($this->lng->txt("cont_auto_last_visited_info"));
211  $this->form->addItem($cb);
212 
213  // auto continue
214  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_auto_continue"), "auto_continue");
215  $cb->setValue("y");
216  $cb->setChecked($this->object->getAutoContinue());
217  $this->form->addItem($cb);
218 
219  //
220  // scorm options
221  //
222  $sh = new ilFormSectionHeaderGUI();
223  $sh->setTitle($this->lng->txt("cont_scorm_options"));
224  $this->form->addItem($sh);
225 
226  // max attempts
227  // $ni = new ilNumberInputGUI($this->lng->txt("cont_sc_max_attempt"), "max_attempt");
228  // $ni->setMaxLength(3);
229  // $ni->setSize(3);
230  // $ni->setValue($this->object->getMaxAttempt());
231  // $this->form->addItem($ni);
232 
233  // lesson mode
234  $options = array("normal" => $this->lng->txt("cont_sc_less_mode_normal"),
235  "browse" => $this->lng->txt("cont_sc_less_mode_browse"));
236  $si = new ilSelectInputGUI($this->lng->txt("cont_def_lesson_mode"), "lesson_mode");
237  $si->setOptions($options);
238  $si->setValue($this->object->getDefaultLessonMode());
239  $this->form->addItem($si);
240 
241  // credit mode
242  $options = array("credit" => $this->lng->txt("cont_credit_on"),
243  "no_credit" => $this->lng->txt("cont_credit_off"));
244  $si = new ilSelectInputGUI($this->lng->txt("cont_credit_mode"), "credit_mode");
245  $si->setOptions($options);
246  $si->setValue($this->object->getCreditMode());
247  $si->setInfo($this->lng->txt("cont_credit_mode_info"));
248  $this->form->addItem($si);
249 
250  // set lesson mode review when completed
251  $options = array(
252  "n" => $this->lng->txt("cont_sc_auto_review_no"),
253 // "r" => $this->lng->txt("cont_sc_auto_review_completed_not_failed_or_passed"),
254 // "p" => $this->lng->txt("cont_sc_auto_review_passed"),
255 // "q" => $this->lng->txt("cont_sc_auto_review_passed_or_failed"),
256 // "c" => $this->lng->txt("cont_sc_auto_review_completed"),
257 // "d" => $this->lng->txt("cont_sc_auto_review_completed_and_passed"),
258  "y" => $this->lng->txt("cont_sc_auto_review_completed_or_passed"),
259  );
260  $si = new ilSelectInputGUI($this->lng->txt("cont_sc_auto_review_2004"), "auto_review");
261  $si->setOptions($options);
262  $si->setValue($this->object->getAutoReviewChar());
263  // $si->setInfo($this->lng->txt("cont_sc_auto_review_info_12"));
264  $this->form->addItem($si);
265 
266  // mastery_score
267  if ($this->object->getMasteryScoreValues() != "") {
268  $ni = new ilNumberInputGUI($this->lng->txt("cont_mastery_score_12"), "mastery_score");
269  $ni->setMaxLength(3);
270  $ni->setSize(3);
271  $ni->setValue($this->object->getMasteryScore());
272  $ni->setInfo($this->lng->txt("cont_mastery_score_12_info").$this->object->getMasteryScoreValues());
273  $this->form->addItem($ni);
274  }
275 
276  //
277  // rte settings
278  //
279  $sh = new ilFormSectionHeaderGUI();
280  $sh->setTitle($this->lng->txt("cont_rte_settings"));
281  $this->form->addItem($sh);
282 
283  // unlimited session timeout
284  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_sc_usession"), "cobj_session");
285  $cb->setValue("y");
286  $cb->setChecked($this->object->getSession());
287  $cb->setInfo($this->lng->txt("cont_sc_usession_info"));
288  $this->form->addItem($cb);
289 
290  // storage of interactions
291  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_interactions"), "cobj_interactions");
292  $cb->setValue("y");
293  $cb->setChecked($this->object->getInteractions());
294  $cb->setInfo($this->lng->txt("cont_interactions_info_12"));
295  $this->form->addItem($cb);
296 
297  // objectives
298  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_objectives"), "cobj_objectives");
299  $cb->setValue("y");
300  $cb->setChecked($this->object->getObjectives());
301  $cb->setInfo($this->lng->txt("cont_objectives_info"));
302  $this->form->addItem($cb);
303 
304  // time from lms
305  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_time_from_lms"), "cobj_time_from_lms");
306  $cb->setValue("y");
307  $cb->setChecked($this->object->getTime_from_lms());
308  $cb->setInfo($this->lng->txt("cont_time_from_lms_info"));
309  $this->form->addItem($cb);
310 
311  // check values
312  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_check_values"), "cobj_check_values");
313  $cb->setValue("y");
314  $cb->setChecked($this->object->getCheck_values());
315  $cb->setInfo($this->lng->txt("cont_check_values_info"));
316  $this->form->addItem($cb);
317  // api adapter name
318  // $this->tpl->setVariable("TXT_API_ADAPTER", $this->lng->txt("cont_api_adapter"));
319  // $this->tpl->setVariable("VAL_API_ADAPTER", $this->object->getAPIAdapterName());
320  // api functions prefix
321  // $this->tpl->setVariable("TXT_API_PREFIX", $this->lng->txt("cont_api_func_prefix"));
322  // $this->tpl->setVariable("VAL_API_PREFIX", $this->object->getAPIFunctionsPrefix());
323 
324  //
325  // debugging
326  //
327  $sh = new ilFormSectionHeaderGUI();
328  $sh->setTitle($this->lng->txt("cont_debugging"));
329  $this->form->addItem($sh);
330 
331  // test tool
332  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_debug"), "cobj_debug");
333  $cb->setValue("y");
334  $cb->setChecked($this->object->getDebug());
335  if ($this->object->getDebugActivated() == false)
336  {
337  $cb->setDisabled(true);
338  $cb->setInfo($this->lng->txt("cont_debug_deactivated"));
339  }
340  else
341  {
342  $cb->setInfo($this->lng->txt("cont_debug_deactivate"));
343  }
344  $this->form->addItem($cb);
345  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
346 
347  $tpl->setContent($this->form->getHTML());
348 
349  }
This class represents an option in a radio group.
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.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
setValue($a_value)
Set Value.
if(!is_array($argv)) $options
This class represents a number property in a property form.
setValue($a_value)
Set Value.
This class represents a text property in a property form.
_lookupSubType($a_obj_id)
lookup subtype id (scorm, aicc, hacp)
setMaxLength($a_maxlength)
Set Max Length.
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
This class represents a text area property in a property form.
+ Here is the call graph for this function:

◆ resetUserTableFilter()

ilObjSCORMLearningModuleGUI::resetUserTableFilter ( )
protected

Reset table filter.

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

References $tbl, and modifyTrackingItems().

770  {
771  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingUsersTableGUI.php';
772  $tbl = new ilSCORMTrackingUsersTableGUI($this->object->getId(), $this, 'modifytrackingItems');
773  $tbl->resetFilter();
774  $tbl->resetOffset();
775  $this->modifyTrackingItems();
776  }
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

◆ saveProperties()

ilObjSCORMLearningModuleGUI::saveProperties ( )

save properties

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

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

565  {
566  $this->object->setTitle($_POST["Fobject_title"]);
567  $this->object->setDescription($_POST["Fobject_description"]);
568 
569  //check if OfflineMode-Zip has to be created
570  $tmpOfflineMode= ilUtil::yn2tf($_POST["cobj_offline_mode"]);
571  if ($tmpOfflineMode == true) {
572  if ($this->object->getOfflineMode() == false) {
573  $this->object->zipLmForOfflineMode();
574  }
575  }
576  if (isset($_POST["mastery_score"])){
577  $this->object->setMasteryScore($_POST["mastery_score"]);
578  // $this->object->updateMasteryScoreValues();
579  }
580  $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
581  $this->object->setOfflineMode($tmpOfflineMode);
582  $this->object->setOpenMode($_POST["open_mode"]);
583  $this->object->setWidth($_POST["width"]);
584  $this->object->setHeight($_POST["height"]);
585  $this->object->setAuto_last_visited(ilUtil::yn2tf($_POST["cobj_auto_last_visited"]));
586  $this->object->setAutoContinue(ilUtil::yn2tf($_POST["auto_continue"]));
587  $this->object->setMaxAttempt($_POST["max_attempt"]);
588  $this->object->setDefaultLessonMode($_POST["lesson_mode"]);
589  $this->object->setCreditMode($_POST["credit_mode"]);
590  $this->object->setAutoReview(ilUtil::yn2tf($_POST["auto_review"]));
591 // $this->object->setAPIAdapterName($_POST["api_adapter"]);
592 // $this->object->setAPIFunctionsPrefix($_POST["api_func_prefix"]);
593  $this->object->setSession(ilUtil::yn2tf($_POST["cobj_session"]));
594  $this->object->setInteractions(ilUtil::yn2tf($_POST["cobj_interactions"]));
595  $this->object->setObjectives(ilUtil::yn2tf($_POST["cobj_objectives"]));
596  $this->object->setTime_from_lms(ilUtil::yn2tf($_POST["cobj_time_from_lms"]));
597  $this->object->setCheck_values(ilUtil::yn2tf($_POST["cobj_check_values"]));
598  $this->object->setDebug(ilUtil::yn2tf($_POST["cobj_debug"]));
599  $this->object->update();
600  ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
601  $this->ctrl->redirect($this, "properties");
602  }
$_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 1001 of file class.ilObjSCORMLearningModuleGUI.php.

References $_GET, $ilCtrl, and ilObjectGUI\$lng.

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

1002  {
1003  global $lng, $ilTabs, $ilCtrl, $ilAccess;
1004 
1005  if($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
1006  $ilTabs->addSubTabTarget("cont_tracking_byuser",
1007  $this->ctrl->getLinkTarget($this, "showTrackingItems"), array("edit", ""),
1008  get_class($this));
1009 
1010  $ilTabs->addSubTabTarget("cont_tracking_bysco",
1011  $this->ctrl->getLinkTarget($this, "showTrackingItemsBySco"), array("edit", ""),
1012  get_class($this));
1013  }
1014  if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
1015  $ilTabs->addSubTabTarget("cont_tracking_modify",
1016  $this->ctrl->getLinkTarget($this, "modifyTrackingItems"), array("edit", ""),
1017  get_class($this));
1018  }
1019  }
$_GET["client_id"]
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 936 of file class.ilObjSCORMLearningModuleGUI.php.

References $_REQUEST, $tbl, 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_byuser");
945 
946  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserTableGUI.php';
947  $tbl = new ilSCORMTrackingItemsPerUserTableGUI($this->object->getId(), $this, 'showTrackingItem');
948  $tbl->setUserId((int) $_REQUEST['user_id']);
949  $tbl->parse();
950  $this->tpl->setContent($tbl->getHTML());
951  return true;
952  }
$tbl
Definition: example_048.php:81
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 978 of file class.ilObjSCORMLearningModuleGUI.php.

References $_REQUEST, $tbl, and setSubTabs().

979  {
980  global $ilTabs;
981 
982  include_once "./Services/Table/classes/class.ilTableGUI.php";
983 
984  $this->setSubTabs();
985  $ilTabs->setTabActive("cont_tracking_data");
986  $ilTabs->setSubTabActive("cont_tracking_byuser");
987 
988  $this->ctrl->setParameter($this,'obj_id',(int) $_REQUEST['obj_id']);
989  $this->ctrl->setParameter($this,'user_id',(int) $_REQUEST['user_id']);
990 
991  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemPerUserTableGUI.php';
992  $tbl = new ilSCORMTrackingItemPerUserTableGUI($this->object->getId(), $this, 'showTrackingItemPerUser');
993  $tbl->setUserId((int) $_REQUEST['user_id']);
994  $tbl->setScoId((int) $_REQUEST['obj_id']);
995  $tbl->parse();
996  $this->tpl->setContent($tbl->getHTML());
997  return true;
998  }
$tbl
Definition: example_048.php:81
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 ( )

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

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

References $_GET, $_POST, $row, $tbl, ilObject\_exists(), ilTrQuery\getParticipantsForObject(), modifyTrackingItems(), setSubTabs(), and ilUtil\stripSlashes().

659  {
660  global $ilTabs, $ilAccess;
661 
662  $ilTabs->setTabActive('cont_tracking_data');
663 
664  if($ilAccess->checkAccess("read_learning_progress", "", $_GET["ref_id"])) {
665 
667  $ilTabs->setSubTabActive('cont_tracking_byuser');
668 
669  $reports = array('exportSelectedSuccess','exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');
670 
671  $userSelected = "all";
672  if (isset($_GET["userSelected"])) $userSelected = ilUtil::stripSlashes($_GET["userSelected"]);
673  if (isset($_POST["userSelected"])) $userSelected = ilUtil::stripSlashes($_POST["userSelected"]);
674  $this->ctrl->setParameter($this,'userSelected',$userSelected);
675 
676  $report = "choose";
677  if (isset($_GET["report"])) $report = ilUtil::stripSlashes($_GET["report"]);
678  if (isset($_POST["report"])) $report = ilUtil::stripSlashes($_POST["report"]);
679  $this->ctrl->setParameter($this,'report',$report);
680 
681  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerUserFilterGUI.php';
682  $filter = new ilSCORMTrackingItemsPerUserFilterGUI($this, 'showTrackingItems');
683  $filter->parse($userSelected,$report,$reports);
684  if($report == "choose") {
685  $this->tpl->setContent($filter->form->getHTML());
686  } else {
687  $usersSelected = array();
688  if ($userSelected != "all") $usersSelected[] = $userSelected;
689  else {
690  include_once "Services/Tracking/classes/class.ilTrQuery.php";
691  $users=ilTrQuery::getParticipantsForObject($this->ref_id);
692  foreach($users as $user) {
693  if(ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr') {
694  $usersSelected[] = $user;
695  }
696  }
697  }
698  $scosSelected = array();
699  $scos=$this->object->getTrackedItems();
700  foreach($scos as $row)
701  {
702  $scosSelected[]=(int)$row->getId();
703  }
704 
705  //with check for course ...
706  // include_once "Services/Tracking/classes/class.ilTrQuery.php";
707  // $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
708  // var_dump($this->object->getTrackedUsers(""));
709  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
710  $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItems', $usersSelected, $scosSelected, $report);
711  $this->tpl->setContent($filter->form->getHTML().$tbl->getHTML());
712  }
713  }
714  else if($ilAccess->checkAccess("edit_learning_progress", "", $_GET["ref_id"])) {
715  $this->modifyTrackingItems();
716  }
717  return true;
718  }
Class ilSCORMTrackingItemsTableGUI.
$_POST['username']
Definition: cron.php:12
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
$_GET["client_id"]
$tbl
Definition: example_048.php:81
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getParticipantsForObject($a_ref_id)
Get participant ids for given object.
+ Here is the call graph for this function:

◆ showTrackingItemsBySco()

ilObjSCORMLearningModuleGUI::showTrackingItemsBySco ( )
protected

show tracking data

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

References $_GET, $_POST, $row, $tbl, ilTrQuery\getParticipantsForObject(), setSubTabs(), and ilUtil\stripSlashes().

608  {
609  global $ilTabs;
610 
612  $ilTabs->setTabActive("cont_tracking_data");
613  $ilTabs->setSubTabActive("cont_tracking_bysco");
614 
615  $reports = array('exportSelectedCore','exportSelectedInteractions','exportSelectedObjectives','exportSelectedRaw');//,'tracInteractionItem','tracInteractionUser','tracInteractionUserAnswers'
616  $scoSelected = "all";
617  if (isset($_GET["scoSelected"])) $scoSelected = ilUtil::stripSlashes($_GET["scoSelected"]);
618  if (isset($_POST["scoSelected"])) $scoSelected = ilUtil::stripSlashes($_POST["scoSelected"]);
619  $this->ctrl->setParameter($this,'scoSelected',$scoSelected);
620 
621  $report = "choose";
622  if (isset($_GET["report"])) $report = ilUtil::stripSlashes($_GET["report"]);
623  if (isset($_POST["report"])) $report = ilUtil::stripSlashes($_POST["report"]);
624  $this->ctrl->setParameter($this,'report',$report);
625 
626  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsPerScoFilterGUI.php';
627  $filter = new ilSCORMTrackingItemsPerScoFilterGUI($this, 'showTrackingItemsBySco');
628  $filter->parse($scoSelected,$report,$reports);
629  if($report == "choose") {
630  $this->tpl->setContent($filter->form->getHTML());
631  } else {
632  $scosSelected = array();
633  if ($scoSelected != "all") $scosSelected[] = $scoSelected;
634  else {
635  $scos=$this->object->getTrackedItems();
636  foreach($scos as $row)
637  {
638  $scosSelected[]=(int)$row->getId();
639  }
640  }
641  //with check for course ...
642  include_once "Services/Tracking/classes/class.ilTrQuery.php";
643  $a_users=ilTrQuery::getParticipantsForObject($this->ref_id);
644  // var_dump($this->object->getTrackedUsers(""));
645  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsTableGUI.php';
646  $tbl = new ilSCORMTrackingItemsTableGUI($this->object->getId(), $this, 'showTrackingItemsBySco', $a_users, $scosSelected, $report);
647  $this->tpl->setContent($filter->form->getHTML().$tbl->getHTML());
648  }
649  return true;
650  }
Class ilSCORMTrackingItemsTableGUI.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$tbl
Definition: example_048.php:81
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getParticipantsForObject($a_ref_id)
Get participant ids for given object.
+ Here is the call graph for this function:

◆ showTrackingItemSco()

ilObjSCORMLearningModuleGUI::showTrackingItemSco ( )
protected

show tracking data of item

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

References $_GET, $tbl, and setSubTabs().

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_bysco");
966 
967  include_once './Modules/ScormAicc/classes/class.ilSCORMTrackingItemsScoTableGUI.php';
968  $tbl = new ilSCORMTrackingItemsScoTableGUI($this->object->getId(), $this, 'showTrackingItemSco');
969  $tbl->setScoId((int) $_GET['obj_id']);
970  $tbl->parse();
971  $this->tpl->setContent($tbl->getHTML());
972  return true;
973  }
$_GET["client_id"]
$tbl
Definition: example_048.php:81
+ Here is the call graph for this function:

◆ stopUserOfflineMode()

ilObjSCORMLearningModuleGUI::stopUserOfflineMode ( )
protected

Stop offline mode for selected users.

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

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

1047  {
1048  if(!count((array) $_POST['user']))
1049  {
1050  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1051  $this->ctrl->redirect($this,'offlineModeManager');
1052  }
1053  // display confirmation message
1054  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1055  $cgui = new ilConfirmationGUI();
1056  $cgui->setFormAction($this->ctrl->getFormAction($this));
1057  $cgui->setHeaderText($this->lng->txt("info_stop_offline_mode_sure"));
1058  $cgui->setCancel($this->lng->txt("cancel"), "cancelStopUserOfflineMode");
1059  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedStopUserOfflineMode");
1060  foreach($_POST["user"] as $id)
1061  {
1062  if (ilObject::_exists($id) && ilObject::_lookUpType($id)=="usr" )
1063  {
1064  $user = new ilObjUser($id);
1065  $caption = ilUtil::getImageTagByType("sahs_offline", $this->tpl->tplPath).
1066  " ".$this->lng->txt("stop_user_offline_mode_for_user").
1067  ": ".$user->getLastname().", ".$user->getFirstname();
1068  $cgui->addItem("user[]", $id, $caption);
1069  }
1070  }
1071  $this->tpl->setContent($cgui->getHTML());
1072  }
$_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 30 of file class.ilObjSCORMLearningModuleGUI.php.

◆ EXPORT_SELECTED

const ilObjSCORMLearningModuleGUI::EXPORT_SELECTED = 2

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

◆ EXPORT_TYPE_RAW

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_RAW = 1

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

◆ EXPORT_TYPE_SUCCESS

const ilObjSCORMLearningModuleGUI::EXPORT_TYPE_SUCCESS = 2

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

◆ EXPORT_UNDEF

const ilObjSCORMLearningModuleGUI::EXPORT_UNDEF = 0

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


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