protected static function createBlogInPersonalWorkspace($a_title) { global $ilUser; static $ws_access = null; include_once "Modules/Blog/classes/class.ilObjBlog.php"; $blog = new ilObjBlog(); $blog->setType("blog"); $blog->setTitle($a_title); $blog->create(); if (!$ws_access) { include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $tree = new ilWorkspaceTree($ilUser->getId()); $ws_access = new ilWorkspaceAccessHandler($tree); } $tree = $ws_access->getTree(); $node_id = $tree->insertObject($tree->getRootId(), $blog->getId()); $ws_access->setPermissions($tree->getRootId(), $node_id); return $blog->getId(); }