ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
4include_once("./Services/Object/classes/class.ilObjectGUI.php");
5
27abstract class ilObject2GUI extends ilObjectGUI
28{
29 protected $object_id;
30 protected $node_id;
31 protected $creation_forms = array();
32 protected $id_type = array();
33 protected $parent_id;
34 public $tree;
35 protected $access_handler;
36
37 const OBJECT_ID = 0;
43
51 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
52 {
53 global $DIC;
54
55 $objDefinition = $DIC["objDefinition"];
56 $tpl = $DIC["tpl"];
57 $ilCtrl = $DIC["ilCtrl"];
58 $ilErr = $DIC["ilErr"];
59 $lng = $DIC["lng"];
60 $ilTabs = $DIC["ilTabs"];
61 $tree = $DIC["tree"];
62 $ilAccess = $DIC["ilAccess"];
63
64 if (!isset($ilErr)) {
65 $ilErr = new ilErrorHandling();
66 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr,'errorHandler'));
67 } else {
68 $this->ilErr = $ilErr;
69 }
70
71 $this->id_type = $a_id_type;
72 $this->parent_id = $a_parent_node_id;
73 $this->type = $this->getType();
74 $this->html = "";
75
76 // use globals instead?
77 $this->tabs_gui = $ilTabs;
78 $this->objDefinition = $objDefinition;
79 $this->tpl = $tpl;
80 $this->ctrl = $ilCtrl;
81 $this->lng = $lng;
82
83 // these are things that are initialised in ilObjectGUI constructor now
84 // and may miss here
85 $this->locator = $DIC["ilLocator"];
86 $this->user = $DIC->user();
87 $this->access = $DIC->access();
88 //$this->settings = $DIC->settings();
89 //$this->rbacreview = $DIC->rbac()->review();
90 $this->toolbar = $DIC->toolbar();
91
92
93 $params = array();
94 switch ($this->id_type) {
96 $this->node_id = $a_id;
97 $this->object_id = ilObject::_lookupObjectId($this->node_id);
98 $this->tree = $tree;
99 $this->access_handler = $ilAccess;
100 $this->call_by_reference = true; // needed for prepareOutput()
101 $params[] = "ref_id";
102 break;
103
105 $this->object_id = $a_id;
106 $this->tree = $tree;
107 $this->access_handler = $ilAccess;
108 $params[] = "obj_id"; // ???
109 break;
110
112 $ilUser = $DIC["ilUser"];
113 $this->node_id = $a_id;
114 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
115 $this->tree = new ilWorkspaceTree($ilUser->getId());
116 $this->object_id = $this->tree->lookupObjectId($this->node_id);
117 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
118 $this->access_handler = new ilWorkspaceAccessHandler($this->tree);
119 $params[] = "wsp_id";
120 break;
121
123 $ilUser = $DIC["ilUser"];
124 $this->object_id = $a_id;
125 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
126 $this->tree = new ilWorkspaceTree($ilUser->getId());
127 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
128 $this->access_handler = new ilWorkspaceAccessHandler($this->tree);
129 $params[] = "obj_id"; // ???
130 break;
131
133 $this->object_id = $a_id;
134 include_once('./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
135 $this->access_handler = new ilPortfolioAccessHandler();
136 $params[] = "prt_id";
137 break;
138
139 case self::OBJECT_ID:
140 $this->object_id = $a_id;
141 include_once "Services/Object/classes/class.ilDummyAccessHandler.php";
142 $this->access_handler = new ilDummyAccessHandler();
143 $params[] = "obj_id";
144 break;
145 }
146 $this->ctrl->saveParameter($this, $params);
147
148
149
150 // old stuff for legacy code (obsolete?)
151 if (!$this->object_id) {
152 $this->creation_mode = true;
153 }
154 if ($this->node_id) {
155 // add parent node id if missing
156 if (!$this->parent_id && $this->tree) {
157 $this->parent_id = $this->tree->getParentId($this->node_id);
158 }
159 }
160 $this->ref_id = $this->node_id;
161 $this->obj_id = $this->object_id;
162
163
164
165 $this->assignObject();
166
167 // set context
168 if (is_object($this->object)) {
169 $this->ctrl->setContext($this->object->getId(), $this->object->getType());
170 }
171
172 $this->afterConstructor();
173 }
174
178 protected function afterConstructor()
179 {
180 }
181
185 public function executeCommand()
186 {
187 $next_class = $this->ctrl->getNextClass($this);
188 $cmd = $this->ctrl->getCmd();
189
190 $this->prepareOutput();
191
192 switch ($next_class) {
193 case "ilworkspaceaccessgui":
194 if ($this->node_id) {
195 $this->tabs_gui->activateTab("id_permissions");
196
197 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
198 $wspacc = new ilWorkspaceAccessGUI($this->node_id, $this->getAccessHandler());
199 $this->ctrl->forwardCommand($wspacc);
200 break;
201 }
202
203 // no break
204 default:
205 if (!$cmd) {
206 $cmd = "render";
207 }
208 return $this->$cmd();
209 }
210
211 return true;
212 }
213
217 final protected function assignObject()
218 {
219 if ($this->object_id != 0) {
220 switch ($this->id_type) {
221 case self::OBJECT_ID:
225 $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
226 break;
227
229 $this->object = ilObjectFactory::getInstanceByRefId($this->node_id);
230 break;
231
233 // to be discussed
234 $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
235 break;
236 }
237 }
238 }
239
245 protected function getAccessHandler()
246 {
248 }
249
253 protected function setLocator()
254 {
255 global $DIC;
256
257 $ilLocator = $DIC["ilLocator"];
258 $tpl = $DIC["tpl"];
259
260 if ($this->omit_locator) {
261 return;
262 }
263
264 switch ($this->id_type) {
266 $ref_id = $this->node_id
267 ? $this->node_id
269 $ilLocator->addRepositoryItems($ref_id);
270
271 // not so nice workaround: todo: handle $ilLocator as tabs in ilTemplate
272 if ($_GET["admin_mode"] == "" &&
273 strtolower($this->ctrl->getCmdClass()) == "ilobjrolegui") {
274 $this->ctrl->setParameterByClass(
275 "ilobjrolegui",
276 "rolf_ref_id",
277 $_GET["rolf_ref_id"]
278 );
279 $this->ctrl->setParameterByClass(
280 "ilobjrolegui",
281 "obj_id",
282 $_GET["obj_id"]
283 );
284 $ilLocator->addItem(
285 $this->lng->txt("role"),
286 $this->ctrl->getLinkTargetByClass(array("ilpermissiongui",
287 "ilobjrolegui"), "perm")
288 );
289 }
290
291 // in workspace this is done in ilPersonalWorkspaceGUI
292 if ($this->object_id) {
293 $this->addLocatorItems();
294 }
295 $tpl->setLocator();
296
297 break;
298
300 // :TODO:
301 break;
302 }
303 }
304
308 public function delete()
309 {
310 switch ($this->id_type) {
313 return parent::deleteObject();
314
317 return $this->deleteConfirmation();
318
319 case self::OBJECT_ID:
321 // :TODO: should this ever occur?
322 break;
323 }
324 }
325
331 protected function deleteConfirmation()
332 {
333 global $DIC;
334
335 $tpl = $DIC["tpl"];
336 $lng = $DIC["lng"];
337
338 $node_id = (int) $_REQUEST["item_ref_id"];
339 if (!$node_id) {
340 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
341 $this->ctrl->redirect($this, "");
342 }
343
344 // on cancel or fail we return to parent node
345 $parent_node = $this->tree->getParentId($node_id);
346 $this->ctrl->setParameter($this, "wsp_id", $parent_node);
347
348 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
349 $cgui = new ilConfirmationGUI();
350 $cgui->setHeaderText($lng->txt("info_delete_sure") . "<br/>" .
351 $lng->txt("info_delete_warning_no_trash"));
352
353 $cgui->setFormAction($this->ctrl->getFormAction($this));
354 $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
355 $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
356
357 $a_ids = array($node_id);
358 foreach ($a_ids as $node_id) {
359 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
360 foreach ($children as $child) {
361 $node_id = $child["wsp_id"];
362 $obj_id = $this->tree->lookupObjectId($node_id);
364 $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
365
366 // if anything fails, abort the whole process
367 if (!$this->checkPermissionBool("delete", "", "", $node_id)) {
368 ilUtil::sendFailure($lng->txt("msg_no_perm_delete") . " " . $title, true);
369 $this->ctrl->redirect($this);
370 }
371
372 $cgui->addItem(
373 "id[]",
374 $node_id,
375 $title,
377 $lng->txt("icon") . " " . $lng->txt("obj_" . $type)
378 );
379 }
380 }
381
382 $tpl->setContent($cgui->getHTML());
383 }
384
388 public function confirmedDelete()
389 {
390 switch ($this->id_type) {
393 return parent::confirmedDeleteObject();
394
397 return $this->deleteConfirmedObjects();
398
399 case self::OBJECT_ID:
401 // :TODO: should this ever occur?
402 break;
403 }
404 }
405
411 protected function deleteConfirmedObjects()
412 {
413 global $DIC;
414
415 $lng = $DIC["lng"];
416
417
418 if (sizeof($_POST["id"])) {
419 // #18797 - because of parent/child relations gather all nodes first
420 $del_nodes = array();
421 foreach ($_POST["id"] as $node_id) {
422 $del_nodes[$node_id] = $this->tree->getNodeData($node_id);
423 }
424
425 foreach ($del_nodes as $node_id => $node) {
426 // tree/reference
427 $this->tree->deleteReference($node_id);
428 if ($this->tree->isInTree($node_id)) {
429 $this->tree->deleteTree($node);
430 }
431
432 // permission
433 $this->getAccessHandler()->removePermission($node_id);
434
435 // object
436 $object = ilObjectFactory::getInstanceByObjId($node["obj_id"], false);
437 if ($object) {
438 $object->delete();
439 }
440 }
441
442 ilUtil::sendSuccess($lng->txt("msg_removed"), true);
443 } else {
444 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
445 }
446
447 $this->ctrl->redirect($this, "");
448 }
449
450 public function getHTML()
451 {
452 return parent::getHTML();
453 }
454
458 final public function withReferences()
459 {
460 return parent::withReferences();
461 }
462 final public function setCreationMode($a_mode = true)
463 {
464 return parent::setCreationMode($a_mode);
465 }
466 final public function getCreationMode()
467 {
468 return parent::getCreationMode();
469 }
470 final public function prepareOutput($a_show_subobjects = true)
471 {
472 return parent::prepareOutput($a_show_subobjects);
473 }
474 protected function setTitleAndDescription()
475 {
476 return parent::setTitleAndDescription();
477 }
478 final protected function showUpperIcon()
479 {
480 return parent::showUpperIcon();
481 }
482 // final private function showMountWebfolderIcon() { return parent::showMountWebfolderIcon(); }
483 final protected function omitLocator($a_omit = true)
484 {
485 return parent::omitLocator($a_omit);
486 }
487 final protected function getTargetFrame($a_cmd, $a_target_frame = "")
488 {
489 return parent::getTargetFrame($a_cmd, $a_target_frame);
490 }
491 final protected function setTargetFrame($a_cmd, $a_target_frame)
492 {
493 return parent::setTargetFrame($a_cmd, $a_target_frame);
494 }
495 final public function isVisible($a_ref_id, $a_type)
496 {
497 return parent::isVisible($a_ref_id, $a_type);
498 }
499 final protected function getCenterColumnHTML()
500 {
501 return parent::getCenterColumnHTML();
502 }
503 final protected function getRightColumnHTML()
504 {
505 return parent::getRightColumnHTML();
506 }
507 final protected function setColumnSettings(ilColumnGUI $column_gui)
508 {
509 return parent::setColumnSettings($column_gui);
510 }
511 final protected function checkPermission($a_perm, $a_cmd = "", $a_type = "", $a_ref_id = null)
512 {
513 return parent::checkPermission($a_perm, $a_cmd, $a_type, $a_ref_id);
514 }
515
516 // -> ilContainerGUI
517 final protected function showPossibleSubObjects()
518 {
519 return parent::showPossibleSubObjects();
520 }
521 // -> ilRepUtilGUI
522 final public function trash()
523 {
524 return parent::trashObject();
525 } // done
526 // -> ilRepUtil
527 final public function undelete()
528 {
529 return parent::undeleteObject();
530 } // done
531 final public function cancelDelete()
532 {
533 return parent::cancelDeleteObject();
534 } // ok
535 final public function removeFromSystem()
536 {
537 return parent::removeFromSystemObject();
538 } // done
539 final protected function redirectToRefId($a_ref_id, $a_cmd = "")
540 {
541 return parent::redirectToRefId();
542 } // ok
543
544 // -> stefan
545 final protected function fillCloneTemplate($a_tpl_varname, $a_type)
546 {
547 return parent::fillCloneTemplate($a_tpl_varname, $a_type);
548 }
549 final protected function fillCloneSearchTemplate($a_tpl_varname, $a_type)
550 {
551 return parent::fillCloneSearchTemplate($a_tpl_varname, $a_type);
552 }
553 final protected function searchCloneSource()
554 {
555 return parent::searchCloneSourceObject();
556 }
557 final public function cloneAll()
558 {
559 return parent::cloneAllObject();
560 }
561 final protected function buildCloneSelect($existing_objs)
562 {
563 return parent::buildCloneSelect($existing_objs);
564 }
565
566 // -> ilAdministration
567 final private function displayList()
568 {
569 return parent::displayList();
570 }
571 // final private function setAdminTabs() { return parent::setAdminTabs(); }
572 // final public function getAdminTabs() { return parent::getAdminTabs(); }
573 final protected function addAdminLocatorItems($a_do_not_add_object = false)
574 {
575 return parent::addAdminLocatorItems($a_do_not_add_object);
576 }
577
581 public function view()
582 {
583 switch ($this->id_type) {
586 return parent::viewObject();
587
590 return $this->render();
591
592 case self::OBJECT_ID:
594 // :TODO: should this ever occur? do nothing or edit() ?!
595 break;
596 }
597 }
598
604 protected function setTabs()
605 {
606 global $DIC;
607
608 $ilTabs = $DIC["ilTabs"];
609 $lng = $DIC["lng"];
610
611
612 switch ($this->id_type) {
615 if ($this->checkPermissionBool("edit_permission")) {
616 $ilTabs->addTab(
617 "id_permissions",
618 $lng->txt("perm_settings"),
619 $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilpermissiongui"), "perm")
620 );
621 }
622 break;
623
626 // only files and blogs can be shared for now
627 if ($this->checkPermissionBool("edit_permission") && in_array($this->type, array("file", "blog")) && $this->node_id) {
628 $ilTabs->addTab(
629 "id_permissions",
630 $lng->txt("wsp_permissions"),
631 $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilworkspaceaccessgui"), "share")
632 );
633 }
634 break;
635 }
636 }
637
641 // final private function setSubObjects($a_sub_objects = "") { die("ilObject2GUI::setSubObjects() is deprecated."); }
642 // final public function getFormAction($a_cmd, $a_formaction = "") { die("ilObject2GUI::getFormAction() is deprecated."); }
643 // final protected function setFormAction($a_cmd, $a_formaction) { die("ilObject2GUI::setFormAction() is deprecated."); }
644 final protected function getReturnLocation($a_cmd, $a_location ="")
645 {
646 die("ilObject2GUI::getReturnLocation() is deprecated.");
647 }
648 final protected function setReturnLocation($a_cmd, $a_location)
649 {
650 die("ilObject2GUI::setReturnLocation() is deprecated.");
651 }
652 final protected function showActions()
653 {
654 die("ilObject2GUI::showActions() is deprecated.");
655 }
656 final protected function getTabs()
657 {
658 nj();
659 die("ilObject2GUI::getTabs() is deprecated.");
660 }
661 final protected function __showButton($a_cmd, $a_text, $a_target = '')
662 {
663 die("ilObject2GUI::__showButton() is deprecated.");
664 }
665 final protected function hitsperpageObject()
666 {
667 die("ilObject2GUI::hitsperpageObject() is deprecated.");
668 }
669 final protected function &__initTableGUI()
670 {
671 die("ilObject2GUI::__initTableGUI() is deprecated.");
672 }
673 final protected function __setTableGUIBasicData(&$tbl, &$result_set, $a_from = "")
674 {
675 die("ilObject2GUI::__setTableGUIBasicData() is deprecated.");
676 }
677
681 protected function addLocatorItems()
682 {
683 }
684
688 abstract public function getType();
689
693 // final private function permObject() { parent::permObject(); }
694 // final private function permSaveObject() { parent::permSaveObject(); }
695 // final private function infoObject() { parent::infoObject(); }
696 // final private function __buildRoleFilterSelect() { parent::__buildRoleFilterSelect(); }
697 // final private function __filterRoles() { parent::__filterRoles(); }
698 // final private function ownerObject() { parent::ownerObject(); }
699 // final private function changeOwnerObject() { parent::changeOwnerObject(); }
700 // final private function addRoleObject() { parent::addRoleObject(); }
701 // final private function setActions($a_actions = "") { die("ilObject2GUI::setActions() is deprecated."); }
702 // final protected function getActions() { die("ilObject2GUI::getActions() is deprecated."); }
703
707 public function create()
708 {
709 parent::createObject();
710 }
711 public function save()
712 {
713 parent::saveObject();
714 }
715 public function edit()
716 {
717 parent::editObject();
718 }
719 public function update()
720 {
721 parent::updateObject();
722 }
723 public function cancel()
724 {
725 parent::cancelObject();
726 }
727
736 protected function initCreationForms($a_new_type)
737 {
738 $forms = parent::initCreationForms($a_new_type);
739
740 // cloning doesn't work in workspace yet
741 if ($this->id_type == self::WORKSPACE_NODE_ID) {
742 unset($forms[self::CFORM_CLONE]);
743 }
744
745 return $forms;
746 }
747
753 public function importFile()
754 {
755 parent::importFileObject($this->parent_id);
756 }
757
764 public function putObjectInTree(ilObject $a_obj, $a_parent_node_id = null)
765 {
766 global $DIC;
767
768 $rbacreview = $DIC["rbacreview"];
769 $ilUser = $DIC["ilUser"];
770
771
772 $this->object_id = $a_obj->getId();
773
774 if (!$a_parent_node_id) {
775 $a_parent_node_id = $this->parent_id;
776 }
777
778 // add new object to custom parent container
779 if ((int) $_REQUEST["crtptrefid"]) {
780 $a_parent_node_id = (int) $_REQUEST["crtptrefid"];
781 }
782
783 switch ($this->id_type) {
786 if (!$this->node_id) {
787 $a_obj->createReference();
788 $this->node_id = $a_obj->getRefId();
789 }
790 $a_obj->putInTree($a_parent_node_id);
791 $a_obj->setPermissions($a_parent_node_id);
792
793 // rbac log
794 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
795 $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id, false);
796 $rbac_log = ilRbacLog::gatherFaPa($this->node_id, array_keys($rbac_log_roles), true);
797 ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $this->node_id, $rbac_log);
798
799 $this->ctrl->setParameter($this, "ref_id", $this->node_id);
800 break;
801
804 if (!$this->node_id) {
805 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
806 }
807 $this->getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
808
809 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
810 break;
811
812 case self::OBJECT_ID:
814 // do nothing
815 break;
816 }
817
818 // BEGIN ChangeEvent: Record save object.
819 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
820 ilChangeEvent::_recordWriteEvent($this->object_id, $ilUser->getId(), 'create');
821 // END ChangeEvent: Record save object.
822
823 // use forced callback after object creation
824 self::handleAfterSaveCallback($a_obj, $_REQUEST["crtcb"]);
825 }
826
833 public static function handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
834 {
835 global $DIC;
836
837 $objDefinition = $DIC["objDefinition"];
838
839
840 $a_callback_ref_id = (int) $a_callback_ref_id;
841 if ($a_callback_ref_id) {
842 $callback_type = ilObject::_lookupType($a_callback_ref_id, true);
843 $class_name = "ilObj" . $objDefinition->getClassName($callback_type) . "GUI";
844 $location = $objDefinition->getLocation($callback_type);
845 include_once($location . "/class." . $class_name . ".php");
846 if (in_array(strtolower($class_name), array("ilobjitemgroupgui"))) {
847 $callback_obj = new $class_name($a_callback_ref_id);
848 } else {
849 $callback_obj = new $class_name(null, $a_callback_ref_id, true, false);
850 }
851 $callback_obj->afterSaveCallback($a_obj);
852 }
853 }
854
864 protected function checkPermissionBool($a_perm, $a_cmd = "", $a_type = "", $a_node_id = null)
865 {
866 global $DIC;
867
868 $ilUser = $DIC["ilUser"];
869
870
871 if ($a_perm == "create") {
872 if (!$a_node_id) {
873 $a_node_id = $this->parent_id;
874 }
875 if ($a_node_id) {
876 return $this->getAccessHandler()->checkAccess($a_perm . "_" . $a_type, $a_cmd, $a_node_id);
877 }
878 } else {
879 if (!$a_node_id) {
880 $a_node_id = $this->node_id;
881 }
882 if ($a_node_id) {
883 return $this->getAccessHandler()->checkAccess($a_perm, $a_cmd, $a_node_id);
884 }
885 }
886
887 // if we do not have a node id, check if current user is owner
888 if ($this->obj_id && $this->object->getOwner() == $ilUser->getId()) {
889 return true;
890 }
891 return false;
892 }
893
901 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
902 {
903 if ($this->id_type == self::WORKSPACE_NODE_ID) {
904 if (!$this->creation_mode && $this->object_id) {
905 include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
906 $dispatcher = new ilCommonActionDispatcherGUI(
908 $this->getAccessHandler(),
909 $this->getType(),
910 $this->node_id,
911 $this->object_id
912 );
913
914 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
915
916 include_once "Services/Object/classes/class.ilObjectListGUI.php";
917 ilObjectListGUI::prepareJSLinks(
918 $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
919 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
920 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
921 );
922
923 $lg = $dispatcher->initHeaderAction();
924
925 if (is_object($lg)) {
926 // to enable add to desktop / remove from desktop
927 if ($this instanceof ilDesktopItemHandling) {
928 $lg->setContainerObject($this);
929 }
930
931 // for activation checks see ilObjectGUI
932 // $lg->enableComments(true);
933 $lg->enableNotes(true);
934 // $lg->enableTags(true);
935 }
936
937 return $lg;
938 }
939 } else {
940 return parent::initHeaderAction();
941 }
942 }
943
947 protected function redrawHeaderAction()
948 {
949 parent::redrawHeaderActionObject();
950 }
951
952 protected function getPermanentLinkWidget($a_append = null, $a_center = false)
953 {
954 if ($this->id_type == self::WORKSPACE_NODE_ID) {
955 $a_append .= "_wsp";
956 }
957
958 include_once('Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
959 $plink = new ilPermanentLinkGUI($this->getType(), $this->node_id, $a_append);
960 $plink->setIncludePermanentLinkText(false);
961 $plink->setAlignCenter($a_center);
962 return $plink->getHTML();
963 }
964
965
969 protected function handleAutoRating(ilObject $a_new_obj)
970 {
971 // only needed in repository
972 if ($this->id_type == self::REPOSITORY_NODE_ID) {
973 parent::handleAutoRating($a_new_obj);
974 }
975 }
976}
user()
Definition: user.php:4
html()
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
$location
Definition: buildRTE.php:44
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
Column user interface class.
Class ilCommonActionDispatcherGUI.
Confirmation screen class.
New implementation of ilObjectGUI.
getType()
Functions that must be overwritten.
setReturnLocation($a_cmd, $a_location)
set specific return location for command
setColumnSettings(ilColumnGUI $column_gui)
May be overwritten in subclasses.
executeCommand()
execute command
__setTableGUIBasicData(&$tbl, &$result_set, $a_from="")
standard implementation for tables use 'from' variable use different initial setting of table
handleAutoRating(ilObject $a_new_obj)
isVisible($a_ref_id, $a_type)
create()
Deleted in ilObject.
setTitleAndDescription()
called by prepare output
setTabs()
create tabs (repository/workspace switch)
buildCloneSelect($existing_objs)
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
deleteConfirmation()
Display delete confirmation form (workspace specific)
getReturnLocation($a_cmd, $a_location="")
Deprecated functions.
getAccessHandler()
Get access handler.
redrawHeaderAction()
Updating icons after ajax call.
__showButton($a_cmd, $a_text, $a_target='')
prepareOutput($a_show_subobjects=true)
prepare output
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
omitLocator($a_omit=true)
getCenterColumnHTML()
Get center column.
getTargetFrame($a_cmd, $a_target_frame="")
get target frame for command (command is method name without "Object", e.g.
showPossibleSubObjects()
show possible subobjects (pulldown menu)
initCreationForms($a_new_type)
Init creation froms.
setTargetFrame($a_cmd, $a_target_frame)
set specific target frame for command
deleteConfirmedObjects()
Delete objects (workspace specific)
getTabs()
get tabs abstract method.
getPermanentLinkWidget($a_append=null, $a_center=false)
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getRightColumnHTML()
Display right column.
static handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
After creation callback.
assignObject()
create object instance as internal property (repository/workspace switch)
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
view()
view object content (repository/workspace switch)
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
setLocator()
set Locator
afterConstructor()
Do anything that should be done after constructor in here.
fillCloneSearchTemplate($a_tpl_varname, $a_type)
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
addLocatorItems()
Functions to be overwritten.
confirmedDelete()
Delete objects (repository/workspace switch)
withReferences()
Final/Private declaration of unchanged parent methods.
redirectToRefId($a_ref_id, $a_cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
addAdminLocatorItems($a_do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static getClassByType($a_obj_type)
Get class by type.
Class ilObjectGUI Basic methods of all Output classes.
Class ilObject Basic functions for all objects.
createReference()
creates reference for object
static _lookupObjectId($a_ref_id)
lookup object id
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setPermissions($a_parent_ref)
set permissions of object
getRefId()
get reference id @access public
getId()
get object id @access public
putInTree($a_parent_ref)
maybe this method should be in tree object!?
static _lookupType($a_id, $a_reference=false)
lookup object type
Class for permanent links.
Access handler for portfolio.
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
const CREATE_OBJECT
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Access handler for personal workspace.
Tree handler for personal workspace.
$lg
Definition: example_018.php:62
$tbl
Definition: example_048.php:81
global $ilCtrl
Definition: ilias.php:18
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
$type
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:92
$params
Definition: disable.php:11