ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObject2GUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Object/classes/class.ilObjectGUI.php");
5 
28 abstract class ilObject2GUI extends ilObjectGUI
29 {
30  protected $object_id;
31  protected $node_id;
32  protected $creation_forms = array();
33  protected $id_type = array();
34  protected $parent_id;
35  public $tree;
36  protected $access_handler;
37 
38  const OBJECT_ID = 0;
39  const REPOSITORY_NODE_ID = 1;
40  const WORKSPACE_NODE_ID = 2;
44 
52  function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
53  {
54  global $objDefinition, $tpl, $ilCtrl, $ilErr, $lng, $ilTabs, $tree, $ilAccess;
55 
56  if (!isset($ilErr))
57  {
58  $ilErr = new ilErrorHandling();
59  $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
60  }
61  else
62  {
63  $this->ilErr =& $ilErr;
64  }
65 
66  $this->id_type = $a_id_type;
67  $this->parent_id = $a_parent_node_id;
68  $this->type = $this->getType();
69  $this->html = "";
70 
71  // use globals instead?
72  $this->tabs_gui = $ilTabs;
73  $this->objDefinition = $objDefinition;
74  $this->tpl = $tpl;
75  $this->ctrl = $ilCtrl;
76  $this->lng = $lng;
77 
78  $params = array();
79  switch($this->id_type)
80  {
81  case self::REPOSITORY_NODE_ID:
82  $this->node_id = $a_id;
83  $this->object_id = ilObject::_lookupObjectId($this->node_id);
84  $this->tree = $tree;
85  $this->access_handler = $ilAccess;
86  $this->call_by_reference = true; // needed for prepareOutput()
87  $params[] = "ref_id";
88  break;
89 
90  case self::REPOSITORY_OBJECT_ID:
91  $this->object_id = $a_id;
92  $this->tree = $tree;
93  $this->access_handler = $ilAccess;
94  $params[] = "obj_id"; // ???
95  break;
96 
97  case self::WORKSPACE_NODE_ID:
98  global $ilUser;
99  $this->node_id = $a_id;
100  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
101  $this->tree = new ilWorkspaceTree($ilUser->getId());
102  $this->object_id = $this->tree->lookupObjectId($this->node_id);
103  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
104  $this->access_handler = new ilWorkspaceAccessHandler($this->tree);
105  $params[] = "wsp_id";
106  break;
107 
108  case self::WORKSPACE_OBJECT_ID:
109  global $ilUser;
110  $this->object_id = $a_id;
111  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
112  $this->tree = new ilWorkspaceTree($ilUser->getId());
113  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
114  $this->access_handler = new ilWorkspaceAccessHandler($this->tree);
115  $params[] = "obj_id"; // ???
116  break;
117 
118  case self::PORTFOLIO_OBJECT_ID:
119  $this->object_id = $a_id;
120  include_once('./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
121  $this->access_handler = new ilPortfolioAccessHandler();
122  $params[] = "prt_id";
123  break;
124 
125  case self::OBJECT_ID:
126  $this->object_id = $a_id;
127  include_once "Services/Object/classes/class.ilDummyAccessHandler.php";
128  $this->access_handler = new ilDummyAccessHandler();
129  $params[] = "obj_id";
130  break;
131  }
132  $this->ctrl->saveParameter($this, $params);
133 
134 
135 
136  // old stuff for legacy code (obsolete?)
137  if(!$this->object_id)
138  {
139  $this->creation_mode = true;
140  }
141  if($this->node_id)
142  {
143  // add parent node id if missing
144  if(!$this->parent_id && $this->tree)
145  {
146  $this->parent_id = $this->tree->getParentId($this->node_id);
147  }
148  }
149  $this->ref_id = $this->node_id;
150  $this->obj_id = $this->object_id;
151 
152 
153 
154  $this->assignObject();
155 
156  // set context
157  if (is_object($this->object))
158  {
159  $this->ctrl->setContext($this->object->getId(), $this->object->getType());
160  }
161 
162  $this->afterConstructor();
163  }
164 
168  protected function afterConstructor()
169  {
170  }
171 
175  function &executeCommand()
176  {
177  global $rbacsystem;
178 
179  $next_class = $this->ctrl->getNextClass($this);
180  $cmd = $this->ctrl->getCmd();
181 
182  $this->prepareOutput();
183 
184  switch($next_class)
185  {
186  case "ilworkspaceaccessgui";
187  if($this->node_id)
188  {
189  $this->tabs_gui->activateTab("id_permissions");
190 
191  include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
192  $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler());
193  $this->ctrl->forwardCommand($wspacc);
194  break;
195  }
196 
197  default:
198  if(!$cmd)
199  {
200  $cmd = "render";
201  }
202  return $this->$cmd();
203  }
204 
205  return true;
206  }
207 
211  final protected function assignObject()
212  {
213  if ($this->object_id != 0)
214  {
215  switch($this->id_type)
216  {
217  case self::OBJECT_ID:
218  case self::REPOSITORY_OBJECT_ID:
219  case self::WORKSPACE_OBJECT_ID:
220  case self::PORTFOLIO_OBJECT_ID:
221  $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
222  break;
223 
224  case self::REPOSITORY_NODE_ID:
225  $this->object = ilObjectFactory::getInstanceByRefId($this->node_id);
226  break;
227 
228  case self::WORKSPACE_NODE_ID:
229  // to be discussed
230  $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
231  break;
232  }
233  }
234  }
235 
241  protected function getAccessHandler()
242  {
243  return $this->access_handler;
244  }
245 
249  final protected function setLocator()
250  {
251  global $ilLocator, $tpl;
252 
253  if ($this->omit_locator)
254  {
255  return;
256  }
257 
258  switch($this->id_type)
259  {
260  case self::REPOSITORY_NODE_ID:
261  $ref_id = $this->node_id
262  ? $this->node_id
264  $ilLocator->addRepositoryItems($ref_id);
265 
266  // not so nice workaround: todo: handle $ilLocator as tabs in ilTemplate
267  if ($_GET["admin_mode"] == "" &&
268  strtolower($this->ctrl->getCmdClass()) == "ilobjrolegui")
269  {
270  $this->ctrl->setParameterByClass("ilobjrolegui",
271  "rolf_ref_id", $_GET["rolf_ref_id"]);
272  $this->ctrl->setParameterByClass("ilobjrolegui",
273  "obj_id", $_GET["obj_id"]);
274  $ilLocator->addItem($this->lng->txt("role"),
275  $this->ctrl->getLinkTargetByClass(array("ilpermissiongui",
276  "ilobjrolegui"), "perm"));
277  }
278 
279  // in workspace this is done in ilPersonalWorkspaceGUI
280  if($this->object_id)
281  {
282  $this->addLocatorItems();
283  }
284  $tpl->setLocator();
285 
286  break;
287 
288  case self::WORKSPACE_NODE_ID:
289  // :TODO:
290  break;
291  }
292 
293 
294  }
295 
299  public function delete()
300  {
301  switch($this->id_type)
302  {
303  case self::REPOSITORY_NODE_ID:
304  case self::REPOSITORY_OBJECT_ID:
305  return parent::deleteObject();
306 
307  case self::WORKSPACE_NODE_ID:
308  case self::WORKSPACE_OBJECT_ID:
309  return $this->deleteConfirmation();
310 
311  case self::OBJECT_ID:
312  case self::PORTFOLIO_OBJECT_ID:
313  // :TODO: should this ever occur?
314  break;
315  }
316  }
317 
323  protected function deleteConfirmation()
324  {
325  global $lng, $tpl, $objDefinition;
326 
327  $node_id = (int)$_REQUEST["item_ref_id"];
328  if (!$node_id)
329  {
330  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
331  $this->ctrl->redirect($this, "");
332  }
333 
334  // on cancel or fail we return to parent node
335  $parent_node = $this->tree->getParentId($node_id);
336  $this->ctrl->setParameter($this, "wsp_id", $parent_node);
337 
338  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
339  $cgui = new ilConfirmationGUI();
340  $cgui->setHeaderText($lng->txt("info_delete_sure")."<br/>".
341  $lng->txt("info_delete_warning_no_trash"));
342 
343  $cgui->setFormAction($this->ctrl->getFormAction($this));
344  $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
345  $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
346 
347  $a_ids = array($node_id);
348  foreach ($a_ids as $node_id)
349  {
350  $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
351  foreach($children as $child)
352  {
353  $node_id = $child["wsp_id"];
354  $obj_id = $this->tree->lookupObjectId($node_id);
356  $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
357 
358  // if anything fails, abort the whole process
359  if(!$this->checkPermissionBool("delete", "", "", $node_id))
360  {
361  ilUtil::sendFailure($lng->txt("msg_no_perm_delete")." ".$title, true);
362  $this->ctrl->redirect($this);
363  }
364 
365  $cgui->addItem("id[]", $node_id, $title,
366  ilObject::_getIcon($obj_id, "small", $type),
367  $lng->txt("icon")." ".$lng->txt("obj_".$type));
368  }
369  }
370 
371  $tpl->setContent($cgui->getHTML());
372  }
373 
377  public function confirmedDelete()
378  {
379  switch($this->id_type)
380  {
381  case self::REPOSITORY_NODE_ID:
382  case self::REPOSITORY_OBJECT_ID:
384 
385  case self::WORKSPACE_NODE_ID:
386  case self::WORKSPACE_OBJECT_ID:
387  return $this->deleteConfirmedObjects();
388 
389  case self::OBJECT_ID:
390  case self::PORTFOLIO_OBJECT_ID:
391  // :TODO: should this ever occur?
392  break;
393  }
394  }
395 
401  protected function deleteConfirmedObjects()
402  {
403  global $lng, $objDefinition;
404 
405  if(sizeof($_POST["id"]))
406  {
407  foreach($_POST["id"] as $node_id)
408  {
409  $node = $this->tree->getNodeData($node_id);
410 
411  // tree/reference
412  $this->tree->deleteReference($node_id);
413  $this->tree->deleteTree($node);
414 
415  // permission
416  $this->getAccessHandler()->removePermission($node_id);
417 
418  // object
419  $object = ilObjectFactory::getInstanceByObjId($node["obj_id"], false);
420  if($object)
421  {
422  $object->delete();
423  }
424  }
425 
426  ilUtil::sendSuccess($lng->txt("msg_removed"), true);
427  }
428  else
429  {
430  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
431  }
432 
433  $this->ctrl->redirect($this, "");
434  }
435 
436  public function getHTML() { return parent::getHTML(); }
437 
441  final public function withReferences() { return parent::withReferences(); }
442  final public function setCreationMode($a_mode = true) { return parent::setCreationMode($a_mode); }
443  final public function getCreationMode() { return parent::getCreationMode(); }
444  final protected function prepareOutput() { return parent::prepareOutput(); }
445  protected function setTitleAndDescription() { return parent::setTitleAndDescription(); }
446  final protected function showUpperIcon() { return parent::showUpperIcon(); }
447 // final private function showMountWebfolderIcon() { return parent::showMountWebfolderIcon(); }
448  final protected function omitLocator($a_omit = true) { return parent::omitLocator($a_omit); }
449  final protected function getTargetFrame($a_cmd, $a_target_frame = "") { return parent::getTargetFrame($a_cmd, $a_target_frame); }
450  final protected function setTargetFrame($a_cmd, $a_target_frame) { return parent::setTargetFrame($a_cmd, $a_target_frame); }
451  final public function isVisible() { return parent::isVisible(); }
452  final protected function getCenterColumnHTML() { return parent::getCenterColumnHTML(); }
453  final protected function getRightColumnHTML() { return parent::getRightColumnHTML(); }
454  final protected function setColumnSettings($column_gui) { return parent::setColumnSettings($column_gui); }
455  final protected function checkPermission($a_perm, $a_cmd = "") { return parent::checkPermission($a_perm, $a_cmd); }
456 
457  // -> ilContainerGUI
458  final protected function showPossibleSubObjects() { return parent::showPossibleSubObjects(); }
459  // -> ilRepUtilGUI
460  final public function trash() { return parent::trashObject(); } // done
461  // -> ilRepUtil
462  final public function undelete() { return parent::undeleteObject(); } // done
463  final public function cancelDelete() { return parent::cancelDeleteObject(); } // ok
464  final public function removeFromSystem() { return parent::removeFromSystemObject(); } // done
465  final protected function redirectToRefId() { return parent::redirectToRefId(); } // ok
466 
467  // -> stefan
468  final protected function fillCloneTemplate($a_tpl_varname,$a_type) { return parent::fillCloneTemplate($a_tpl_varname,$a_type); }
469  final protected function fillCloneSearchTemplate($a_tpl_varname,$a_type) { return parent::fillCloneSearchTemplate($a_tpl_varname,$a_type); }
470  final protected function searchCloneSource() { return parent::searchCloneSourceObject(); }
471  final public function cloneAll() { return parent::cloneAllObject(); }
472  final protected function buildCloneSelect($existing_objs) { return parent::buildCloneSelect($existing_objs); }
473 
474  // -> ilAdministration
475  final private function displayList() { return parent::displayList(); }
476 // final private function setAdminTabs() { return parent::setAdminTabs(); }
477 // final public function getAdminTabs($a) { return parent::getAdminTabs($a); }
478  final protected function addAdminLocatorItems() { return parent::addAdminLocatorItems(); }
479 
483  public function view()
484  {
485  switch($this->id_type)
486  {
487  case self::REPOSITORY_NODE_ID:
488  case self::REPOSITORY_OBJECT_ID:
489  return parent::viewObject();
490 
491  case self::WORKSPACE_NODE_ID:
492  case self::WORKSPACE_OBJECT_ID:
493  return $this->render();
494 
495  case self::OBJECT_ID:
496  case self::PORTFOLIO_OBJECT_ID:
497  // :TODO: should this ever occur? do nothing or edit() ?!
498  break;
499  }
500  }
501 
507  protected function setTabs()
508  {
509  global $ilTabs, $lng;
510 
511  switch($this->id_type)
512  {
513  case self::REPOSITORY_NODE_ID:
514  case self::REPOSITORY_OBJECT_ID:
515  if ($this->checkPermissionBool("edit_permission"))
516  {
517  $ilTabs->addTab("id_permissions",
518  $lng->txt("perm_settings"),
519  $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilpermissiongui"), "perm"));
520  }
521  break;
522 
523  case self::WORKSPACE_NODE_ID:
524  case self::WORKSPACE_OBJECT_ID:
525  // only files and blogs can be shared for now
526  if ($this->checkPermissionBool("edit_permission") && in_array($this->type, array("file", "blog")) && $this->node_id)
527  {
528  $ilTabs->addTab("id_permissions",
529  $lng->txt("wsp_permissions"),
530  $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilworkspaceaccessgui"), "share"));
531  }
532  break;
533  }
534  }
535 
539 // final private function setSubObjects() { die("ilObject2GUI::setSubObjects() is deprecated."); }
540 // final public function getFormAction() { die("ilObject2GUI::getFormAction() is deprecated."); }
541 // final protected function setFormAction() { die("ilObject2GUI::setFormAction() is deprecated."); }
542  final protected function getReturnLocation() { die("ilObject2GUI::getReturnLocation() is deprecated."); }
543  final protected function setReturnLocation() { die("ilObject2GUI::setReturnLocation() is deprecated."); }
544  final protected function showActions() { die("ilObject2GUI::showActions() is deprecated."); }
545  final protected function getTitlesByRefId() { die("ilObject2GUI::getTitlesByRefId() is deprecated."); }
546  final protected function getTabs() {nj(); die("ilObject2GUI::getTabs() is deprecated."); }
547  final protected function __showButton() { die("ilObject2GUI::__showButton() is deprecated."); }
548  final protected function hitsperpageObject() { die("ilObject2GUI::hitsperpageObject() is deprecated."); }
549  final protected function __initTableGUI() { die("ilObject2GUI::__initTableGUI() is deprecated."); }
550  final protected function __setTableGUIBasicData() { die("ilObject2GUI::__setTableGUIBasicData() is deprecated."); }
551 
555  protected function addLocatorItems() {}
556 
560  abstract function getType();
561 
565 // final private function permObject() { parent::permObject(); }
566 // final private function permSaveObject() { parent::permSaveObject(); }
567 // final private function infoObject() { parent::infoObject(); }
568 // final private function __buildRoleFilterSelect() { parent::__buildRoleFilterSelect(); }
569 // final private function __filterRoles() { parent::__filterRoles(); }
570 // final private function ownerObject() { parent::ownerObject(); }
571 // final private function changeOwnerObject() { parent::changeOwnerObject(); }
572 // final private function addRoleObject() { parent::addRoleObject(); }
573 // final private function setActions() { die("ilObject2GUI::setActions() is deprecated."); }
574 // final protected function getActions() { die("ilObject2GUI::getActions() is deprecated."); }
575 
579  public function create() { parent::createObject(); }
580  public function save() { parent::saveObject(); }
581  public function edit() { parent::editObject(); }
582  public function update() { parent::updateObject(); }
583  public function cancel() { parent::cancelObject(); }
584 
593  protected function initCreationForms($a_new_type)
594  {
595  $forms = parent::initCreationForms($a_new_type);
596 
597  // cloning doesn't work in workspace yet
598  if($this->id_type == self::WORKSPACE_NODE_ID)
599  {
600  unset($forms[self::CFORM_CLONE]);
601  }
602 
603  return $forms;
604  }
605 
611  function importFile()
612  {
613  parent::importFileObject($this->parent_id);
614  }
615 
622  protected function putObjectInTree(ilObject $a_obj, $a_parent_node_id = null)
623  {
624  global $rbacreview, $ilUser, $objDefinition;
625 
626  $this->object_id = $a_obj->getId();
627 
628  if(!$a_parent_node_id)
629  {
630  $a_parent_node_id = $this->parent_id;
631  }
632 
633  // add new object to custom parent container
634  if((int)$_REQUEST["crtptrefid"])
635  {
636  $a_parent_node_id = (int)$_REQUEST["crtptrefid"];
637  }
638 
639  switch($this->id_type)
640  {
641  case self::REPOSITORY_NODE_ID:
642  case self::REPOSITORY_OBJECT_ID:
643  if(!$this->node_id)
644  {
645  $a_obj->createReference();
646  $this->node_id = $a_obj->getRefId();
647  }
648  $a_obj->putInTree($a_parent_node_id);
649  $a_obj->setPermissions($a_parent_node_id);
650 
651  // rbac log
652  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
653  $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id, false);
654  $rbac_log = ilRbacLog::gatherFaPa($this->node_id, array_keys($rbac_log_roles), true);
655  ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $this->node_id, $rbac_log);
656 
657  $this->ctrl->setParameter($this, "ref_id", $this->node_id);
658  break;
659 
660  case self::WORKSPACE_NODE_ID:
661  case self::WORKSPACE_OBJECT_ID:
662  if(!$this->node_id)
663  {
664  $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
665  }
666  $this->getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
667 
668  $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
669  break;
670 
671  case self::OBJECT_ID:
672  case self::PORTFOLIO_OBJECT_ID:
673  // do nothing
674  break;
675  }
676 
677  // BEGIN ChangeEvent: Record save object.
678  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
679  ilChangeEvent::_recordWriteEvent($this->object_id, $ilUser->getId(), 'create');
680  // END ChangeEvent: Record save object.
681 
682  // use forced callback after object creation
683  self::handleAfterSaveCallback($a_obj, $_REQUEST["crtcb"]);
684  }
685 
692  public static function handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
693  {
694  global $objDefinition;
695 
696  $a_callback_ref_id = (int)$a_callback_ref_id;
697  if($a_callback_ref_id)
698  {
699  $callback_type = ilObject::_lookupType($a_callback_ref_id, true);
700  $class_name = "ilObj".$objDefinition->getClassName($callback_type)."GUI";
701  $location = $objDefinition->getLocation($callback_type);
702  include_once($location."/class.".$class_name.".php");
703  if (in_array(strtolower($class_name), array("ilobjitemgroupgui")))
704  {
705  $callback_obj = new $class_name($a_callback_ref_id);
706  }
707  else
708  {
709  $callback_obj = new $class_name(null, $a_callback_ref_id, true, false);
710  }
711  $callback_obj->afterSaveCallback($a_obj);
712  }
713  }
714 
724  protected function checkPermissionBool($a_perm, $a_cmd = "", $a_type = "", $a_node_id = null)
725  {
726  global $ilUser;
727 
728  if($a_perm == "create")
729  {
730  if(!$a_node_id)
731  {
732  $a_node_id = $this->parent_id;
733  }
734  if($a_node_id)
735  {
736  return $this->getAccessHandler()->checkAccess($a_perm."_".$a_type, $a_cmd, $a_node_id);
737  }
738  }
739  else
740  {
741 
742  if (!$a_node_id)
743  {
744  $a_node_id = $this->node_id;
745  }
746  if($a_node_id)
747  {
748  return $this->getAccessHandler()->checkAccess($a_perm, $a_cmd, $a_node_id);
749  }
750  }
751 
752  // if we do not have a node id, check if current user is owner
753  if($this->obj_id && $this->object->getOwner() == $ilUser->getId())
754  {
755  return true;
756  }
757  return false;
758  }
759 
767  protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
768  {
769  global $ilAccess;
770 
771  if($this->id_type == self::WORKSPACE_NODE_ID)
772  {
773  if(!$this->creation_mode && $this->object_id)
774  {
775  include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
777  $this->getAccessHandler(), $this->getType(), $this->node_id, $this->object_id);
778 
779  $dispatcher->setSubObject($a_sub_type, $a_sub_id);
780 
781  include_once "Services/Object/classes/class.ilObjectListGUI.php";
782  ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
783  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
784  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
785 
786  $lg = $dispatcher->initHeaderAction();
787 
788  if(is_object($lg))
789  {
790  // to enable add to desktop / remove from desktop
791  if($this instanceof ilDesktopItemHandling)
792  {
793  $lg->setContainerObject($this);
794  }
795 
796  // for activation checks see ilObjectGUI
797  // $lg->enableComments(true);
798  $lg->enableNotes(true);
799  // $lg->enableTags(true);
800  }
801 
802  return $lg;
803  }
804  }
805  else
806  {
807  return parent::initHeaderAction();
808  }
809  }
810 
814  protected function redrawHeaderAction()
815  {
817  }
818 
819  protected function getPermanentLinkWidget($a_append = null, $a_center = false)
820  {
821  if($this->id_type == self::WORKSPACE_NODE_ID)
822  {
823  $a_append .= "_wsp";
824  }
825 
826  include_once('Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
827  $plink = new ilPermanentLinkGUI($this->getType(), $this->node_id , $a_append);
828  $plink->setIncludePermanentLinkText(false);
829  $plink->setAlignCenter($a_center);
830  return $plink->getHTML();
831  }
832 
833 
834  protected function handleAutoRating(ilObject $a_new_obj)
835  {
836  // only needed in repository
837  if($this->id_type == self::REPOSITORY_NODE_ID)
838  {
839  parent::handleAutoRating($a_new_obj);
840  }
841  }
842 }
843 
844 ?>