ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjSAHSLearningModuleGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 require_once "./Services/Object/classes/class.ilObjectGUI.php";
4 require_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
5 
18 {
24  function __construct($a_data,$a_id,$a_call_by_reference, $a_prepare_output = true)
25  {
26  global $lng;
27 
28  $lng->loadLanguageModule("content");
29  $this->type = "sahs";
30  parent::__construct($a_data,$a_id,$a_call_by_reference,false);
31  }
32 
36  function executeCommand()
37  {
38  global $ilAccess, $ilTabs, $ilErr;
39 
40  $GLOBALS["ilLog"]->write ("bc:".$_GET["baseClass"]."; nc:".$this->ctrl->getNextClass($this)."; cmd:".$this->ctrl->getCmd());
41  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
42  strtolower($_GET["baseClass"]) == "ilsahspresentationgui" ||
43  $this->getCreationMode() == true)
44  {
45  $this->prepareOutput();
46  }
47  else
48  {
49  $this->getTemplate();
50  $this->setLocator();
51  $this->setTabs();
52  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
53  $this->tpl->setTitle($this->object->getTitle());
54  }
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58 
59  switch($next_class)
60  {
61  case 'ilobjectmetadatagui':
62  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
63  {
64  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
65  }
66  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
67  $md_gui = new ilObjectMetaDataGUI($this->object);
68  $this->ctrl->forwardCommand($md_gui);
69  break;
70 
71  case 'ilexportgui':
72  case 'ilpermissiongui':
73  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
74  $perm_gui = new ilPermissionGUI($this);
75  $ret = $this->ctrl->forwardCommand($perm_gui);
76  break;
77 
78  case "ilfilesystemgui":
79  $this->fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
80  $this->fs_gui->setUseUploadDirectory(true);
81  $this->fs_gui->setTableId("sahsfs".$this->object->getId());
82  $ret = $this->ctrl->forwardCommand($this->fs_gui);
83  break;
84 
85  case "ilcertificategui":
86  $this->setSettingsSubTabs();
87  $ilTabs->setSubTabActive('certificate');
88  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
89  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
90  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
91  $ret = $this->ctrl->forwardCommand($output_gui);
92  break;
93 
94  case "illearningprogressgui":
95  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
96 
98  $this->ctrl->forwardCommand($new_gui);
99 
100  break;
101 
102  case 'illicensegui':
103  include_once("./Services/License/classes/class.ilLicenseGUI.php");
104  $license_gui = new ilLicenseGUI($this);
105  $ret = $this->ctrl->forwardCommand($license_gui);
106  break;
107 
108  case "ilinfoscreengui":
109  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
110 
111  $info = new ilInfoScreenGUI($this);
112  $info->enablePrivateNotes();
113  $info->enableLearningProgress();
114 
115  // add read / back button
116  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
117  {
118  if (!$this->object->getEditable())
119  {
120  $info->addButton($this->lng->txt("view"),
121  "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->object->getRefID(),
122  ' target="ilContObj'.$this->object->getId().'" ');
123  }
124  }
125 
126  $info->enableNews();
127  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
128  {
129  $info->enableNewsEditing();
130  $news_set = new ilSetting("news");
131  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
132  if ($enable_internal_rss)
133  {
134  $info->setBlockProperty("news", "settings", true);
135  }
136  }
137  // show standard meta data section
138  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
139 
140  // forward the command
141  $this->ctrl->forwardCommand($info);
142  break;
143 
144  case "ilcommonactiondispatchergui":
145  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
147  $this->ctrl->forwardCommand($gui);
148  break;
149 
150  case "ilobjstylesheetgui":
151  //$this->addLocations();
152  $this->ctrl->setReturn($this, "properties");
153  $ilTabs->clearTargets();
154  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
155  $style_gui->omitLocator();
156  if ($cmd == "create" || $_GET["new_type"]=="sty")
157  {
158  $style_gui->setCreationMode(true);
159  }
160  //$ret =& $style_gui->executeCommand();
161 
162  if ($cmd == "confirmedDelete")
163  {
164  $this->object->setStyleSheetId(0);
165  $this->object->update();
166  }
167  $ret = $this->ctrl->forwardCommand($style_gui);
168  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
169  {
170  $style_id = $ret;
171  $this->object->setStyleSheetId($style_id);
172  $this->object->update();
173  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
174  }
175  break;
176  default:
177  if ($this->object && !$this->object->getEditable())
178  {
179  $cmd = $this->ctrl->getCmd("properties");
180  }
181  else
182  {
183  $cmd = $this->ctrl->getCmd("frameset");
184  }
185  if ((strtolower($_GET["baseClass"]) == "iladministrationgui" ||
186  $this->getCreationMode() == true) &&
187  $cmd != "frameset")
188  {
189  $cmd.= "Object";
190  }
191 
192  // #9225
193  if($cmd == "redrawHeaderAction")
194  {
195  $cmd .= "Object";
196  }
197 
198  $ret = $this->$cmd();
199  break;
200  }
201  }
202 
203 
204  function viewObject()
205  {
206  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
207  {
208  parent::viewObject();
209  }
210  else
211  {
212  }
213  }
214 
218  function properties()
219  {
220  }
221 
225  function saveProperties()
226  {
227  }
228 
232 
236  function initCreationForms($a_new_type)
237  {
238  $forms = array();
239 
240  $this->initUploadForm();
241  $forms[self::CFORM_IMPORT] = $this->form;
242 
243  $this->initCreationForm();
244  $forms[self::CFORM_NEW] = $this->form;
245 
246  return $forms;
247  }
248 
254  public function initCreationForm()
255  {
256  global $lng, $ilCtrl;
257 
258  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
259  $this->form = new ilPropertyFormGUI();
260 
261  // title
262  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
263  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
264  $ti->setMaxLength(ilObject::TITLE_LENGTH);
265  $ti->setRequired(true);
266  $this->form->addItem($ti);
267 
268  // text area
269  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
270  $ta->setCols(40);
271  $ta->setRows(2);
272  $this->form->addItem($ta);
273 
274 
275  $this->form->addCommandButton("save", $lng->txt("create"));
276  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
277 
278  $this->form->setTitle($lng->txt("scorm_new"));
279  $this->form->setFormAction($ilCtrl->getFormAction($this));
280  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
281  }
282 
286  public function initUploadForm()
287  {
288  global $lng, $ilCtrl;
289 
290  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
291  $this->form = new ilPropertyFormGUI();
292 
293  // type selection
294  $options = array(
295  "scorm2004" => $lng->txt("lm_type_scorm2004"),
296  "scorm" => $lng->txt("lm_type_scorm"),
297  "exportFile" => $lng->txt("sahs_export_file")
298  );
299  $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
300  $si->setOptions($options);
301  $this->form->addItem($si);
302 
303  // input file
304  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
305  $fi->setRequired(true);
306  $this->form->addItem($fi);
307 
308  // todo "uploaded file"
309  // todo wysiwyg editor removement
310 
311  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
313  {
314  $options = array();
315  $fi->setRequired(false);
317  $options[""] = $this->lng->txt("cont_select_from_upload_dir");
318  foreach($files as $file)
319  {
320  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
321  $options[$file] = $file;
322  }
323  //
324  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
325  $si->setOptions($options);
326  $this->form->addItem($si);
327  }
328 
329 
330  // validate file
331  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
332  $cb->setValue("y");
333  //$cb->setChecked(true);
334  $this->form->addItem($cb);
335 
336  // import for editing
337  $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
338  $cb->setValue("y");
339  $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
340  $this->form->addItem($cb);
341 
342  //
343  $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
344  $radg->setValue(0);
345  $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0,$lng->txt("sahs_std_sequencing_info"));
346  $radg->addOption($op1);
347  $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1,$lng->txt("sahs_import_sequencing_info"));
348  $radg->addOption($op1);
349  $cb->addSubItem($radg);
350 
351 
352  $this->form->addCommandButton("upload", $lng->txt("import"));
353  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
354 
355  $this->form->setTitle($lng->txt("import_sahs"));
356  $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
357  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
358  }
359 
366  function uploadObject()
367  {
368  global $_FILES, $rbacsystem;
369 
370  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
371 
372  // check create permission
373  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs"))
374  {
375  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
376  }
377  elseif ($_FILES["scormfile"]["name"])
378  {
379  // check if file was uploaded
380  $source = $_FILES["scormfile"]["tmp_name"];
381  if (($source == 'none') || (!$source))
382  {
383  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
384  }
385  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
386  switch ($__FILES["scormfile"]["error"])
387  {
388  case UPLOAD_ERR_INI_SIZE:
389  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
390  break;
391 
392  case UPLOAD_ERR_FORM_SIZE:
393  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
394  break;
395 
396  case UPLOAD_ERR_PARTIAL:
397  $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
398  break;
399 
400  case UPLOAD_ERR_NO_FILE:
401  $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
402  break;
403  }
404 
405  $file = pathinfo($_FILES["scormfile"]["name"]);
406  }
407  elseif ($_POST["uploaded_file"])
408  {
409  // check if the file is in the upload directory and readable
410  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
411  {
412  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
413  }
414 
415  $file = pathinfo($_POST["uploaded_file"]);
416  }
417  else
418  {
419  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
420  }
421 
422  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
423  if ($name == "")
424  {
425  $name = $this->lng->txt("no_title");
426  }
427 
428  $subType = $_POST["sub_type"];
429  // create and insert object in objecttree
430  switch ($subType)
431  {
432  case "scorm2004":
433  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
434  $newObj = new ilObjSCORM2004LearningModule();
435  $newObj->setEditable($_POST["editable"]=='y');
436  $newObj->setImportSequencing($_POST["import_sequencing"]);
437  $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
438  break;
439 
440  case "scorm":
441  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
442  $newObj = new ilObjSCORMLearningModule();
443  break;
444 
445  case "exportFile":
446  $sFile = $_FILES["scormfile"];
447  $fType = $sFile["type"];
448  $cFileTypes = ["application/zip", "application/x-compressed"];
449 
450  if (in_array ($fType, $cFileTypes))
451  {
452  $timeStamp = time();
453  $tempFile = $sFile["tmp_name"];
454  $lmDir = ilUtil::getWebspaceDir ("filesystem")."/lm_data/";
455  $lmTempDir = $lmDir . $timeStamp;
456  if (!file_exists ($lmTempDir)) mkdir ($lmTempDir, 0755, true);
457  $zar = new ZipArchive();
458  $zar->open ($tempFile);
459  $zar->extractTo ($lmTempDir);
460  $zar->close();
461  require_once "./Modules/ScormAicc/classes/class.ilScormAiccImporter.php";
462  $importer = new ilScormAiccImporter ();
463  if ($importer->importXmlRepresentation("sahs", Null, $lmTempDir, "") == true)
464  $importFromXml = true;
465  $mprops = [];
466  $mprops = $importer->moduleProperties;
467  $fed = $mprops["Fourth_edition"][0];
468  if ($fed == "n")
469  {
470  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
471  $newObj = new ilObjSCORMLearningModule();
472  $subType = "scorm";
473  }
474  else
475  {
476  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
477  $newObj = new ilObjSCORM2004LearningModule();
478  $newObj->setEditable($_POST["editable"]=='y');
479  $newObj->setImportSequencing($_POST["import_sequencing"]);
480  $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
481  $subType = "scorm2004";
482  }
483  }
484  break;
485  }
486 
487  $newObj->setTitle($name);
488  $newObj->setSubType($_POST["sub_type"]);
489  $newObj->setDescription("");
490  $newObj->create(true);
491  $newObj->createReference();
492  $newObj->putInTree($_GET["ref_id"]);
493  $newObj->setPermissions($_GET["ref_id"]);
494 
495  // create data directory, copy file to directory
496  $newObj->createDataDirectory();
497 
498  if ($_FILES["scormfile"]["name"])
499  {
500  if ($importFromXml)
501  {
502  $lmTempDir = $lmDir . $timeStamp;
503  $scormFile = $importer->manifest["scormFile"][0];
504  $scormFilePath = $lmTempDir . "/" . $scormFile;
505  $targetPath = $newObj->getDataDirectory()."/".$scormFile;
506  $file_path = $targetPath;
507  require_once('./Services/Utilities/classes/class.ilFileUtils.php');
508  ilFileUtils::rename ($scormFilePath, $targetPath);
509  }
510  else
511  {
512  // copy uploaded file to data directory
513  $file_path = $newObj->getDataDirectory()."/".$_FILES["scormfile"]["name"];
514 
515  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],
516  $_FILES["scormfile"]["name"], $file_path);
517  }
518  }
519  else
520  {
521  // copy uploaded file to data directory
522  $file_path = $newObj->getDataDirectory()."/". $_POST["uploaded_file"];
523 
524  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
525  }
526 
527  ilUtil::unzip($file_path);
528  ilUtil::renameExecutables($newObj->getDataDirectory());
529 
530  $title = $newObj->readObject();
531  if ($title != "")
532  {
533  ilObject::_writeTitle($newObj->getId(), $title);
534  /*$md = new ilMD($newObj->getId(),0, $newObj->getType());
535  if(is_object($md_gen = $md->getGeneral()))
536  {
537  $md_gen->setTitle($title);
538  $md_gen->update();
539  }*/
540  }
541 
542  //auto set learning progress settings
543  switch ($_POST["sub_type"])
544  {
545  case "scorm2004":
546  case "scorm":
547  case "exportFile":
548  $newObj->setLearningProgressSettingsAtUpload();
549  break;
550  }
551 
552  if ($importFromXml)
553  {
554  $importer->writeData("sahs", "5.1.0", $newObj->getId());
555  }
556 
557  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
558  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
559  }
560 
561  function upload()
562  {
563  $this->uploadObject();
564  }
565 
566 
567 
571  function saveObject()
572  {
573  if (trim($_POST["title"]) == "")
574  {
575  $this->ilias->raiseError($this->lng->txt("msg_no_title"),$this->ilias->error_obj->MESSAGE);
576  }
577 
578  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
579  $newObj = new ilObjSCORM2004LearningModule();
580  $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
581  $newObj->setSubType("scorm2004");
582  $newObj->setEditable(true);
583  $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
584  $newObj->create();
585  $newObj->createReference();
586  $newObj->putInTree($_GET["ref_id"]);
587  $newObj->setPermissions($_GET["ref_id"]);
588  $newObj->createDataDirectory();
589  $newObj->createScorm2004Tree();
590  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
591  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
592  }
593 
594 
598  function info()
599  {
600  $this->infoObject();
601  }
602 
606  function owner()
607  {
608  $this->ownerObject();
609  }
610 
614  function getTemplate()
615  {
616  global $lng;
617 
618  $this->tpl->getStandardTemplate();
619  }
620 
624  function setTabs()
625  {
626  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
627  $this->tpl->setTitle($this->object->getTitle());
628  if(strtolower($_GET["baseClass"]) == "ilsahseditgui") $this->getTabs($this->tabs_gui);
629  //if(strtolower($_GET["baseClass"]) == "ilsahseditgui") $this->getTabs();
630  }
631 
635  function certificate()
636  {
637  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
638  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
639  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
640  $output_gui->certificateEditor();
641  }
642 
648  function getTabs()
649  {
650  global $rbacsystem, $ilCtrl, $ilHelp;
651 
652  if ($this->ctrl->getCmd() == "delete")
653  {
654  return;
655  }
656 
657  switch ($this->object->getSubType())
658  {
659  case "scorm2004":
660  $ilHelp->setScreenIdComponent("sahs13");
661  break;
662 
663  case "scorm":
664  $ilHelp->setScreenIdComponent("sahs12");
665  break;
666  }
667 
668  // file system gui tabs
669  // properties
670  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
671  $this->tabs_gui->addTarget("cont_list_files",
672  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "",
673  "ilfilesystemgui");
674  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
675 
676  // info screen
677  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui")
678  ? true
679  : false;
680  $this->tabs_gui->addTarget("info_short",
681  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
682  "ilinfoscreengui", "", $force_active);
683 
684  // properties
685  $this->tabs_gui->addTarget("settings",
686  $this->ctrl->getLinkTarget($this, "properties"), array("", "properties"),
687  get_class($this));
688 
689  // learning progress and offline mode
690  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
691  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
692  {
693  //if scorm && offline_mode activated
694  if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
695  if ($this->object->getOfflineMode() == true) {
696  $this->tabs_gui->addTarget("offline_mode_manager",
697  $this->ctrl->getLinkTarget($this, "offlineModeManager"),
698  "offlineModeManager",
699  "ilobjscormlearningmodulegui");
700  }
701  }
702 
703  $this->tabs_gui->addTarget('learning_progress',
704  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''),
705  '',
706  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
707  }
708 
709  // tracking data
710  if($rbacsystem->checkAccess("read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess("edit_learning_progress", $this->object->getRefId()))
711  {
712  if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
713  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
714  $privacy = ilPrivacySettings::_getInstance();
715  if($privacy->enabledSahsProtocolData())
716  {
717  $this->tabs_gui->addTarget("cont_tracking_data",
718  $this->ctrl->getLinkTarget($this, "showTrackingItems"), "showTrackingItems",
719  get_class($this));
720  }
721  }
722  }
723  include_once("Services/License/classes/class.ilLicenseAccess.php");
724  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId())
726  {
727  $this->tabs_gui->addTarget("license",
728  $this->ctrl->getLinkTargetByClass('illicensegui', ''),
729  "", "illicensegui");
730  }
731 
732  // edit meta
733  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
734  $mdgui = new ilObjectMetaDataGUI($this->object);
735  $mdtab = $mdgui->getTab();
736  if($mdtab)
737  {
738  $this->tabs_gui->addTarget("meta_data",
739  $mdtab,
740  "", "ilmdeditorgui");
741  }
742 
743  // export
744  if ($rbacsystem->checkAccess("edit_permission", "", $this->object->getRefId()))
745  {
746  $this->tabs_gui->addTarget("export",
747  $this->ctrl->getLinkTarget($this, "export"), array("", "export"),
748  get_class($this));
749  }
750 
751  // perm
752  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
753  {
754  $this->tabs_gui->addTarget("perm_settings",
755  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
756  }
757  }
758 
762  public static function _goto($a_target)
763  {
764  global $ilAccess, $ilErr, $lng;
765 
766  $parts = explode("_", $a_target);
767 
768  if ($ilAccess->checkAccess("write", "", $parts[0]))
769  {
770  $_GET["cmd"] = "";
771  $_GET["baseClass"] = "ilSAHSEditGUI";
772  $_GET["ref_id"] = $parts[0];
773  $_GET["obj_id"] = $parts[1];
774  include("ilias.php");
775  exit;
776  }
777  if ($ilAccess->checkAccess("visible", "", $parts[0]) || $ilAccess->checkAccess("read", "", $parts[0]))
778  {
779  $_GET["cmd"] = "infoScreen";
780  $_GET["baseClass"] = "ilSAHSPresentationGUI";
781  $_GET["ref_id"] = $parts[0];
782  include("ilias.php");
783  exit;
784  }
785  else
786  {
787  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
788  {
789  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
792  }
793  }
794 
795  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
796  }
797 
798  function addLocatorItems()
799  {
800  global $ilLocator;
801 
802  if (is_object($this->object))
803  {
804  $ilLocator->addItem($this->object->getTitle(),
805  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
806  }
807  }
808 
815  function editContent()
816  {
817  global $ilCtrl;
818 
819  if (!$this->object->getEditable())
820  {
821  $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
822  }
823  else
824  {
825  $ilCtrl->redirectByClass("ilobjscorm2004learningmodulegui", "editOrganization");
826  }
827  }
828 
833  {
834  global $lng, $ilTabs, $ilCtrl;
835 
836  $ilTabs->addSubTabTarget("cont_settings",
837  $this->ctrl->getLinkTarget($this, "properties"), array("edit", ""),
838  get_class($this));
839 
840  $ilTabs->addSubTabTarget("cont_sc_new_version",
841  $this->ctrl->getLinkTarget($this, "newModuleVersion"), array("edit", ""),
842  get_class($this));
843 
844  include_once "Services/Certificate/classes/class.ilCertificate.php";
846  {
847  // // create and insert object in objecttree
848  // $ilTabs->addSubTabTarget("certificate",
849  // $this->ctrl->getLinkTarget($this, "certificate"),
850  // array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
851  // "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
852  // );
853  $ilTabs->addSubTabTarget(
854  "certificate",
855  $this->ctrl->getLinkTargetByClass("ilcertificategui", "certificateeditor"),
856  "", "ilcertificategui");
857  }
858 
859  $ilTabs->setTabActive('settings');
860  }
861 
862  public function export()
863  {
864  global $lng, $ilTabs, $ilCtrl, $tpl;
865  $ilTabs->activateTab("export");
866  include_once("./Services/Export/classes/class.ilExportGUI.php");
867  $exp_gui = new ilExportGUI($this);
868  $ilCtrl->setCmd("");
869  $exp_gui->addFormat("xml");
870  $ret = $this->ctrl->forwardCommand($exp_gui);
871  return $ret;
872  }
873 
874  public function exportModule()
875  {
876  global $ilDB;
877 
878  $moduleId = ilObject::_lookupObjectId($_GET["ref_id"]);
879  require_once "./Modules/ScormAicc/classes/class.ilScormAiccExporter.php";
880  $exporter = new ilScormAiccExporter();
881  $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", $moduleId);
882  }
883 
884  function getType()
885  {
886  return "sahs";
887  }
888 } // END class.ilObjSAHSLearningModule
889 ?>
$files
Definition: add-vimline.php:18
global $ilErr
Definition: raiseError.php:16
This class represents an option in a radio group.
ILIAS Setting Class.
Class ilObjectMetaDataGUI.
Class ilInfoScreenGUI.
saveObject()
save new learning module to db
This class represents a selection list property in a property form.
This class represents a property form user interface.
SCORM/AICC/HACP Learning Modules.
const TITLE_LENGTH
max length of object title
$_GET["client_id"]
This class represents a file property in a property form.
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
certificate()
Shows the certificate editor.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
getTemplate()
output main header (title and locator)
This class represents a checkbox property in a property form.
static _writeTitle($a_obj_id, $a_title)
write title to db (static)
static _lookupTitle($a_id)
lookup object title
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
setUseUploadDirectory($a_val)
Set use upload directory.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
static _lookupObjectId($a_ref_id)
lookup object id
global $ilCtrl
Definition: ilias.php:18
static rename($a_source, $a_target)
Rename a file.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _goto($a_target)
goto target course
$info
Definition: example_052.php:80
prepareOutput($a_show_subobjects=true)
prepare output
owner()
show owner of learning module
This class represents a property in a property form.
if(!is_array($argv)) $options
addSubItem($a_item)
Add Subitem.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
setValue($a_value)
Set Value.
omitLocator($a_omit=true)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
GUI class to create PDF certificates.
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
initCreationForms($a_new_type)
no manual SCORM creation, only import at the time
static _getFrame($a_class, $a_type='')
Get content frame name.
Create new PHPExcel object
obj_idprivate
Class ilObjStyleSheetGUI.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
Class ilObjSCORM2004LearningModule.
This class represents a text area property in a property form.
global $ilDB
$ret
Definition: parser.php:6
getCreationMode()
get creation mode
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
File System Explorer GUI class.
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)
static getWebspaceDir($mode="filesystem")
get webspace directory
Class ilObjUserTrackingGUI.
Class ilObjSCORMLearningModule.
$_POST["username"]
setRequired($a_required)
Set Required.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setLocator()
set Locator
uploadObject()
display status information or report errors messages in case of error