4 include_once(
"./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/Objects/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());
169 $next_class = $this->ctrl->getNextClass($this);
170 $cmd = $this->ctrl->getCmd();
176 case "ilworkspaceaccessgui";
179 $this->tabs_gui->activateTab(
"id_permissions");
181 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
183 $this->ctrl->forwardCommand($wspacc);
192 return $this->
$cmd();
203 if ($this->object_id != 0)
205 switch($this->id_type)
207 case self::OBJECT_ID:
208 case self::REPOSITORY_OBJECT_ID:
209 case self::WORKSPACE_OBJECT_ID:
213 case self::REPOSITORY_NODE_ID:
217 case self::WORKSPACE_NODE_ID:
240 global $ilLocator,
$tpl;
242 if ($this->omit_locator)
247 switch($this->id_type)
249 case self::REPOSITORY_NODE_ID:
253 $ilLocator->addRepositoryItems(
$ref_id);
256 if (
$_GET[
"admin_mode"] ==
"" &&
257 strtolower($this->ctrl->getCmdClass()) ==
"ilobjrolegui")
259 $this->ctrl->setParameterByClass(
"ilobjrolegui",
260 "rolf_ref_id",
$_GET[
"rolf_ref_id"]);
261 $this->ctrl->setParameterByClass(
"ilobjrolegui",
262 "obj_id",
$_GET[
"obj_id"]);
263 $ilLocator->addItem($this->lng->txt(
"role"),
264 $this->ctrl->getLinkTargetByClass(array(
"ilpermissiongui",
265 "ilobjrolegui"),
"perm"));
277 case self::WORKSPACE_NODE_ID:
288 public function delete()
290 switch($this->id_type)
292 case self::REPOSITORY_NODE_ID:
293 case self::REPOSITORY_OBJECT_ID:
296 case self::WORKSPACE_NODE_ID:
297 case self::WORKSPACE_OBJECT_ID:
300 case self::OBJECT_ID:
319 $this->ctrl->redirect($this,
"");
323 $parent_node = $this->tree->getParentId(
$node_id);
324 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
326 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
328 $cgui->setHeaderText($lng->txt(
"info_delete_sure").
"<br/>".
329 $lng->txt(
"info_delete_warning_no_trash"));
331 $cgui->setFormAction($this->ctrl->getFormAction($this));
332 $cgui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
333 $cgui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
338 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
339 foreach($children as $child)
341 $node_id = $child[
"wsp_id"];
342 $obj_id = $this->tree->lookupObjectId($node_id);
350 $this->ctrl->redirect($this);
353 $cgui->addItem(
"id[]", $node_id,
$title,
355 $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$type));
359 $tpl->setContent($cgui->getHTML());
367 switch($this->id_type)
369 case self::REPOSITORY_NODE_ID:
370 case self::REPOSITORY_OBJECT_ID:
373 case self::WORKSPACE_NODE_ID:
374 case self::WORKSPACE_OBJECT_ID:
377 case self::OBJECT_ID:
396 $node = $this->tree->getNodeData($node_id);
399 $this->tree->deleteReference($node_id);
400 $this->tree->deleteTree($node);
420 $this->ctrl->redirect($this,
"");
472 switch($this->id_type)
474 case self::REPOSITORY_NODE_ID:
475 case self::REPOSITORY_OBJECT_ID:
478 case self::WORKSPACE_NODE_ID:
479 case self::WORKSPACE_OBJECT_ID:
480 return $this->render();
482 case self::OBJECT_ID:
495 global $ilTabs,
$lng;
497 switch($this->id_type)
499 case self::REPOSITORY_NODE_ID:
500 case self::REPOSITORY_OBJECT_ID:
503 $ilTabs->addTab(
"id_permissions",
504 $lng->txt(
"perm_settings"),
505 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilpermissiongui"),
"perm"));
509 case self::WORKSPACE_NODE_ID:
510 case self::WORKSPACE_OBJECT_ID:
514 $ilTabs->addTab(
"id_permissions",
515 $lng->txt(
"wsp_permissions"),
516 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilworkspaceaccessgui"),
"share"));
528 final protected function getReturnLocation() { die(
"ilObject2GUI::getReturnLocation() is deprecated."); }
529 final protected function setReturnLocation() { die(
"ilObject2GUI::setReturnLocation() is deprecated."); }
530 final protected function showActions() { die(
"ilObject2GUI::showActions() is deprecated."); }
531 final public function getTemplateFile() {mk(); die(
"ilObject2GUI::getTemplateFile() is deprecated."); }
532 final protected function getTitlesByRefId() { die(
"ilObject2GUI::getTitlesByRefId() is deprecated."); }
533 final protected function getTabs() {nj(); die(
"ilObject2GUI::getTabs() is deprecated."); }
534 final protected function __showButton() { die(
"ilObject2GUI::__showButton() is deprecated."); }
535 final protected function hitsperpageObject() { die(
"ilObject2GUI::hitsperpageObject() is deprecated."); }
536 final protected function __initTableGUI() { die(
"ilObject2GUI::__initTableGUI() is deprecated."); }
538 final protected function __showClipboardTable() { die(
"ilObject2GUI::__showClipboardTable() is deprecated."); }
587 if($this->id_type == self::WORKSPACE_NODE_ID)
589 unset($forms[self::CFORM_CLONE]);
613 global $rbacreview, $ilUser;
615 $this->object_id = $a_obj->
getId();
617 if(!$a_parent_node_id)
622 switch($this->id_type)
624 case self::REPOSITORY_NODE_ID:
625 case self::REPOSITORY_OBJECT_ID:
629 $this->node_id = $a_obj->
getRefId();
635 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
636 $rbac_log_roles = $rbacreview->getParentRoleIds($this->node_id,
false);
640 $this->ctrl->setParameter($this,
"ref_id", $this->node_id);
643 case self::WORKSPACE_NODE_ID:
644 case self::WORKSPACE_OBJECT_ID:
647 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
649 $this->
getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
651 $this->ctrl->setParameter($this,
"wsp_id", $this->node_id);
654 case self::OBJECT_ID:
660 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
678 if($a_perm ==
"create")
686 return $this->
getAccessHandler()->checkAccess($a_perm.
"_".$a_type, $a_cmd, $a_node_id, $a_type);
703 if($this->obj_id && $this->object->getOwner() == $ilUser->getId())
721 if($this->id_type == self::WORKSPACE_NODE_ID)
723 if(!$this->creation_mode && $this->object_id)
725 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
729 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
731 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
732 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
733 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
734 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
736 $lg = $dispatcher->initHeaderAction();
743 $lg->setContainerObject($this);
748 $lg->enableNotes(
true);
771 if($this->id_type == self::WORKSPACE_NODE_ID)
776 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
778 $plink->setIncludePermanentLinkText(
false);
779 $plink->setAlignCenter($a_center);
780 return $plink->getHTML();