ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
28abstract 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;
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 {
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
91 $this->object_id = $a_id;
92 $this->tree = $tree;
93 $this->access_handler = $ilAccess;
94 $params[] = "obj_id"; // ???
95 break;
96
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
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
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:
221 $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
222 break;
223
225 $this->object = ilObjectFactory::getInstanceByRefId($this->node_id);
226 break;
227
229 // to be discussed
230 $this->object = ilObjectFactory::getInstanceByObjId($this->object_id);
231 break;
232 }
233 }
234 }
235
241 protected function getAccessHandler()
242 {
244 }
245
249 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 {
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
289 // :TODO:
290 break;
291 }
292
293
294 }
295
299 public function delete()
300 {
301 switch($this->id_type)
302 {
305 return parent::deleteObject();
306
309 return $this->deleteConfirmation();
310
311 case self::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 {
383 return parent::confirmedDeleteObject();
384
387 return $this->deleteConfirmedObjects();
388
389 case self::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 // #18797 - because of parent/child relations gather all nodes first
408 $del_nodes = array();
409 foreach($_POST["id"] as $node_id)
410 {
411 $del_nodes[$node_id] = $this->tree->getNodeData($node_id);
412 }
413
414 foreach($del_nodes as $node_id => $node)
415 {
416 // tree/reference
417 $this->tree->deleteReference($node_id);
418 if($this->tree->isInTree($node_id))
419 {
420 $this->tree->deleteTree($node);
421 }
422
423 // permission
424 $this->getAccessHandler()->removePermission($node_id);
425
426 // object
427 $object = ilObjectFactory::getInstanceByObjId($node["obj_id"], false);
428 if($object)
429 {
430 $object->delete();
431 }
432 }
433
434 ilUtil::sendSuccess($lng->txt("msg_removed"), true);
435 }
436 else
437 {
438 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
439 }
440
441 $this->ctrl->redirect($this, "");
442 }
443
444 public function getHTML() { return parent::getHTML(); }
445
449 final public function withReferences() { return parent::withReferences(); }
450 final public function setCreationMode($a_mode = true) { return parent::setCreationMode($a_mode); }
451 final public function getCreationMode() { return parent::getCreationMode(); }
452 final public function prepareOutput($a_show_subobjects = true) { return parent::prepareOutput($a_show_subobjects); }
453 protected function setTitleAndDescription() { return parent::setTitleAndDescription(); }
454 final protected function showUpperIcon() { return parent::showUpperIcon(); }
455// final private function showMountWebfolderIcon() { return parent::showMountWebfolderIcon(); }
456 final protected function omitLocator($a_omit = true) { return parent::omitLocator($a_omit); }
457 final protected function getTargetFrame($a_cmd, $a_target_frame = "") { return parent::getTargetFrame($a_cmd, $a_target_frame); }
458 final protected function setTargetFrame($a_cmd, $a_target_frame) { return parent::setTargetFrame($a_cmd, $a_target_frame); }
459 final public function isVisible($a_ref_id,$a_type) { return parent::isVisible($a_ref_id,$a_type); }
460 final protected function getCenterColumnHTML() { return parent::getCenterColumnHTML(); }
461 final protected function getRightColumnHTML() { return parent::getRightColumnHTML(); }
462 final protected function setColumnSettings(ilColumnGUI $column_gui) { return parent::setColumnSettings($column_gui); }
463 final protected function checkPermission($a_perm, $a_cmd = "", $a_type = "", $a_ref_id = null) { return parent::checkPermission($a_perm, $a_cmd, $a_type, $a_ref_id); }
464
465 // -> ilContainerGUI
466 final protected function showPossibleSubObjects() { return parent::showPossibleSubObjects(); }
467 // -> ilRepUtilGUI
468 final public function trash() { return parent::trashObject(); } // done
469 // -> ilRepUtil
470 final public function undelete() { return parent::undeleteObject(); } // done
471 final public function cancelDelete() { return parent::cancelDeleteObject(); } // ok
472 final public function removeFromSystem() { return parent::removeFromSystemObject(); } // done
473 final protected function redirectToRefId($a_ref_id, $a_cmd = "") { return parent::redirectToRefId(); } // ok
474
475 // -> stefan
476 final protected function fillCloneTemplate($a_tpl_varname,$a_type) { return parent::fillCloneTemplate($a_tpl_varname,$a_type); }
477 final protected function fillCloneSearchTemplate($a_tpl_varname,$a_type) { return parent::fillCloneSearchTemplate($a_tpl_varname,$a_type); }
478 final protected function searchCloneSource() { return parent::searchCloneSourceObject(); }
479 final public function cloneAll() { return parent::cloneAllObject(); }
480 final protected function buildCloneSelect($existing_objs) { return parent::buildCloneSelect($existing_objs); }
481
482 // -> ilAdministration
483 final private function displayList() { return parent::displayList(); }
484// final private function setAdminTabs() { return parent::setAdminTabs(); }
485// final public function getAdminTabs() { return parent::getAdminTabs(); }
486 final protected function addAdminLocatorItems($a_do_not_add_object = false) { return parent::addAdminLocatorItems($a_do_not_add_object); }
487
491 public function view()
492 {
493 switch($this->id_type)
494 {
497 return parent::viewObject();
498
501 return $this->render();
502
503 case self::OBJECT_ID:
505 // :TODO: should this ever occur? do nothing or edit() ?!
506 break;
507 }
508 }
509
515 protected function setTabs()
516 {
517 global $ilTabs, $lng;
518
519 switch($this->id_type)
520 {
523 if ($this->checkPermissionBool("edit_permission"))
524 {
525 $ilTabs->addTab("id_permissions",
526 $lng->txt("perm_settings"),
527 $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilpermissiongui"), "perm"));
528 }
529 break;
530
533 // only files and blogs can be shared for now
534 if ($this->checkPermissionBool("edit_permission") && in_array($this->type, array("file", "blog")) && $this->node_id)
535 {
536 $ilTabs->addTab("id_permissions",
537 $lng->txt("wsp_permissions"),
538 $this->ctrl->getLinkTargetByClass(array(get_class($this), "ilworkspaceaccessgui"), "share"));
539 }
540 break;
541 }
542 }
543
547// final private function setSubObjects($a_sub_objects = "") { die("ilObject2GUI::setSubObjects() is deprecated."); }
548// final public function getFormAction($a_cmd, $a_formaction = "") { die("ilObject2GUI::getFormAction() is deprecated."); }
549// final protected function setFormAction($a_cmd, $a_formaction) { die("ilObject2GUI::setFormAction() is deprecated."); }
550 final protected function getReturnLocation($a_cmd, $a_location ="") { die("ilObject2GUI::getReturnLocation() is deprecated."); }
551 final protected function setReturnLocation($a_cmd, $a_location) { die("ilObject2GUI::setReturnLocation() is deprecated."); }
552 final protected function showActions() { die("ilObject2GUI::showActions() is deprecated."); }
553 final protected function getTabs() {nj(); die("ilObject2GUI::getTabs() is deprecated."); }
554 final protected function __showButton($a_cmd,$a_text,$a_target = '') { die("ilObject2GUI::__showButton() is deprecated."); }
555 final protected function hitsperpageObject() { die("ilObject2GUI::hitsperpageObject() is deprecated."); }
556 final protected function &__initTableGUI() { die("ilObject2GUI::__initTableGUI() is deprecated."); }
557 final protected function __setTableGUIBasicData(&$tbl,&$result_set,$a_from = "") { die("ilObject2GUI::__setTableGUIBasicData() is deprecated."); }
558
562 protected function addLocatorItems() {}
563
567 abstract function getType();
568
572// final private function permObject() { parent::permObject(); }
573// final private function permSaveObject() { parent::permSaveObject(); }
574// final private function infoObject() { parent::infoObject(); }
575// final private function __buildRoleFilterSelect() { parent::__buildRoleFilterSelect(); }
576// final private function __filterRoles() { parent::__filterRoles(); }
577// final private function ownerObject() { parent::ownerObject(); }
578// final private function changeOwnerObject() { parent::changeOwnerObject(); }
579// final private function addRoleObject() { parent::addRoleObject(); }
580// final private function setActions($a_actions = "") { die("ilObject2GUI::setActions() is deprecated."); }
581// final protected function getActions() { die("ilObject2GUI::getActions() is deprecated."); }
582
586 public function create() { parent::createObject(); }
587 public function save() { parent::saveObject(); }
588 public function edit() { parent::editObject(); }
589 public function update() { parent::updateObject(); }
590 public function cancel() { parent::cancelObject(); }
591
600 protected function initCreationForms($a_new_type)
601 {
602 $forms = parent::initCreationForms($a_new_type);
603
604 // cloning doesn't work in workspace yet
605 if($this->id_type == self::WORKSPACE_NODE_ID)
606 {
607 unset($forms[self::CFORM_CLONE]);
608 }
609
610 return $forms;
611 }
612
618 function importFile()
619 {
620 parent::importFileObject($this->parent_id);
621 }
622
629 protected function putObjectInTree(ilObject $a_obj, $a_parent_node_id = null)
630 {
631 global $rbacreview, $ilUser, $objDefinition;
632
633 $this->object_id = $a_obj->getId();
634
635 if(!$a_parent_node_id)
636 {
637 $a_parent_node_id = $this->parent_id;
638 }
639
640 // add new object to custom parent container
641 if((int)$_REQUEST["crtptrefid"])
642 {
643 $a_parent_node_id = (int)$_REQUEST["crtptrefid"];
644 }
645
646 switch($this->id_type)
647 {
650 if(!$this->node_id)
651 {
652 $a_obj->createReference();
653 $this->node_id = $a_obj->getRefId();
654 }
655 $a_obj->putInTree($a_parent_node_id);
656 $a_obj->setPermissions($a_parent_node_id);
657
658 // rbac log
659 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
660 $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id, false);
661 $rbac_log = ilRbacLog::gatherFaPa($this->node_id, array_keys($rbac_log_roles), true);
662 ilRbacLog::add(ilRbacLog::CREATE_OBJECT, $this->node_id, $rbac_log);
663
664 $this->ctrl->setParameter($this, "ref_id", $this->node_id);
665 break;
666
669 if(!$this->node_id)
670 {
671 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
672 }
673 $this->getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
674
675 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
676 break;
677
678 case self::OBJECT_ID:
680 // do nothing
681 break;
682 }
683
684 // BEGIN ChangeEvent: Record save object.
685 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
686 ilChangeEvent::_recordWriteEvent($this->object_id, $ilUser->getId(), 'create');
687 // END ChangeEvent: Record save object.
688
689 // use forced callback after object creation
690 self::handleAfterSaveCallback($a_obj, $_REQUEST["crtcb"]);
691 }
692
699 public static function handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
700 {
701 global $objDefinition;
702
703 $a_callback_ref_id = (int)$a_callback_ref_id;
704 if($a_callback_ref_id)
705 {
706 $callback_type = ilObject::_lookupType($a_callback_ref_id, true);
707 $class_name = "ilObj".$objDefinition->getClassName($callback_type)."GUI";
708 $location = $objDefinition->getLocation($callback_type);
709 include_once($location."/class.".$class_name.".php");
710 if (in_array(strtolower($class_name), array("ilobjitemgroupgui")))
711 {
712 $callback_obj = new $class_name($a_callback_ref_id);
713 }
714 else
715 {
716 $callback_obj = new $class_name(null, $a_callback_ref_id, true, false);
717 }
718 $callback_obj->afterSaveCallback($a_obj);
719 }
720 }
721
731 protected function checkPermissionBool($a_perm, $a_cmd = "", $a_type = "", $a_node_id = null)
732 {
733 global $ilUser;
734
735 if($a_perm == "create")
736 {
737 if(!$a_node_id)
738 {
739 $a_node_id = $this->parent_id;
740 }
741 if($a_node_id)
742 {
743 return $this->getAccessHandler()->checkAccess($a_perm."_".$a_type, $a_cmd, $a_node_id);
744 }
745 }
746 else
747 {
748
749 if (!$a_node_id)
750 {
751 $a_node_id = $this->node_id;
752 }
753 if($a_node_id)
754 {
755 return $this->getAccessHandler()->checkAccess($a_perm, $a_cmd, $a_node_id);
756 }
757 }
758
759 // if we do not have a node id, check if current user is owner
760 if($this->obj_id && $this->object->getOwner() == $ilUser->getId())
761 {
762 return true;
763 }
764 return false;
765 }
766
774 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
775 {
776 global $ilAccess;
777
778 if($this->id_type == self::WORKSPACE_NODE_ID)
779 {
780 if(!$this->creation_mode && $this->object_id)
781 {
782 include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
784 $this->getAccessHandler(), $this->getType(), $this->node_id, $this->object_id);
785
786 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
787
788 include_once "Services/Object/classes/class.ilObjectListGUI.php";
789 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
790 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
791 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
792
793 $lg = $dispatcher->initHeaderAction();
794
795 if(is_object($lg))
796 {
797 // to enable add to desktop / remove from desktop
798 if($this instanceof ilDesktopItemHandling)
799 {
800 $lg->setContainerObject($this);
801 }
802
803 // for activation checks see ilObjectGUI
804 // $lg->enableComments(true);
805 $lg->enableNotes(true);
806 // $lg->enableTags(true);
807 }
808
809 return $lg;
810 }
811 }
812 else
813 {
814 return parent::initHeaderAction();
815 }
816 }
817
821 protected function redrawHeaderAction()
822 {
823 parent::redrawHeaderActionObject();
824 }
825
826 protected function getPermanentLinkWidget($a_append = null, $a_center = false)
827 {
828 if($this->id_type == self::WORKSPACE_NODE_ID)
829 {
830 $a_append .= "_wsp";
831 }
832
833 include_once('Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
834 $plink = new ilPermanentLinkGUI($this->getType(), $this->node_id , $a_append);
835 $plink->setIncludePermanentLinkText(false);
836 $plink->setAlignCenter($a_center);
837 return $plink->getHTML();
838 }
839
840
841 protected function handleAutoRating(ilObject $a_new_obj)
842 {
843 // only needed in repository
844 if($this->id_type == self::REPOSITORY_NODE_ID)
845 {
846 parent::handleAutoRating($a_new_obj);
847 }
848 }
849}
850
851?>
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)
Activate rating automatically if parent container setting.
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
setPermissions($a_parent_ref)
set permissions of object
getRefId()
get reference id @access public
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
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
$params
Definition: example_049.php:96
global $ilCtrl
Definition: ilias.php:18
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
global $ilErr
Definition: raiseError.php:16
$cmd
Definition: sahs_server.php:35
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:93