/** * (Re-)Build instance from ajax call * * @return object */ static function getInstanceFromAjaxCall() { global $ilAccess, $ilUser; if (isset($_GET["cadh"])) { $parts = explode(";", (string) $_GET["cadh"]); $node_type = $parts[0]; $node_id = $parts[1]; $obj_type = $parts[2]; $obj_id = $parts[3]; $sub_type = $parts[4]; $sub_id = $parts[5]; switch ($node_type) { case self::TYPE_REPOSITORY: $access_handler = $ilAccess; break; case self::TYPE_WORKSPACE: include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $tree = new ilWorkspaceTree($ilUser->getId()); include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $access_handler = new ilWorkspaceAccessHandler($tree); break; default: return null; } $dispatcher = new self($node_type, $access_handler, $obj_type, $node_id, $obj_id); if ($sub_type && $sub_id) { $dispatcher->setSubObject($sub_type, $sub_id); } if ($node_type == self::TYPE_REPOSITORY) { $dispatcher->enableCommentsSettings(true); } return $dispatcher; } }