4 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
52 function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
66 $this->id_type = $a_id_type;
67 $this->parent_id = $a_parent_node_id;
72 $this->tabs_gui = $ilTabs;
79 switch($this->id_type)
81 case self::REPOSITORY_NODE_ID:
82 $this->node_id = $a_id;
85 $this->access_handler = $ilAccess;
86 $this->call_by_reference =
true;
90 case self::REPOSITORY_OBJECT_ID:
91 $this->object_id = $a_id;
93 $this->access_handler = $ilAccess;
97 case self::WORKSPACE_NODE_ID:
99 $this->node_id = $a_id;
100 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
103 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
105 $params[] =
"wsp_id";
108 case self::WORKSPACE_OBJECT_ID:
110 $this->object_id = $a_id;
111 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
113 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
115 $params[] =
"obj_id";
118 case self::PORTFOLIO_OBJECT_ID:
119 $this->object_id = $a_id;
120 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
122 $params[] =
"prt_id";
125 case self::OBJECT_ID:
126 $this->object_id = $a_id;
127 include_once
"Services/Object/classes/class.ilDummyAccessHandler.php";
129 $params[] =
"obj_id";
132 $this->ctrl->saveParameter($this, $params);
137 if(!$this->object_id)
139 $this->creation_mode =
true;
144 if(!$this->parent_id && $this->tree)
146 $this->parent_id = $this->tree->getParentId($this->node_id);
157 if (is_object($this->
object))
159 $this->ctrl->setContext($this->object->getId(), $this->
object->getType());
179 $next_class = $this->ctrl->getNextClass($this);
180 $cmd = $this->ctrl->getCmd();
186 case "ilworkspaceaccessgui";
189 $this->tabs_gui->activateTab(
"id_permissions");
191 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
193 $this->ctrl->forwardCommand($wspacc);
202 return $this->
$cmd();
213 if ($this->object_id != 0)
215 switch($this->id_type)
217 case self::OBJECT_ID:
218 case self::REPOSITORY_OBJECT_ID:
219 case self::WORKSPACE_OBJECT_ID:
220 case self::PORTFOLIO_OBJECT_ID:
224 case self::REPOSITORY_NODE_ID:
228 case self::WORKSPACE_NODE_ID:
251 global $ilLocator,
$tpl;
253 if ($this->omit_locator)
258 switch($this->id_type)
260 case self::REPOSITORY_NODE_ID:
264 $ilLocator->addRepositoryItems(
$ref_id);
267 if (
$_GET[
"admin_mode"] ==
"" &&
268 strtolower($this->ctrl->getCmdClass()) ==
"ilobjrolegui")
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"));
288 case self::WORKSPACE_NODE_ID:
299 public function delete()
301 switch($this->id_type)
303 case self::REPOSITORY_NODE_ID:
304 case self::REPOSITORY_OBJECT_ID:
307 case self::WORKSPACE_NODE_ID:
308 case self::WORKSPACE_OBJECT_ID:
311 case self::OBJECT_ID:
312 case self::PORTFOLIO_OBJECT_ID:
331 $this->ctrl->redirect($this,
"");
335 $parent_node = $this->tree->getParentId(
$node_id);
336 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
338 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
340 $cgui->setHeaderText($lng->txt(
"info_delete_sure").
"<br/>".
341 $lng->txt(
"info_delete_warning_no_trash"));
343 $cgui->setFormAction($this->ctrl->getFormAction($this));
344 $cgui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
345 $cgui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
350 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
351 foreach($children as $child)
353 $node_id = $child[
"wsp_id"];
354 $obj_id = $this->tree->lookupObjectId($node_id);
362 $this->ctrl->redirect($this);
365 $cgui->addItem(
"id[]", $node_id, $title,
367 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$type));
371 $tpl->setContent($cgui->getHTML());
379 switch($this->id_type)
381 case self::REPOSITORY_NODE_ID:
382 case self::REPOSITORY_OBJECT_ID:
385 case self::WORKSPACE_NODE_ID:
386 case self::WORKSPACE_OBJECT_ID:
389 case self::OBJECT_ID:
390 case self::PORTFOLIO_OBJECT_ID:
409 $node = $this->tree->getNodeData($node_id);
412 $this->tree->deleteReference($node_id);
413 $this->tree->deleteTree($node);
433 $this->ctrl->redirect($this,
"");
460 final public function trash() {
return parent::trashObject(); }
462 final public function undelete() {
return parent::undeleteObject(); }
485 switch($this->id_type)
487 case self::REPOSITORY_NODE_ID:
488 case self::REPOSITORY_OBJECT_ID:
491 case self::WORKSPACE_NODE_ID:
492 case self::WORKSPACE_OBJECT_ID:
493 return $this->render();
495 case self::OBJECT_ID:
496 case self::PORTFOLIO_OBJECT_ID:
509 global $ilTabs,
$lng;
511 switch($this->id_type)
513 case self::REPOSITORY_NODE_ID:
514 case self::REPOSITORY_OBJECT_ID:
517 $ilTabs->addTab(
"id_permissions",
518 $lng->txt(
"perm_settings"),
519 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilpermissiongui"),
"perm"));
523 case self::WORKSPACE_NODE_ID:
524 case self::WORKSPACE_OBJECT_ID:
528 $ilTabs->addTab(
"id_permissions",
529 $lng->txt(
"wsp_permissions"),
530 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilworkspaceaccessgui"),
"share"));
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."); }
598 if($this->id_type == self::WORKSPACE_NODE_ID)
600 unset($forms[self::CFORM_CLONE]);
626 $this->object_id = $a_obj->
getId();
628 if(!$a_parent_node_id)
636 $a_parent_node_id = (int)$_REQUEST[
"crtptrefid"];
639 switch($this->id_type)
641 case self::REPOSITORY_NODE_ID:
642 case self::REPOSITORY_OBJECT_ID:
646 $this->node_id = $a_obj->
getRefId();
652 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
653 $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id,
false);
657 $this->ctrl->setParameter($this,
"ref_id", $this->node_id);
660 case self::WORKSPACE_NODE_ID:
661 case self::WORKSPACE_OBJECT_ID:
664 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
666 $this->
getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
668 $this->ctrl->setParameter($this,
"wsp_id", $this->node_id);
671 case self::OBJECT_ID:
672 case self::PORTFOLIO_OBJECT_ID:
678 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
683 if($_REQUEST[
"crtcb"])
686 $class_name =
"ilObj".$objDefinition->getClassName($callback_type).
"GUI";
687 $location = $objDefinition->getLocation($callback_type);
688 include_once(
$location.
"/class.".$class_name.
".php");
689 if (in_array(strtolower($class_name), array(
"ilobjitemgroupgui")))
691 $callback_obj =
new $class_name((
int)$_REQUEST[
"crtcb"]);
695 $callback_obj =
new $class_name(null, (
int)$_REQUEST[
"crtcb"],
true,
false);
697 $callback_obj->afterSaveCallback($a_obj);
714 if($a_perm ==
"create")
722 return $this->
getAccessHandler()->checkAccess($a_perm.
"_".$a_type, $a_cmd, $a_node_id);
739 if($this->obj_id && $this->object->getOwner() == $ilUser->getId())
757 if($this->id_type == self::WORKSPACE_NODE_ID)
759 if(!$this->creation_mode && $this->object_id)
761 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
765 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
767 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
768 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
769 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
770 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
772 $lg = $dispatcher->initHeaderAction();
779 $lg->setContainerObject($this);
784 $lg->enableNotes(
true);
807 if($this->id_type == self::WORKSPACE_NODE_ID)
812 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
814 $plink->setIncludePermanentLinkText(
false);
815 $plink->setAlignCenter($a_center);
816 return $plink->getHTML();
823 if($this->id_type == self::REPOSITORY_NODE_ID)