4 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
51 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
60 $ilTabs = $DIC[
"ilTabs"];
62 $ilAccess = $DIC[
"ilAccess"];
63 $this->object_service = $DIC->object();
72 $this->id_type = $a_id_type;
73 $this->parent_id = $a_parent_node_id;
77 $this->tabs_gui = $ilTabs;
85 $this->locator = $DIC[
"ilLocator"];
86 $this->
user = $DIC->user();
87 $this->access = $DIC->access();
90 $this->toolbar = $DIC->toolbar();
94 switch ($this->id_type) {
95 case self::REPOSITORY_NODE_ID:
96 $this->node_id = $a_id;
99 $this->access_handler = $ilAccess;
100 $this->call_by_reference =
true;
104 case self::REPOSITORY_OBJECT_ID:
105 $this->object_id = $a_id;
107 $this->access_handler = $ilAccess;
111 case self::WORKSPACE_NODE_ID:
113 $this->node_id = $a_id;
114 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
117 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
122 case self::WORKSPACE_OBJECT_ID:
124 $this->object_id = $a_id;
125 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
127 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
132 case self::PORTFOLIO_OBJECT_ID:
133 $this->object_id = $a_id;
134 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php');
139 case self::OBJECT_ID:
140 $this->object_id = $a_id;
141 include_once
"Services/Object/classes/class.ilDummyAccessHandler.php";
146 $this->ctrl->saveParameter($this,
$params);
151 if (!$this->object_id) {
152 $this->creation_mode =
true;
154 if ($this->node_id) {
156 if (!$this->parent_id && $this->tree) {
157 $this->parent_id = $this->tree->getParentId($this->node_id);
168 if (is_object($this->
object)) {
169 $this->ctrl->setContext($this->object->getId(), $this->
object->getType());
187 $next_class = $this->ctrl->getNextClass($this);
188 $cmd = $this->ctrl->getCmd();
192 switch ($next_class) {
193 case "ilworkspaceaccessgui":
194 if ($this->node_id) {
195 $this->tabs_gui->activateTab(
"id_permissions");
197 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
199 $this->ctrl->forwardCommand($wspacc);
208 return $this->$cmd();
219 if ($this->object_id != 0) {
220 switch ($this->id_type) {
221 case self::OBJECT_ID:
222 case self::REPOSITORY_OBJECT_ID:
223 case self::WORKSPACE_OBJECT_ID:
224 case self::PORTFOLIO_OBJECT_ID:
228 case self::REPOSITORY_NODE_ID:
232 case self::WORKSPACE_NODE_ID:
257 $ilLocator = $DIC[
"ilLocator"];
260 if ($this->omit_locator) {
264 switch ($this->id_type) {
265 case self::REPOSITORY_NODE_ID:
269 $ilLocator->addRepositoryItems(
$ref_id);
272 if (
$_GET[
"admin_mode"] ==
"" &&
273 strtolower($this->ctrl->getCmdClass()) ==
"ilobjrolegui") {
274 $this->ctrl->setParameterByClass(
279 $this->ctrl->setParameterByClass(
285 $this->lng->txt(
"role"),
286 $this->ctrl->getLinkTargetByClass(array(
"ilpermissiongui",
287 "ilobjrolegui"),
"perm")
292 if ($this->object_id) {
299 case self::WORKSPACE_NODE_ID:
308 public function delete()
310 switch ($this->id_type) {
311 case self::REPOSITORY_NODE_ID:
312 case self::REPOSITORY_OBJECT_ID:
313 return parent::deleteObject();
315 case self::WORKSPACE_NODE_ID:
316 case self::WORKSPACE_OBJECT_ID:
319 case self::OBJECT_ID:
320 case self::PORTFOLIO_OBJECT_ID:
338 $node_id = (int) $_REQUEST[
"item_ref_id"];
341 $this->ctrl->redirect($this,
"");
345 $parent_node = $this->tree->getParentId(
$node_id);
346 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
348 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
350 $cgui->setHeaderText(
$lng->txt(
"info_delete_sure") .
"<br/>" .
351 $lng->txt(
"info_delete_warning_no_trash"));
353 $cgui->setFormAction($this->ctrl->getFormAction($this));
354 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelDelete");
355 $cgui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
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);
369 $this->ctrl->redirect($this);
382 $tpl->setContent($cgui->getHTML());
390 switch ($this->id_type) {
391 case self::REPOSITORY_NODE_ID:
392 case self::REPOSITORY_OBJECT_ID:
393 return parent::confirmedDeleteObject();
395 case self::WORKSPACE_NODE_ID:
396 case self::WORKSPACE_OBJECT_ID:
399 case self::OBJECT_ID:
400 case self::PORTFOLIO_OBJECT_ID:
418 if (
sizeof(
$_POST[
"id"])) {
420 $del_nodes = array();
422 $del_nodes[
$node_id] = $this->tree->getNodeData($node_id);
425 foreach ($del_nodes as $node_id => $node) {
427 $this->tree->deleteReference($node_id);
428 if ($this->tree->isInTree($node_id)) {
429 $this->tree->deleteTree($node);
442 ilUtil::sendSuccess(
$lng->txt(
"msg_removed"),
true);
447 $this->ctrl->redirect($this,
"");
452 return parent::getHTML();
460 return parent::withReferences();
464 return parent::setCreationMode($a_mode);
468 return parent::getCreationMode();
472 return parent::prepareOutput($a_show_subobjects);
476 return parent::setTitleAndDescription();
480 return parent::showUpperIcon();
485 return parent::omitLocator($a_omit);
489 return parent::getTargetFrame($a_cmd, $a_target_frame);
493 return parent::setTargetFrame($a_cmd, $a_target_frame);
497 return parent::isVisible($a_ref_id,
$a_type);
501 return parent::getCenterColumnHTML();
505 return parent::getRightColumnHTML();
509 return parent::setColumnSettings($column_gui);
513 return parent::checkPermission($a_perm, $a_cmd,
$a_type, $a_ref_id);
519 return parent::showPossibleSubObjects();
524 return parent::trashObject();
529 return parent::undeleteObject();
533 return parent::cancelDeleteObject();
537 return parent::removeFromSystemObject();
541 return parent::redirectToRefId();
547 return parent::fillCloneTemplate($a_tpl_varname,
$a_type);
551 return parent::fillCloneSearchTemplate($a_tpl_varname,
$a_type);
555 return parent::searchCloneSourceObject();
559 return parent::cloneAllObject();
563 return parent::buildCloneSelect($existing_objs);
569 return parent::displayList();
575 return parent::addAdminLocatorItems($a_do_not_add_object);
583 switch ($this->id_type) {
584 case self::REPOSITORY_NODE_ID:
585 case self::REPOSITORY_OBJECT_ID:
586 return parent::viewObject();
588 case self::WORKSPACE_NODE_ID:
589 case self::WORKSPACE_OBJECT_ID:
590 return $this->render();
592 case self::OBJECT_ID:
593 case self::PORTFOLIO_OBJECT_ID:
608 $ilTabs = $DIC[
"ilTabs"];
612 switch ($this->id_type) {
613 case self::REPOSITORY_NODE_ID:
614 case self::REPOSITORY_OBJECT_ID:
618 $lng->txt(
"perm_settings"),
619 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilpermissiongui"),
"perm")
624 case self::WORKSPACE_NODE_ID:
625 case self::WORKSPACE_OBJECT_ID:
630 $lng->txt(
"wsp_permissions"),
631 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilworkspaceaccessgui"),
"share")
646 die(
"ilObject2GUI::getReturnLocation() is deprecated.");
650 die(
"ilObject2GUI::setReturnLocation() is deprecated.");
654 die(
"ilObject2GUI::showActions() is deprecated.");
658 die(
"ilObject2GUI::getTabs() is deprecated.");
662 die(
"ilObject2GUI::__showButton() is deprecated.");
666 die(
"ilObject2GUI::hitsperpageObject() is deprecated.");
670 die(
"ilObject2GUI::__initTableGUI() is deprecated.");
674 die(
"ilObject2GUI::__setTableGUIBasicData() is deprecated.");
687 abstract public function getType();
708 parent::createObject();
712 parent::saveObject();
716 parent::editObject();
720 parent::updateObject();
724 parent::cancelObject();
737 $forms = parent::initCreationForms($a_new_type);
740 if ($this->id_type == self::WORKSPACE_NODE_ID) {
741 unset($forms[self::CFORM_CLONE]);
754 parent::importFileObject($this->parent_id);
771 $this->object_id = $a_obj->
getId();
773 if (!$a_parent_node_id) {
778 if ((
int) $_REQUEST[
"crtptrefid"]) {
779 $a_parent_node_id = (int) $_REQUEST[
"crtptrefid"];
782 switch ($this->id_type) {
783 case self::REPOSITORY_NODE_ID:
784 case self::REPOSITORY_OBJECT_ID:
785 if (!$this->node_id) {
787 $this->node_id = $a_obj->
getRefId();
793 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
794 $rbac_log_roles =
$rbacreview->getParentRoleIds($this->node_id,
false);
798 $this->ctrl->setParameter($this,
"ref_id", $this->node_id);
801 case self::WORKSPACE_NODE_ID:
802 case self::WORKSPACE_OBJECT_ID:
803 if (!$this->node_id) {
804 $this->node_id = $this->tree->insertObject($a_parent_node_id, $this->object_id);
806 $this->
getAccessHandler()->setPermissions($a_parent_node_id, $this->node_id);
808 $this->ctrl->setParameter($this,
"wsp_id", $this->node_id);
811 case self::OBJECT_ID:
812 case self::PORTFOLIO_OBJECT_ID:
818 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
823 self::handleAfterSaveCallback($a_obj, $_REQUEST[
"crtcb"]);
839 $a_callback_ref_id = (int) $a_callback_ref_id;
840 if ($a_callback_ref_id) {
842 $class_name =
"ilObj" .
$objDefinition->getClassName($callback_type) .
"GUI";
844 include_once(
$location .
"/class." . $class_name .
".php");
845 if (in_array(strtolower($class_name), array(
"ilobjitemgroupgui"))) {
846 $callback_obj =
new $class_name($a_callback_ref_id);
848 $callback_obj =
new $class_name(null, $a_callback_ref_id,
true,
false);
850 $callback_obj->afterSaveCallback($a_obj);
870 if ($a_perm ==
"create") {
887 if ($this->obj_id && $this->object->getOwner() ==
$ilUser->getId()) {
902 if ($this->id_type == self::WORKSPACE_NODE_ID) {
903 if (!$this->creation_mode && $this->object_id) {
904 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
913 $dispatcher->setSubObject($a_sub_type, $a_sub_id);
915 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
916 ilObjectListGUI::prepareJSLinks(
917 $this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
918 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
919 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false)
922 $lg = $dispatcher->initHeaderAction();
924 if (is_object($lg)) {
927 $lg->setContainerObject($this);
932 $lg->enableNotes(
true);
939 return parent::initHeaderAction();
948 parent::redrawHeaderActionObject();
953 if ($this->id_type == self::WORKSPACE_NODE_ID) {
957 include_once(
'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
959 $plink->setIncludePermanentLinkText(
false);
960 $plink->setAlignCenter($a_center);
961 return $plink->getHTML();
971 if ($this->id_type == self::REPOSITORY_NODE_ID) {
972 parent::handleAutoRating($a_new_obj);
static getClassByType($a_obj_type)
Get class by type.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
const PEAR_ERROR_CALLBACK
executeCommand()
execute command
Class for permanent links.
view()
view object content (repository/workspace switch)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
initCreationForms($a_new_type)
Init creation froms.
getAccessHandler()
Get access handler.
fillCloneSearchTemplate($a_tpl_varname, $a_type)
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
getPermanentLinkWidget($a_append=null, $a_center=false)
confirmedDelete()
Delete objects (repository/workspace switch)
create()
Deleted in ilObject.
fillCloneTemplate($a_tpl_varname, $a_type)
Access handler for personal workspace.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
__setTableGUIBasicData(&$tbl, &$result_set, $a_from="")
const REPOSITORY_OBJECT_ID
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
Tree handler for personal workspace.
static _lookupObjectId($a_ref_id)
lookup object id
isVisible($a_ref_id, $a_type)
getReturnLocation($a_cmd, $a_location="")
Deprecated functions.
setCreationMode($a_mode=true)
createReference()
creates reference for object
setTargetFrame($a_cmd, $a_target_frame)
getId()
get object id public
__showButton($a_cmd, $a_text, $a_target='')
getType()
Functions that must be overwritten.
redirectToRefId($a_ref_id, $a_cmd="")
Column user interface class.
Class ilObjectGUI Basic methods of all Output classes.
handleAutoRating(ilObject $a_new_obj)
const PORTFOLIO_OBJECT_ID
static handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
After creation callback.
getTargetFrame($a_cmd, $a_target_frame="")
withReferences()
Final/Private declaration of unchanged parent methods.
buildCloneSelect($existing_objs)
putInTree($a_parent_ref)
maybe this method should be in tree object!?
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType($a_id, $a_reference=false)
lookup object type
const WORKSPACE_OBJECT_ID
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
redrawHeaderAction()
Updating icons after ajax call.
setTabs()
create tabs (repository/workspace switch)
setColumnSettings(ilColumnGUI $column_gui)
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
lookupObjectId($a_node_id)
Get object id for node id.
Access handler for portfolio.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
getRefId()
get reference id public
deleteConfirmedObjects()
Delete objects (workspace specific)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
prepareOutput($a_show_subobjects=true)
afterConstructor()
Do anything that should be done after constructor in here.
assignObject()
create object instance as internal property (repository/workspace switch)
addAdminLocatorItems($a_do_not_add_object=false)
deleteConfirmation()
Display delete confirmation form (workspace specific)
setReturnLocation($a_cmd, $a_location)
omitLocator($a_omit=true)
setPermissions($a_parent_ref)
set permissions of object
Class ilCommonActionDispatcherGUI.
addLocatorItems()
Functions to be overwritten.
Confirmation screen class.