ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjSAHSLearningModuleGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once "classes/class.ilObjectGUI.php";
5 require_once("classes/class.ilFileSystemGUI.php");
6 require_once("classes/class.ilTabsGUI.php");
7 
20 {
26  function ilObjSAHSLearningModuleGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output = true)
27  {
28  global $lng;
29 
30  $lng->loadLanguageModule("content");
31  $this->type = "sahs";
32  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
33  #$this->tabs_gui =& new ilTabsGUI();
34 
35  }
36 
40  function &executeCommand()
41  {
42  global $ilAccess, $ilTabs;
43 
44  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
45  $this->getCreationMode() == true)
46  {
47  $this->prepareOutput();
48  }
49  else
50  {
51  $this->getTemplate();
52  $this->setLocator();
53  $this->setTabs();
54  }
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58 
59  switch($next_class)
60  {
61  case 'ilmdeditorgui':
62 
63  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
64 
65  $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
66  $md_gui->addObserver($this->object,'MDUpdateListener','General');
67 
68  $this->ctrl->forwardCommand($md_gui);
69  break;
70 
71  case 'ilpermissiongui':
72  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
73  $perm_gui =& new ilPermissionGUI($this);
74  $ret =& $this->ctrl->forwardCommand($perm_gui);
75  break;
76 
77  case "ilfilesystemgui":
78  $this->fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
79  $this->fs_gui->setTableId("sahsfs".$this->object->getId());
80  $ret =& $this->ctrl->forwardCommand($this->fs_gui);
81  break;
82 
83  case "ilcertificategui":
84  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
85  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
86  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
87  $ret =& $this->ctrl->forwardCommand($output_gui);
88  break;
89 
90  case "illearningprogressgui":
91  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
92 
93  $new_gui =& new ilLearningProgressGUI(LP_MODE_REPOSITORY,$this->object->getRefId());
94  $this->ctrl->forwardCommand($new_gui);
95 
96  break;
97 
98  case 'illicensegui':
99  include_once("./Services/License/classes/class.ilLicenseGUI.php");
100  $license_gui =& new ilLicenseGUI($this);
101  $ret =& $this->ctrl->forwardCommand($license_gui);
102  break;
103 
104  case "ilinfoscreengui":
105  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
106 
107  $info = new ilInfoScreenGUI($this);
108  $info->enablePrivateNotes();
109  $info->enableLearningProgress();
110 
111  // add read / back button
112  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
113  {
114  if (!$this->object->getEditable())
115  {
116  $info->addButton($this->lng->txt("view"),
117  "ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id=".$this->object->getRefID(),
118  ' target="ilContObj'.$this->object->getId().'" ');
119  }
120  }
121 
122  $info->enableNews();
123  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
124  {
125  $info->enableNewsEditing();
126  $news_set = new ilSetting("news");
127  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
128  if ($enable_internal_rss)
129  {
130  $info->setBlockProperty("news", "settings", true);
131  }
132  }
133  // show standard meta data section
134  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
135 
136  // forward the command
137  $this->ctrl->forwardCommand($info);
138  break;
139 
140  case "ilcommonactiondispatchergui":
141  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
143  $this->ctrl->forwardCommand($gui);
144  break;
145 
146  case "ilobjstylesheetgui":
147  //$this->addLocations();
148  $this->ctrl->setReturn($this, "properties");
149  $ilTabs->clearTargets();
150  $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
151  $style_gui->omitLocator();
152  if ($cmd == "create" || $_GET["new_type"]=="sty")
153  {
154  $style_gui->setCreationMode(true);
155  }
156  //$ret =& $style_gui->executeCommand();
157 
158  if ($cmd == "confirmedDelete")
159  {
160  $this->object->setStyleSheetId(0);
161  $this->object->update();
162  }
163  $ret =& $this->ctrl->forwardCommand($style_gui);
164  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
165  {
166  $style_id = $ret;
167  $this->object->setStyleSheetId($style_id);
168  $this->object->update();
169  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
170  }
171  break;
172  default:
173  $cmd = $this->ctrl->getCmd("frameset");
174  if ((strtolower($_GET["baseClass"]) == "iladministrationgui" ||
175  $this->getCreationMode() == true) &&
176  $cmd != "frameset")
177  {
178  $cmd.= "Object";
179  }
180 
181  // #9225
182  if($cmd == "redrawHeaderAction")
183  {
184  $cmd .= "Object";
185  }
186 
187  $ret =& $this->$cmd();
188  break;
189  }
190  }
191 
192 
193  function viewObject()
194  {
195  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
196  {
198  }
199  else
200  {
201  }
202  }
203 
207  function properties()
208  {
209  }
210 
214  function saveProperties()
215  {
216  }
217 
221 
225  function initCreationForms($a_new_type)
226  {
227  $forms = array();
228 
229  $this->initUploadForm();
230  $forms[self::CFORM_IMPORT] = $this->form;
231 
232  $this->initCreationForm();
233  $forms[self::CFORM_NEW] = $this->form;
234 
235  return $forms;
236  }
237 
243  public function initCreationForm()
244  {
245  global $lng, $ilCtrl;
246 
247  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
248  $this->form = new ilPropertyFormGUI();
249 
250  // title
251  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
252  $ti->setMaxLength(128);
253  $ti->setSize(40);
254  $ti->setRequired(true);
255  $this->form->addItem($ti);
256 
257  // text area
258  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
259  $ta->setCols(40);
260  $ta->setRows(2);
261  $this->form->addItem($ta);
262 
263 
264  $this->form->addCommandButton("save", $lng->txt("create"));
265  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
266 
267  $this->form->setTitle($lng->txt("scorm_new"));
268  $this->form->setFormAction($ilCtrl->getFormAction($this));
269  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
270  }
271 
275  public function initUploadForm()
276  {
277  global $lng, $ilCtrl;
278 
279  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
280  $this->form = new ilPropertyFormGUI();
281 
282  // type selection
283  $options = array(
284  "scorm2004" => $lng->txt("lm_type_scorm2004"),
285  "scorm" => $lng->txt("lm_type_scorm"),
286  "aicc" => $lng->txt("lm_type_aicc"),
287  "hacp" => $lng->txt("lm_type_hacp")
288  );
289  $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
290  $si->setOptions($options);
291  $this->form->addItem($si);
292 
293  // input file
294  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
295  $fi->setRequired(true);
296  $this->form->addItem($fi);
297 
298  // todo "uploaded file"
299  // todo wysiwyg editor removement
300 
301  include_once 'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
303  {
304  $options = array();
305  $fi->setRequired(false);
307  $options[""] = $this->lng->txt("cont_select_from_upload_dir");
308  foreach($files as $file)
309  {
310  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
311  $options[$file] = $file;
312  }
313  //
314  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
315  $si->setOptions($options);
316  $this->form->addItem($si);
317  }
318 
319 
320  // validate file
321  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
322  $cb->setValue("y");
323  $cb->setChecked(true);
324  $this->form->addItem($cb);
325 
326  // import for editing
327  $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
328  $cb->setValue("y");
329  $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
330  $this->form->addItem($cb);
331 
332  //
333  $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
334  $radg->setValue(0);
335  $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0,$lng->txt("sahs_std_sequencing_info"));
336  $radg->addOption($op1);
337  $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1,$lng->txt("sahs_import_sequencing_info"));
338  $radg->addOption($op1);
339  $cb->addSubItem($radg);
340 
341 
342  $this->form->addCommandButton("upload", $lng->txt("import"));
343  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
344 
345  $this->form->setTitle($lng->txt("import_sahs"));
346  $this->form->setFormAction($ilCtrl->getFormAction($this));
347  $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
348  }
349 
353  function cancelObject($in_rep = false)
354  {
355  ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
356  //$this->ctrl->redirectByClass("ilrepositorygui", "frameset");
357  }
358 
364 /* DEPRECATED
365  function importObject()
366  {
367 
368  // display import form
369  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.slm_import.html", "Modules/ScormAicc");
370 
371  $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_slm.gif'));
372  $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
373 
374  $this->ctrl->setParameter($this, "new_type", "sahs");
375  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
376 
377  $this->tpl->setVariable("BTN_NAME", "save");
378  $this->tpl->setVariable("TARGET", ' target="'.ilFrameTargetInfo::_getFrame("MainContent").'" ');
379 
380  $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
381  $this->tpl->setVariable("TXT_TYPE_AICC", $this->lng->txt("lm_type_aicc"));
382  $this->tpl->setVariable("TXT_TYPE_HACP", $this->lng->txt("lm_type_hacp"));
383  $this->tpl->setVariable("TXT_TYPE_SCORM", $this->lng->txt("lm_type_scorm"));
384 
385  $this->tpl->setVariable("TXT_TYPE_SCORM2004", $this->lng->txt("lm_type_scorm2004"));
386 
387  $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
388  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
389  $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
390  $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
391  $this->tpl->setVariable("TXT_VALIDATE_FILE", $this->lng->txt("cont_validate_file"));
392 
393  // get the value for the maximal uploadable filesize from the php.ini (if available)
394  $umf=get_cfg_var("upload_max_filesize");
395  // get the value for the maximal post data from the php.ini (if available)
396  $pms=get_cfg_var("post_max_size");
397 
398  //convert from short-string representation to "real" bytes
399  $multiplier_a=array("K"=>1024, "M"=>1024*1024, "G"=>1024*1024*1024);
400 
401  $umf_parts=preg_split("/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
402  $pms_parts=preg_split("/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
403 
404  if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
405  if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
406 
407  // use the smaller one as limit
408  $max_filesize=min($umf, $pms);
409 
410  if (!$max_filesize) $max_filesize=max($umf, $pms);
411 
412  //format for display in mega-bytes
413  $max_filesize=sprintf("%.1f MB",$max_filesize/1024/1024);
414 
415  // gives out the limit as a little notice
416  $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." $max_filesize");
417  }
418 */
419 
426  function uploadObject()
427  {
428  global $_FILES, $rbacsystem;
429 
430  include_once 'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
431 
432  // check create permission
433  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs"))
434  {
435  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
436  }
437  elseif ($_FILES["scormfile"]["name"])
438  {
439  // check if file was uploaded
440  $source = $_FILES["scormfile"]["tmp_name"];
441  if (($source == 'none') || (!$source))
442  {
443  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
444  }
445  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
446  switch ($__FILES["scormfile"]["error"])
447  {
448  case UPLOAD_ERR_INI_SIZE:
449  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
450  break;
451 
452  case UPLOAD_ERR_FORM_SIZE:
453  $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
454  break;
455 
456  case UPLOAD_ERR_PARTIAL:
457  $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
458  break;
459 
460  case UPLOAD_ERR_NO_FILE:
461  $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
462  break;
463  }
464 
465  $file = pathinfo($_FILES["scormfile"]["name"]);
466  }
467  elseif ($_POST["uploaded_file"])
468  {
469  // check if the file is in the upload directory and readable
470  if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"]))
471  {
472  $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
473  }
474 
475  $file = pathinfo($_POST["uploaded_file"]);
476  }
477  else
478  {
479  $this->ilias->raiseError($this->lng->txt("msg_no_file"),$this->ilias->error_obj->MESSAGE);
480  }
481 
482  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
483  if ($name == "")
484  {
485  $name = $this->lng->txt("no_title");
486  }
487 
488  // create and insert object in objecttree
489  switch ($_POST["sub_type"])
490  {
491 
492  case "scorm2004":
493  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
494  $newObj = new ilObjSCORM2004LearningModule();
495  $newObj->setEditable($_POST["editable"]=='y');
496  $newObj->setImportSequencing($_POST["import_sequencing"]);
497  $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
498  break;
499 
500  case "scorm":
501  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
502  $newObj = new ilObjSCORMLearningModule();
503  break;
504 
505  case "aicc":
506  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
507  $newObj = new ilObjAICCLearningModule();
508  break;
509 
510  case "hacp":
511  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
512  $newObj = new ilObjHACPLearningModule();
513  break;
514  }
515 
516  $newObj->setTitle($name);
517  $newObj->setSubType($_POST["sub_type"]);
518  $newObj->setDescription("");
519  $newObj->create(true);
520  $newObj->createReference();
521  $newObj->putInTree($_GET["ref_id"]);
522  $newObj->setPermissions($_GET["ref_id"]);
523  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
524 
525  // create data directory, copy file to directory
526  $newObj->createDataDirectory();
527 
528  if ($_FILES["scormfile"]["name"])
529  {
530  // copy uploaded file to data directory
531  $file_path = $newObj->getDataDirectory()."/".$_FILES["scormfile"]["name"];
532 
533  ilUtil::moveUploadedFile($_FILES["scormfile"]["tmp_name"],
534  $_FILES["scormfile"]["name"], $file_path);
535  }
536  else
537  {
538  // copy uploaded file to data directory
539  $file_path = $newObj->getDataDirectory()."/". $_POST["uploaded_file"];
540 
541  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
542  }
543 
544  ilUtil::unzip($file_path);
545  ilUtil::renameExecutables($newObj->getDataDirectory());
546 
547  $title = $newObj->readObject();
548  if ($title != "")
549  {
550  ilObject::_writeTitle($newObj->getId(), $title);
551  /*$md = new ilMD($newObj->getId(),0, $newObj->getType());
552  if(is_object($md_gen = $md->getGeneral()))
553  {
554  $md_gen->setTitle($title);
555  $md_gen->update();
556  }*/
557  }
558 
559  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
560  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
561  }
562 
563  function upload()
564  {
565  $this->uploadObject();
566  }
567 
568 
569 
573  function saveObject()
574  {
575  if (trim($_POST["title"]) == "")
576  {
577  $this->ilias->raiseError($this->lng->txt("msg_no_title"),$this->ilias->error_obj->MESSAGE);
578  }
579 
580  include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
581  $newObj = new ilObjSCORM2004LearningModule();
582  $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
583  $newObj->setSubType("scorm2004");
584  $newObj->setEditable(true);
585  $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
586  $newObj->create();
587  $newObj->createReference();
588  $newObj->putInTree($_GET["ref_id"]);
589  $newObj->setPermissions($_GET["ref_id"]);
590  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
591  $newObj->createDataDirectory();
592  $newObj->createScorm2004Tree();
593  ilUtil::sendInfo( $this->lng->txt($newObj->getType()."_added"), true);
594  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
595  }
596 
597 
601  function info()
602  {
603  $this->infoObject();
604  }
605 
609  function owner()
610  {
611  $this->ownerObject();
612  }
613 
617  function getTemplate()
618  {
619  global $lng;
620 
621  $this->tpl->getStandardTemplate();
622  }
623 
624 
630  function frameset()
631  {
632  $this->tpl = new ilTemplate("tpl.sahs_edit_frameset.html", false, false, "Modules/ScormAicc");
633  $this->tpl->setVariable("SRC",
634  $this->ctrl->getLinkTarget($this, "properties"));
635  $this->tpl->show("DEFAULT", false);
636  exit;
637  }
638 
642  function setTabs()
643  {
644  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm_b.gif"));
645  $this->tpl->setTitle($this->object->getTitle());
646  $this->getTabs($this->tabs_gui);
647  }
648 
652  function certificate()
653  {
654  include_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
655  include_once "./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
656  $output_gui = new ilCertificateGUI(new ilSCORMCertificateAdapter($this->object));
657  $output_gui->certificateEditor();
658  }
659 
665  function getTabs(&$tabs_gui)
666  {
667  global $rbacsystem, $ilUser, $ilCtrl;
668 
669  if ($this->ctrl->getCmd() == "delete")
670  {
671  return;
672  }
673 
674  // file system gui tabs
675  // properties
676  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
677  $tabs_gui->addTarget("cont_list_files",
678  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "",
679  "ilfilesystemgui");
680  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
681 
682  // info screen
683  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui")
684  ? true
685  : false;
686  $tabs_gui->addTarget("info_short",
687  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "",
688  "ilinfoscreengui", "", $force_active);
689 
690  // properties
691  $tabs_gui->addTarget("settings",
692  $this->ctrl->getLinkTarget($this, "properties"), "properties",
693  get_class($this));
694 
695  // learning progress
696  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
697  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
698  {
699  $tabs_gui->addTarget('learning_progress',
700  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''),
701  '',
702  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
703  }
704 
705  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
706  $privacy = ilPrivacySettings::_getInstance();
707  if($privacy->enabledSahsProtocolData())
708  {
709  // tracking data
710  $tabs_gui->addTarget("cont_tracking_data",
711  $this->ctrl->getLinkTarget($this, "showTrackingItems"), "showTrackingItems",
712  get_class($this));
713  }
714 
715  // create and insert object in objecttree
716  switch ($this->object->getSubType())
717  {
718 
719  case "scorm2004":
720  case "scorm":
721  // certificate
722  $tabs_gui->addTarget("certificate",
723  $this->ctrl->getLinkTarget($this, "certificate"),
724  array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
725  "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
726  );
727  break;
728  }
729 
730  include_once("Services/License/classes/class.ilLicenseAccess.php");
731  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId())
733  {
734  $tabs_gui->addTarget("license",
735  $this->ctrl->getLinkTargetByClass('illicensegui', ''),
736  "", "illicensegui");
737  }
738 
739  // edit meta
740  $tabs_gui->addTarget("meta_data",
741  $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
742  "", "ilmdeditorgui");
743 
744  // perm
745  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
746  {
747  $tabs_gui->addTarget("perm_settings",
748  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
749  }
750  }
751 
755  function _goto($a_target)
756  {
757  global $ilAccess, $ilErr, $lng;
758 
759  $parts = explode("_", $a_target);
760 
761  if ($ilAccess->checkAccess("write", "", $parts[0]))
762  {
763  $_GET["cmd"] = "";
764  $_GET["baseClass"] = "ilSAHSEditGUI";
765  $_GET["ref_id"] = $parts[0];
766  $_GET["obj_id"] = $parts[1];
767  include("ilias.php");
768  exit;
769  }
770  if ($ilAccess->checkAccess("visible", "", $parts[0]))
771  {
772  $_GET["cmd"] = "infoScreen";
773  $_GET["baseClass"] = "ilSAHSPresentationGUI";
774  $_GET["ref_id"] = $parts[0];
775  include("ilias.php");
776  exit;
777  }
778  else
779  {
780  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
781  {
782  $_GET["cmd"] = "frameset";
783  $_GET["target"] = "";
784  $_GET["ref_id"] = ROOT_FOLDER_ID;
785  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
787  include("repository.php");
788  exit;
789  }
790  }
791 
792  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
793  }
794 
795  function addLocatorItems()
796  {
797  global $ilLocator;
798 
799  if (is_object($this->object))
800  {
801  $ilLocator->addItem($this->object->getTitle(),
802  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
803  }
804  }
805 
806 } // END class.ilObjSAHSLearningModule
807 ?>