4 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
51 function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
65 $this->id_type = $a_id_type;
66 $this->parent_id = $a_parent_node_id;
71 $this->tabs_gui = $ilTabs;
78 switch($this->id_type)
80 case self::REPOSITORY_NODE_ID:
81 $this->node_id = $a_id;
84 $this->access_handler = $ilAccess;
85 $this->call_by_reference =
true;
89 case self::REPOSITORY_OBJECT_ID:
90 $this->object_id = $a_id;
92 $this->access_handler = $ilAccess;
96 case self::WORKSPACE_NODE_ID:
98 $this->node_id = $a_id;
99 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
102 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
104 $params[] =
"wsp_id";
107 case self::WORKSPACE_OBJECT_ID:
109 $this->object_id = $a_id;
110 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
112 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
114 $params[] =
"obj_id";
117 case self::OBJECT_ID:
118 $this->object_id = $a_id;
119 include_once
"Services/Object/classes/class.ilDummyAccessHandler.php";
121 $params[] =
"obj_id";
124 $this->ctrl->saveParameter($this, $params);
129 if(!$this->object_id)
131 $this->creation_mode =
true;
136 if(!$this->parent_id && $this->tree)
138 $this->parent_id = $this->tree->getParentId($this->node_id);
149 if (is_object($this->
object))
151 $this->ctrl->setContext($this->object->getId(), $this->
object->getType());
171 $next_class = $this->ctrl->getNextClass($this);
172 $cmd = $this->ctrl->getCmd();
178 case "ilworkspaceaccessgui";
181 $this->tabs_gui->activateTab(
"id_permissions");
183 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
185 $this->ctrl->forwardCommand($wspacc);
194 return $this->
$cmd();
205 if ($this->object_id != 0)
207 switch($this->id_type)
209 case self::OBJECT_ID:
210 case self::REPOSITORY_OBJECT_ID:
211 case self::WORKSPACE_OBJECT_ID:
215 case self::REPOSITORY_NODE_ID:
219 case self::WORKSPACE_NODE_ID:
242 global $ilLocator,
$tpl;
244 if ($this->omit_locator)
249 switch($this->id_type)
251 case self::REPOSITORY_NODE_ID:
255 $ilLocator->addRepositoryItems(
$ref_id);
258 if (
$_GET[
"admin_mode"] ==
"" &&
259 strtolower($this->ctrl->getCmdClass()) ==
"ilobjrolegui")
261 $this->ctrl->setParameterByClass(
"ilobjrolegui",
262 "rolf_ref_id",
$_GET[
"rolf_ref_id"]);
263 $this->ctrl->setParameterByClass(
"ilobjrolegui",
264 "obj_id",
$_GET[
"obj_id"]);
265 $ilLocator->addItem($this->lng->txt(
"role"),
266 $this->ctrl->getLinkTargetByClass(array(
"ilpermissiongui",
267 "ilobjrolegui"),
"perm"));
279 case self::WORKSPACE_NODE_ID:
290 public function delete()
292 switch($this->id_type)
294 case self::REPOSITORY_NODE_ID:
295 case self::REPOSITORY_OBJECT_ID:
298 case self::WORKSPACE_NODE_ID:
299 case self::WORKSPACE_OBJECT_ID:
302 case self::OBJECT_ID:
321 $this->ctrl->redirect($this,
"");
325 $parent_node = $this->tree->getParentId(
$node_id);
326 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
328 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
330 $cgui->setHeaderText($lng->txt(
"info_delete_sure").
"<br/>".
331 $lng->txt(
"info_delete_warning_no_trash"));
333 $cgui->setFormAction($this->ctrl->getFormAction($this));
334 $cgui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
335 $cgui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
340 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
341 foreach($children as $child)
343 $node_id = $child[
"wsp_id"];
344 $obj_id = $this->tree->lookupObjectId($node_id);
352 $this->ctrl->redirect($this);
355 $cgui->addItem(
"id[]", $node_id,
$title,
357 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$type));
361 $tpl->setContent($cgui->getHTML());
369 switch($this->id_type)
371 case self::REPOSITORY_NODE_ID:
372 case self::REPOSITORY_OBJECT_ID:
375 case self::WORKSPACE_NODE_ID:
376 case self::WORKSPACE_OBJECT_ID:
379 case self::OBJECT_ID:
398 $node = $this->tree->getNodeData($node_id);
401 $this->tree->deleteReference($node_id);
402 $this->tree->deleteTree($node);
422 $this->ctrl->redirect($this,
"");
449 final public function trash() {
return parent::trashObject(); }
451 final public function undelete() {
return parent::undeleteObject(); }
474 switch($this->id_type)
476 case self::REPOSITORY_NODE_ID:
477 case self::REPOSITORY_OBJECT_ID:
480 case self::WORKSPACE_NODE_ID:
481 case self::WORKSPACE_OBJECT_ID:
482 return $this->render();
484 case self::OBJECT_ID:
497 global $ilTabs,
$lng;
499 switch($this->id_type)
501 case self::REPOSITORY_NODE_ID:
502 case self::REPOSITORY_OBJECT_ID:
505 $ilTabs->addTab(
"id_permissions",
506 $lng->txt(
"perm_settings"),
507 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilpermissiongui"),
"perm"));
511 case self::WORKSPACE_NODE_ID:
512 case self::WORKSPACE_OBJECT_ID:
516 $ilTabs->addTab(
"id_permissions",
517 $lng->txt(
"wsp_permissions"),
518 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilworkspaceaccessgui"),
"share"));
530 final protected function getReturnLocation() { die(
"ilObject2GUI::getReturnLocation() is deprecated."); }
531 final protected function setReturnLocation() { die(
"ilObject2GUI::setReturnLocation() is deprecated."); }
532 final protected function showActions() { die(
"ilObject2GUI::showActions() is deprecated."); }
533 final protected function getTitlesByRefId() { die(
"ilObject2GUI::getTitlesByRefId() is deprecated."); }
534 final protected function getTabs() {nj(); die(
"ilObject2GUI::getTabs() is deprecated."); }
535 final protected function __showButton() { die(
"ilObject2GUI::__showButton() is deprecated."); }
536 final protected function hitsperpageObject() { die(
"ilObject2GUI::hitsperpageObject() is deprecated."); }
537 final protected function __initTableGUI() { die(
"ilObject2GUI::__initTableGUI() is deprecated."); }
539 final protected function __showClipboardTable() { die(
"ilObject2GUI::__showClipboardTable() is deprecated."); }
587 if($this->id_type == self::WORKSPACE_NODE_ID)
589 unset($forms[self::CFORM_CLONE]);
615 $this->object_id = $a_obj->
getId();
617 if(!$a_parent_node_id)
625 $a_parent_node_id = (int)$_REQUEST[
"crtptrefid"];
628 switch($this->id_type)
630 case self::REPOSITORY_NODE_ID:
631 case self::REPOSITORY_OBJECT_ID:
635 $this->node_id = $a_obj->
getRefId();
641 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
642 $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id,
false);
646 $this->ctrl->setParameter($this,
"ref_id", $this->node_id);
649 case self::WORKSPACE_NODE_ID:
650 case self::WORKSPACE_OBJECT_ID:
653 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
655 $this->
getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
657 $this->ctrl->setParameter($this,
"wsp_id", $this->node_id);
660 case self::OBJECT_ID:
666 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
671 if($_REQUEST[
"crtcb"])
674 $class_name =
"ilObj".$objDefinition->getClassName($callback_type).
"GUI";
675 $location = $objDefinition->getLocation($callback_type);
676 include_once(
$location.
"/class.".$class_name.
".php");
677 if (in_array(strtolower($class_name), array(
"ilobjitemgroupgui")))
679 $callback_obj =
new $class_name((
int)$_REQUEST[
"crtcb"]);
683 $callback_obj =
new $class_name(null, (
int)$_REQUEST[
"crtcb"],
true,
false);
685 $callback_obj->afterSaveCallback($a_obj);
702 if($a_perm ==
"create")
710 return $this->
getAccessHandler()->checkAccess($a_perm.
"_".$a_type, $a_cmd, $a_node_id);
727 if($this->obj_id && $this->object->getOwner() == $ilUser->getId())
745 if($this->id_type == self::WORKSPACE_NODE_ID)
747 if(!$this->creation_mode && $this->object_id)
749 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
753 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
755 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
756 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
757 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
758 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
760 $lg = $dispatcher->initHeaderAction();
767 $lg->setContainerObject($this);
772 $lg->enableNotes(
true);
795 if($this->id_type == self::WORKSPACE_NODE_ID)
800 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
802 $plink->setIncludePermanentLinkText(
false);
803 $plink->setAlignCenter($a_center);
804 return $plink->getHTML();