{"action":"created","comment":{"url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/comments/28027497","id":28027497,"diff_hunk":"@@ -0,0 +1,95 @@\n+<?php\n+/**\n+ *\n+ * Collapsible Categories extension for the phpBB Forum Software package.\n+ *\n+ * @copyright (c) 2015 phpBB Limited <https://www.phpbb.com>\n+ * @license GNU General Public License, version 2 (GPL-2.0)\n+ *\n+ */\n+\n+namespace phpbb\\collapsiblecategories\\controller;\n+\n+class controller implements main_interface\n+{\n+\t/** @var \\phpbb\\config\\config */\n+\tprotected $config;\n+\n+\t/** @var \\phpbb\\controller\\helper */\n+\tprotected $helper;\n+\n+\t/** @var \\phpbb\\template\\template */\n+\tprotected $template;\n+\n+\t/** @var \\phpbb\\user */\n+\tprotected $user;\n+\n+\t/** @var string phpBB root path */\n+\tprotected $root_path;\n+\n+\t/** @var string phpEx */\n+\tprotected $php_ext;\n+\n+\t/**\n+\t* Constructor\n+\t*\n+\t* @param \\phpbb\\config\\config                $config             Config object\n+\t* @param \\phpbb\\controller\\helper            $helper             Controller helper object\n+\t* @param \\phpbb\\boardrules\\operators\\rule    $rule_operator      Rule operator object\n+\t* @param \\phpbb\\template\\template            $template           Template object\n+\t* @param \\phpbb\\user                         $user               User object\n+\t* @param string                              $root_path          phpBB root path\n+\t* @param string                              $php_ext            phpEx\n+\t* @access public\n+\t*/\n+\tpublic function __construct(\\phpbb\\config\\config $config, \\phpbb\\controller\\helper $helper, \\phpbb\\template\\template $template, \\phpbb\\user $user, $root_path, $php_ext)\n+\t{\n+\t\t$this->config = $config;\n+\t\t$this->helper = $helper;\n+\t\t$this->template = $template;\n+\t\t$this->user = $user;\n+\t\t$this->root_path = $root_path;\n+\t\t$this->php_ext = $php_ext;\n+\t}\n+\n+\t/**\n+\t * This method processes AJAX requests for collapsible categories\n+\t * when a user collapses/expands a category. Collapsed categories\n+\t * will be stored to the user's db and cookie. Expanded categories\n+\t * will be removed from the user's db and cookie.\n+\t *\n+\t * @param int $forum_id A forum identifier\n+\t *\n+\t * @throws \\phpbb\\exception\\http_exception An http exception\n+\t * @return \\Symfony\\Component\\HttpFoundation\\JsonResponse A Symfony JSON Response object\n+\t * @access public\n+\t */\n+\tpublic function handle($forum_id)\n+\t{\n+\t\t// If this is no ajax request, it is not supported, so we throw an exception\n+\t\tif (!$this->request->is_ajax())\n+\t\t{\n+\t\t\tthrow new \\phpbb\\exception\\http_exception(403, 'NO_AUTH_OPERATION');\n+\t\t}\n+\n+\t\t// When the route is called without a parameter, 0 is used. This is no valid request, so we throw an error here\n+\t\tif ($forum_id == 0)\n+\t\t{\n+\t\t\tthrow new \\phpbb\\exception\\http_exception(500, 'GENERAL_ERROR');\n+\t\t}\n+\n+\t\t// Set a cookie\n+\t\t$response = $this->operator->set_cookie_categories($forum_id);","path":"controller/main_controller.php","position":82,"original_position":82,"commit_id":"6e18596d0cce842aab59dc4e6b1eeedb681e775a","original_commit_id":"6e18596d0cce842aab59dc4e6b1eeedb681e775a","user":{"login":"VSEphpbb","id":303711,"avatar_url":"https://avatars.githubusercontent.com/u/303711?v=3","gravatar_id":"","url":"https://api.github.com/users/VSEphpbb","html_url":"https://github.com/VSEphpbb","followers_url":"https://api.github.com/users/VSEphpbb/followers","following_url":"https://api.github.com/users/VSEphpbb/following{/other_user}","gists_url":"https://api.github.com/users/VSEphpbb/gists{/gist_id}","starred_url":"https://api.github.com/users/VSEphpbb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSEphpbb/subscriptions","organizations_url":"https://api.github.com/users/VSEphpbb/orgs","repos_url":"https://api.github.com/users/VSEphpbb/repos","events_url":"https://api.github.com/users/VSEphpbb/events{/privacy}","received_events_url":"https://api.github.com/users/VSEphpbb/received_events","type":"User","site_admin":false},"body":"this is not needed. we are not setting any cookies at this point","created_at":"2015-04-09T00:36:28Z","updated_at":"2015-04-09T00:36:28Z","html_url":"https://github.com/phpbb-extensions/collapsible-categories/pull/8#discussion_r28027497","pull_request_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/comments/28027497"},"html":{"href":"https://github.com/phpbb-extensions/collapsible-categories/pull/8#discussion_r28027497"},"pull_request":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8","id":32915628,"html_url":"https://github.com/phpbb-extensions/collapsible-categories/pull/8","diff_url":"https://github.com/phpbb-extensions/collapsible-categories/pull/8.diff","patch_url":"https://github.com/phpbb-extensions/collapsible-categories/pull/8.patch","issue_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/8","number":8,"state":"open","locked":false,"title":"Adding controller for ajax calls","user":{"login":"Wolfsblvt","id":9962104,"avatar_url":"https://avatars.githubusercontent.com/u/9962104?v=3","gravatar_id":"","url":"https://api.github.com/users/Wolfsblvt","html_url":"https://github.com/Wolfsblvt","followers_url":"https://api.github.com/users/Wolfsblvt/followers","following_url":"https://api.github.com/users/Wolfsblvt/following{/other_user}","gists_url":"https://api.github.com/users/Wolfsblvt/gists{/gist_id}","starred_url":"https://api.github.com/users/Wolfsblvt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wolfsblvt/subscriptions","organizations_url":"https://api.github.com/users/Wolfsblvt/orgs","repos_url":"https://api.github.com/users/Wolfsblvt/repos","events_url":"https://api.github.com/users/Wolfsblvt/events{/privacy}","received_events_url":"https://api.github.com/users/Wolfsblvt/received_events","type":"User","site_admin":false},"body":"I have added the controller with an implementation of the handling of ajax calls for collapsing categories.","created_at":"2015-04-09T00:30:06Z","updated_at":"2015-04-09T00:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ae1dfc7c3ae3617f9daf0c8ba07a12960e72c4a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8/commits","review_comments_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8/comments","review_comment_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/8/comments","statuses_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/statuses/6e18596d0cce842aab59dc4e6b1eeedb681e775a","head":{"label":"Wolfsblvt:collapsible-controller","ref":"collapsible-controller","sha":"6e18596d0cce842aab59dc4e6b1eeedb681e775a","user":{"login":"Wolfsblvt","id":9962104,"avatar_url":"https://avatars.githubusercontent.com/u/9962104?v=3","gravatar_id":"","url":"https://api.github.com/users/Wolfsblvt","html_url":"https://github.com/Wolfsblvt","followers_url":"https://api.github.com/users/Wolfsblvt/followers","following_url":"https://api.github.com/users/Wolfsblvt/following{/other_user}","gists_url":"https://api.github.com/users/Wolfsblvt/gists{/gist_id}","starred_url":"https://api.github.com/users/Wolfsblvt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wolfsblvt/subscriptions","organizations_url":"https://api.github.com/users/Wolfsblvt/orgs","repos_url":"https://api.github.com/users/Wolfsblvt/repos","events_url":"https://api.github.com/users/Wolfsblvt/events{/privacy}","received_events_url":"https://api.github.com/users/Wolfsblvt/received_events","type":"User","site_admin":false},"repo":{"id":33537961,"name":"collapsible-categories","full_name":"Wolfsblvt/collapsible-categories","owner":{"login":"Wolfsblvt","id":9962104,"avatar_url":"https://avatars.githubusercontent.com/u/9962104?v=3","gravatar_id":"","url":"https://api.github.com/users/Wolfsblvt","html_url":"https://github.com/Wolfsblvt","followers_url":"https://api.github.com/users/Wolfsblvt/followers","following_url":"https://api.github.com/users/Wolfsblvt/following{/other_user}","gists_url":"https://api.github.com/users/Wolfsblvt/gists{/gist_id}","starred_url":"https://api.github.com/users/Wolfsblvt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wolfsblvt/subscriptions","organizations_url":"https://api.github.com/users/Wolfsblvt/orgs","repos_url":"https://api.github.com/users/Wolfsblvt/repos","events_url":"https://api.github.com/users/Wolfsblvt/events{/privacy}","received_events_url":"https://api.github.com/users/Wolfsblvt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Wolfsblvt/collapsible-categories","description":"Collapsible Categories extension for phpBB 3.1","fork":true,"url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories","forks_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/forks","keys_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/teams","hooks_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/hooks","issue_events_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/issues/events{/number}","events_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/events","assignees_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/assignees{/user}","branches_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/branches{/branch}","tags_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/tags","blobs_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/statuses/{sha}","languages_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/languages","stargazers_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/stargazers","contributors_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/contributors","subscribers_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/subscribers","subscription_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/subscription","commits_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/contents/{+path}","compare_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/merges","archive_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/downloads","issues_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/issues{/number}","pulls_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/pulls{/number}","milestones_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/milestones{/number}","notifications_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/labels{/name}","releases_url":"https://api.github.com/repos/Wolfsblvt/collapsible-categories/releases{/id}","created_at":"2015-04-07T10:59:56Z","updated_at":"2015-04-08T23:28:09Z","pushed_at":"2015-04-09T00:29:48Z","git_url":"git://github.com/Wolfsblvt/collapsible-categories.git","ssh_url":"git@github.com:Wolfsblvt/collapsible-categories.git","clone_url":"https://github.com/Wolfsblvt/collapsible-categories.git","svn_url":"https://github.com/Wolfsblvt/collapsible-categories","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"phpbb-extensions:master","ref":"master","sha":"a1996ea0a5ee16fd8ff6dc50de6024f229e9584e","user":{"login":"phpbb-extensions","id":5825776,"avatar_url":"https://avatars.githubusercontent.com/u/5825776?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbb-extensions","html_url":"https://github.com/phpbb-extensions","followers_url":"https://api.github.com/users/phpbb-extensions/followers","following_url":"https://api.github.com/users/phpbb-extensions/following{/other_user}","gists_url":"https://api.github.com/users/phpbb-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbb-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbb-extensions/subscriptions","organizations_url":"https://api.github.com/users/phpbb-extensions/orgs","repos_url":"https://api.github.com/users/phpbb-extensions/repos","events_url":"https://api.github.com/users/phpbb-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/phpbb-extensions/received_events","type":"Organization","site_admin":false},"repo":{"id":33328087,"name":"collapsible-categories","full_name":"phpbb-extensions/collapsible-categories","owner":{"login":"phpbb-extensions","id":5825776,"avatar_url":"https://avatars.githubusercontent.com/u/5825776?v=3","gravatar_id":"","url":"https://api.github.com/users/phpbb-extensions","html_url":"https://github.com/phpbb-extensions","followers_url":"https://api.github.com/users/phpbb-extensions/followers","following_url":"https://api.github.com/users/phpbb-extensions/following{/other_user}","gists_url":"https://api.github.com/users/phpbb-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbb-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbb-extensions/subscriptions","organizations_url":"https://api.github.com/users/phpbb-extensions/orgs","repos_url":"https://api.github.com/users/phpbb-extensions/repos","events_url":"https://api.github.com/users/phpbb-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/phpbb-extensions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpbb-extensions/collapsible-categories","description":"Collapsible Categories extension for phpBB 3.1","fork":false,"url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories","forks_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/forks","keys_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/teams","hooks_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/hooks","issue_events_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/events{/number}","events_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/events","assignees_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/assignees{/user}","branches_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/branches{/branch}","tags_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/tags","blobs_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/statuses/{sha}","languages_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/languages","stargazers_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/stargazers","contributors_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/contributors","subscribers_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/subscribers","subscription_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/subscription","commits_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/comments{/number}","contents_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/contents/{+path}","compare_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/merges","archive_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/downloads","issues_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues{/number}","pulls_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls{/number}","milestones_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/milestones{/number}","notifications_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/labels{/name}","releases_url":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/releases{/id}","created_at":"2015-04-02T19:37:42Z","updated_at":"2015-04-08T18:46:02Z","pushed_at":"2015-04-09T00:31:12Z","git_url":"git://github.com/phpbb-extensions/collapsible-categories.git","ssh_url":"git@github.com:phpbb-extensions/collapsible-categories.git","clone_url":"https://github.com/phpbb-extensions/collapsible-categories.git","svn_url":"https://github.com/phpbb-extensions/collapsible-categories","homepage":"","size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8"},"html":{"href":"https://github.com/phpbb-extensions/collapsible-categories/pull/8"},"issue":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/8"},"comments":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/phpbb-extensions/collapsible-categories/statuses/6e18596d0cce842aab59dc4e6b1eeedb681e775a"}}}}