ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjFileBasedLMGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2009 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 
38 require_once("classes/class.ilObjectGUI.php");
39 require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
40 require_once("./Services/Table/classes/class.ilTableGUI.php");
41 require_once("classes/class.ilFileSystemGUI.php");
42 
44 {
46 
52  function ilObjFileBasedLMGUI($a_data,$a_id = 0,$a_call_by_reference = true, $a_prepare_output = true)
53  {
54  global $lng, $ilCtrl;
55 
56  $this->ctrl =& $ilCtrl;
57  $this->ctrl->saveParameter($this, array("ref_id"));
58 
59  #include_once("classes/class.ilTabsGUI.php");
60  #$this->tabs_gui =& new ilTabsGUI();
61 
62  $this->type = "htlm";
63  $lng->loadLanguageModule("content");
64 
65  parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
66  //$this->actions = $this->objDefinition->getActions("mep");
67  $this->output_prepared = $a_prepare_output;
68 
69  }
70 
74  function &executeCommand()
75  {
76  global $ilUser, $ilLocator;
77 
78  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
79  $this->getCreationMode() == true)
80  {
81  $this->prepareOutput();
82  }
83  else
84  {
85  $this->getTemplate();
86  $this->setLocator();
87  $this->setTabs();
88  }
89 
90  $next_class = $this->ctrl->getNextClass($this);
91  $cmd = $this->ctrl->getCmd();
92 
93  if(!$this->getCreationMode())
94  {
95  include_once 'payment/classes/class.ilPaymentObject.php';
96  if(ilPaymentObject::_isBuyable($_GET['ref_id']) &&
98  {
99  $this->tpl->getStandardTemplate();
100 
101  include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
102  $pp = new ilShopPurchaseGUI((int)$_GET['ref_id']);
103  $ret = $this->ctrl->forwardCommand($pp);
104  return true;
105  }
106  }
107 
108  switch($next_class)
109  {
110  case 'ilmdeditorgui':
111  $this->checkPermission("write");
112  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
113 
114  $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
115  $md_gui->addObserver($this->object,'MDUpdateListener','General');
116 
117  $this->ctrl->forwardCommand($md_gui);
118  break;
119 
120  case "ilfilesystemgui":
121  $this->checkPermission("write");
122  $fs_gui =& new ilFileSystemGUI($this->object->getDataDirectory());
123  $fs_gui->activateLabels(true, $this->lng->txt("cont_purpose"));
124  $fs_gui->setTableId("htlmfs".$this->object->getId());
125  if ($this->object->getStartFile() != "")
126  {
127  $fs_gui->labelFile($this->object->getStartFile(),
128  $this->lng->txt("cont_startfile"));
129  }
130  $fs_gui->addCommand($this, "setStartFile", $this->lng->txt("cont_set_start_file"));
131  $ret =& $this->ctrl->forwardCommand($fs_gui);
132  break;
133 
134  case "ilinfoscreengui":
135  $ret =& $this->outputInfoScreen();
136  break;
137 
138  case "illearningprogressgui":
139  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
140 
142  $this->object->getRefId(),
143  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
144  $this->ctrl->forwardCommand($new_gui);
145  $this->tabs_gui->setTabActive('learning_progress');
146  break;
147 
148  case 'ilpermissiongui':
149  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
150  $perm_gui =& new ilPermissionGUI($this);
151  $ret =& $this->ctrl->forwardCommand($perm_gui);
152  break;
153 
154  case 'illicensegui':
155  include_once("./Services/License/classes/class.ilLicenseGUI.php");
156  $license_gui =& new ilLicenseGUI($this);
157  $ret =& $this->ctrl->forwardCommand($license_gui);
158  break;
159 
160  default:
161  $cmd = $this->ctrl->getCmd("frameset");
162  if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
163  $this->getCreationMode() == true)
164  {
165  $cmd.= "Object";
166  }
167  $ret =& $this->$cmd();
168  break;
169  }
170  //$this->tpl->show();
171  }
172 
178  function createObject()
179  {
180  global $rbacsystem, $tpl;
181 
182  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
183 
184  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
185  {
186  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
187  }
188  else
189  {
190  $this->ctrl->setParameter($this, "new_type", $new_type);
191  $this->initEditForm("create", $new_type);
192  $tpl->setContent($this->form->getHTML());
193 
194  $tpl->setContent($this->form->getHTML().$clone_html);
195  }
196  }
197 
198 
204  function saveObject()
205  {
206  global $rbacsystem, $objDefinition, $tpl, $lng;
207 
208  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
209 
210  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
211  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
212  {
213  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
214  }
215  $this->ctrl->setParameter($this, "new_type", $new_type);
216  $this->initEditForm("create", $new_type);
217  if ($this->form->checkInput())
218  {
219 
220  $location = $objDefinition->getLocation($new_type);
221 
222  // create and insert object in objecttree
223  $class_name = "ilObj".$objDefinition->getClassName($new_type);
224  include_once($location."/class.".$class_name.".php");
225  $newObj = new $class_name();
226  $newObj->setType($new_type);
227  $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
228  $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
229  $newObj->create();
230  $newObj->createReference();
231  $newObj->putInTree($_GET["ref_id"]);
232  $newObj->setPermissions($_GET["ref_id"]);
233  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
234  $this->afterSave($newObj);
235  return;
236  }
237 
238  $this->form->setValuesByPost();
239  $tpl->setContent($this->form->getHtml());
240  }
241 
247  public function initEditForm($a_mode = "edit", $a_new_type = "")
248  {
249  global $lng, $ilCtrl;
250 
251  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
252  $this->form = new ilPropertyFormGUI();
253  $this->form->setTarget("_top");
254 
255  // title
256  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
257  $ti->setMaxLength(128);
258  $ti->setSize(40);
259  $ti->setRequired(true);
260  $this->form->addItem($ti);
261 
262  // description
263  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
264  $ta->setCols(40);
265  $ta->setRows(2);
266  $this->form->addItem($ta);
267 
268  // save and cancel commands
269  if ($a_mode == "create")
270  {
271  $this->form->addCommandButton("save", $lng->txt($a_new_type."_add"));
272  $this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
273  $this->form->setTitle($lng->txt($a_new_type."_new"));
274  }
275  else
276  {
277  $this->form->addCommandButton("update", $lng->txt("save"));
278  $this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
279  $this->form->setTitle($lng->txt("edit"));
280  }
281 
282  $this->form->setFormAction($ilCtrl->getFormAction($this));
283 
284  }
285 
289  function getEditFormValues()
290  {
291  $values["title"] = $this->object->getTitle();
292  $values["desc"] = $this->object->getDescription();
293  $this->form->setValuesByArray($values);
294  }
295 
301  final function cancelCreationObject($in_rep = false)
302  {
303  ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
304  }
305 
311  function properties()
312  {
313  global $rbacsystem, $tree, $tpl;
314 
315  // edit button
316  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
317 
318  // view link
319  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
320  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
321 
322  if ($startfile != "")
323  {
324  $this->tpl->setCurrentBlock("btn_cell");
325  $this->tpl->setVariable("BTN_LINK",
326  "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID());
327  $this->tpl->setVariable("BTN_TARGET"," target=\"ilContObj".$this->object->getID()."\" ");
328  $this->tpl->setVariable("BTN_TXT",$this->lng->txt("view"));
329  $this->tpl->parseCurrentBlock();
330  }
331 
332  // lm properties
333  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.fblm_properties.html",
334  'Modules/HTMLLearningModule');
335  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
336  $this->tpl->setVariable("TXT_PROPERTIES", $this->lng->txt("cont_lm_properties"));
337 
338  // online
339  $this->tpl->setVariable("TXT_ONLINE", $this->lng->txt("cont_online"));
340  $this->tpl->setVariable("CBOX_ONLINE", "cobj_online");
341  $this->tpl->setVariable("VAL_ONLINE", "y");
342  if ($this->object->getOnline())
343  {
344  $this->tpl->setVariable("CHK_ONLINE", "checked");
345  }
346 
347  // start file
348  $this->tpl->setVariable("TXT_START_FILE", $this->lng->txt("cont_startfile"));
349  if ($startfile != "")
350  {
351  $this->tpl->setVariable("VAL_START_FILE", basename($startfile));
352  }
353  else
354  {
355  $this->tpl->setVariable("VAL_START_FILE", $this->lng->txt("no_start_file"));
356  }
357  $this->tpl->setVariable("TXT_SET_START_FILE", $this->lng->txt("cont_set_start_file"));
358  $this->tpl->setVariable("LINK_SET_START_FILE",
359  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
360 
361  $this->tpl->setCurrentBlock("commands");
362  $this->tpl->setVariable("BTN_NAME", "saveProperties");
363  $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
364  $this->tpl->parseCurrentBlock();
365 
366  }
367 
371  function saveProperties()
372  {
373  $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
374  $this->object->update();
375  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
376  $this->ctrl->redirect($this, "properties");
377  }
378 
384  function editObject()
385  {
386  global $rbacsystem, $tree, $tpl;
387 
388  if (!$rbacsystem->checkAccess("visible,write",$this->object->getRefId()))
389  {
390  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
391  }
392 
393  // edit button
394  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
395 
396  }
397 
401  function edit()
402  {
403  $this->prepareOutput();
404  $this->editObject();
405  }
406 
410  function cancel()
411  {
412  //$this->setReturnLocation("cancel","fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"]);
413  $this->cancelObject();
414  }
415 
420  function afterSave($newObj)
421  {
422  // always send a message
423  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
424 
425  ilUtil::redirect("ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
426  }
427 
433  function cancelObject($in_rep = false)
434  {
435  ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
436  //$this->ctrl->redirectByClass("ilrepositorygui", "frameset");
437  }
438 
439 
443  function update()
444  {
445  //$this->setReturnLocation("update", "fblm_edit.php?cmd=listFiles&ref_id=".$_GET["ref_id"].
446  // "&obj_id=".$_GET["obj_id"]);
447  $this->updateObject();
448  }
449 
450 
451  function setStartFile($a_file)
452  {
453  $this->object->setStartFile($a_file);
454  $this->object->update();
455  $this->ctrl->redirectByClass("ilfilesystemgui", "listFiles");
456  }
457 
461  function perm()
462  {
463  $this->setFormAction("permSave", "fblm_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
464  "&obj_id=".$_GET["obj_id"]);
465  $this->setFormAction("addRole", "fblm_edit.php?ref_id=".$_GET["ref_id"].
466  "&obj_id=".$_GET["obj_id"]."&cmd=addRole");
467  $this->permObject();
468  }
469 
473  function saveBibItemObject($a_target = "")
474  {
475  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
476  $bib_gui =& new ilBibItemGUI();
477  $bib_gui->setObject($this->object);
478  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
479  $bibItemIndex *= 1;
480  if ($bibItemIndex < 0)
481  {
482  $bibItemIndex = 0;
483  }
484  $bibItemIndex = $bib_gui->save($bibItemIndex);
485 
486  if ($a_target == "")
487  {
488  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
489  }
490 
491  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
492  }
493 
497  function saveBibItem()
498  {
499  // questionable workaround to make this old stuff work
500  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
501 
502  //$this->setTabs();
503  $this->saveBibItemObject($this->ctrl->getLinkTarget($this));
504  }
505 
509  function editBibItemObject($a_target = "")
510  {
511  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
512  $bib_gui =& new ilBibItemGUI();
513  $bib_gui->setObject($this->object);
514  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
515  $bibItemIndex *= 1;
516  if ($bibItemIndex < 0)
517  {
518  $bibItemIndex = 0;
519  }
520  if ($a_target == "")
521  {
522  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
523  }
524 
525  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
526  }
527 
531  function editBibItem()
532  {
533  // questionable workaround to make this old stuff work
534  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
535 
536  //$this->setTabs();
537  $this->editBibItemObject($this->ctrl->getLinkTarget($this));
538  }
539 
543  function deleteBibItemObject($a_target = "")
544  {
545  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
546  $bib_gui =& new ilBibItemGUI();
547  $bib_gui->setObject($this->object);
548  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
549  $bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
550  if (strpos($bibItemIndex, ",") > 0)
551  {
552  $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
553  }
554  if ($a_target == "")
555  {
556  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
557  }
558 
559  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
560  }
561 
565  function deleteBibItem()
566  {
567  // questionable workaround to make this old stuff work
568  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
569 
570  //$this->setTabs();
571  $this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
572  }
573 
577  function addBibItemObject($a_target = "")
578  {
579  $bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
580  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
581  if ($bibItemName == "BibItem")
582  {
583  include_once "./Modules/LearningModule/classes/class.ilBibItem.php";
584  $bib_item =& new ilBibItem();
585  $bib_item->setId($this->object->getId());
586  $bib_item->setType($this->object->getType());
587  $bib_item->read();
588  }
589 
590  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
591  $bib_gui =& new ilBibItemGUI();
592  $bib_gui->setObject($this->object);
593  if ($bibItemIndex == "")
594  $bibItemIndex = 0;
595  $bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
596 
597  //if ($bibItemName != "" && $bibItemName != "BibItem")
598  if ($bibItemName != "")
599  {
600  $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
601  $data = $bib_gui->bib_obj->getElement("BibItem");
602  $bibItemIndex = (count($data) - 1);
603  }
604  else
605  {
606  ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
607  }
608  if ($a_target == "")
609  {
610  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
611  }
612 
613  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
614  }
615 
619  function addBibItem()
620  {
621  // questionable workaround to make this old stuff work
622  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
623 
624  //$this->setTabs();
625  $this->addBibItemObject($this->ctrl->getLinkTarget($this));
626  }
627 
633  function frameset()
634  {
635  $this->tpl = new ilTemplate("tpl.fblm_edit_frameset.html", false, false,
636  "Modules/HTMLLearningModule");
637  $this->tpl->setVariable("HREF_FILES",$this->ctrl->getLinkTargetByClass(
638  "ilfilesystemgui", "listFiles"));
639  $this->tpl->show();
640  exit;
641  }
642 
646  function explorer()
647  {
648  $this->tpl = new ilTemplate("tpl.main.html", true, true);
649 
650  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
651 
652  $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
653 
654  require_once ("./Modules/HTMLLearningModule/classes/class.ilFileExplorer.php");
655  $exp = new ilFileExplorer($this->lm->getDataDirectory());
656 
657  }
658 
662  function getTemplate()
663  {
664  global $lng;
665 
666  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
667  //$this->tpl->setVariable("HEADER", $a_header_title);
668  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
669  //$this->tpl->setVariable("TXT_LOCATOR",$this->lng->txt("locator"));
670  }
671 
673  {
674  // Note license usage
675  include_once "Services/License/classes/class.ilLicense.php";
676  ilLicense::_noteAccess($this->object->getId());
677 
678  // Track access
679  include_once "Services/Tracking/classes/class.ilTracking.php";
680  ilTracking::_trackAccess($this->object->getId(),'htlm');
681 
682  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
683  $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
684  if ($startfile != "")
685  {
686  ilUtil::redirect($startfile);
687  }
688  }
689 
690  // InfoScreen methods
696  function infoScreen()
697  {
698  $this->ctrl->setCmd("showSummary");
699  $this->ctrl->setCmdClass("ilinfoscreengui");
700  $this->outputInfoScreen();
701  }
702 
706  function showInfoScreen()
707  {
708  $this->outputInfoScreen(true);
709  }
710 
714  function outputInfoScreen($a_standard_locator = true)
715  {
716  global $ilBench, $ilLocator, $ilAccess;
717 
718 
719  $this->tabs_gui->setTabActive('info_short');
720 
721  $this->lng->loadLanguageModule("meta");
722  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
723 
724  $info = new ilInfoScreenGUI($this);
725  $info->enablePrivateNotes();
726  $info->enableLearningProgress();
727 
728  $info->enableNews();
729  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
730  {
731  $info->enableNewsEditing();
732 
733  $news_set = new ilSetting("news");
734  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
735  if ($enable_internal_rss)
736  {
737  $info->setBlockProperty("news", "settings", true);
738  }
739  }
740 
741  // add read / back button
742  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
743  {
744  $info->addButton($this->lng->txt("view"),
745  "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
746  ' target="ilContObj'.$this->object->getId().'" ');
747  }
748 
749  // show standard meta data section
750  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
751 
752  // forward the command
753  $this->ctrl->forwardCommand($info);
754  }
755 
756 
757 
761  function setTabs()
762  {
763  $this->tpl->setCurrentBlock("header_image");
764  $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_lm_b.gif"));
765  $this->tpl->parseCurrentBlock();
766 
767  $this->getTabs($this->tabs_gui);
768  #$this->tpl->setVariable("TABS", $this->tabs_gui->getHTML());
769  $this->tpl->setVariable("HEADER", $this->object->getTitle());
770  }
771 
777  function getTabs(&$tabs_gui)
778  {
779  global $rbacsystem,$ilUser;
780 
781 
782  if($rbacsystem->checkAccess('write',$this->ref_id))
783  {
784  // properties
785  $tabs_gui->addTarget("cont_list_files",
786  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"), "",
787  "ilfilesystemgui");
788 
789  // info screen
790  $force_active = (strtolower($_GET["cmdClass"]) == "ilinfoscreengui"
791  || strtolower($_GET["cmdClass"]) == "ilnotegui")
792  ? true
793  : false;
794  $tabs_gui->addTarget("info_short",
795  $this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui",
796  "ilinfoscreengui"),
797  "showSummary"),
798  "infoScreen",
799  "",
800  "",
801  $force_active);
802 
803  // properties
804  $tabs_gui->addTarget("properties",
805  $this->ctrl->getLinkTarget($this, "properties"), "properties",
806  get_class($this));
807 
808  $tabs_gui->addTarget("meta_data",
809  $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
810  "", "ilmdeditorgui");
811 
812  // edit bib item information
813  $tabs_gui->addTarget("bib_data",
814  $this->ctrl->getLinkTarget($this, "editBibItem"),
815  array("editBibItem", "saveBibItem", "deleteBibItem", "addBibItem"),
816  get_class($this));
817  }
818 
819  // learning progress
820  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
821  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
822  {
823  $tabs_gui->addTarget('learning_progress',
824  $this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui','illearningprogressgui'),''),
825  '',
826  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
827  }
828 
829  include_once("Services/License/classes/class.ilLicenseAccess.php");
830  if ($rbacsystem->checkAccess('edit_permission',$this->ref_id)
832  {
833  $tabs_gui->addTarget("license",
834  $this->ctrl->getLinkTargetByClass('illicensegui', ''),
835  "", "illicensegui");
836  }
837 
838  // perm
839  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
840  {
841  $tabs_gui->addTarget("perm_settings",
842  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
843  }
844  }
845 
851  function _goto($a_target)
852  {
853  global $rbacsystem, $ilErr, $lng, $ilAccess;
854 
855  if ($ilAccess->checkAccess("visible", "", $a_target))
856  {
857  $_GET["ref_id"] = $a_target;
858  $_GET["cmd"] = "infoScreen";
859  include("repository.php");
860  exit;
861  }
862  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
863  {
864  $_GET["cmd"] = "frameset";
865  $_GET["target"] = "";
866  $_GET["ref_id"] = ROOT_FOLDER_ID;
867  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
869  include("repository.php");
870  exit;
871  }
872 
873  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
874  }
875 
876  function addLocatorItems()
877  {
878  global $ilLocator;
879 
880  if (is_object($this->object))
881  {
882  $ilLocator->addItem($this->object->getTitle(),
883  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"), "", $_GET["ref_id"]);
884  }
885  }
886 }
887 ?>