{"action":"created","comment":{"url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/comments/27604318","id":27604318,"diff_hunk":"@@ -0,0 +1,68 @@\n+<?php\n+/**\n+ * This file is part of the EzSystemsPrivacyCookieBundle package\n+ *\n+ * @copyright Copyright (C) eZ Systems AS. All rights reserved.\n+ * @license For full copyright and license information view LICENSE file distributed with this source code.\n+ */\n+\n+namespace EzSystems\\PrivacyCookieBundle\\Twig;\n+\n+use \\Symfony\\Component\\DependencyInjection\\ContainerInterface;\n+\n+/**\n+ * PrivacyCookie Twig helper which renders necessary snippet code.\n+ */\n+class PrivacyCookieTwigExtension extends \\Twig_Extension\n+{\n+    /**\n+     * we must inject service_container this way\n+     * @link https://github.com/symfony/symfony/issues/2347\n+     *\n+     * @var $container \\Symfony\\Component\\DependencyInjection\\ContainerInterface\n+     */\n+    protected $container;\n+\n+    public function __construct(ContainerInterface $container)\n+    {\n+        $this->container = $container;\n+    }\n+\n+    public function getName()\n+    {\n+        return 'ez_privacy_cookie_extension';\n+    }\n+\n+    public function getFunctions()\n+    {\n+        return [\n+            'show_privacy_cookie_banner' => new \\Twig_Function_Method($this, 'showPrivacyCookieBanner', [\n+                'is_safe' => [ 'html' ]\n+            ]),\n+        ];\n+    }\n+\n+    /**\n+     * Render cookie privacy banner snippet code\n+     * - should be included at the end of template before the body ending tag\n+     *\n+     * @param int $privacyPolicyContentId cookie policy content ID\n+     * @param array $options optional parameters:\n+     *        cookieName - name to be used to store cookie status\n+     *        days - for how many days this banner should be hidden when user accepts policy?\n+     *        bannerCaption - replace default banner message caption\n+     * @return string\n+     */\n+    public function showPrivacyCookieBanner($privacyPolicyContentId, array $options = array())\n+    {\n+        return $this->container->get(\"templating\")->render(\n+            '@EzSystemsPrivacyCookieBundle/Resources/views/privacycookie.html.twig',\n+            [\n+                'contentId' => $privacyPolicyContentId,\n+                'cookieName' => empty($options[ 'cookieName' ]) ? $this->container->getParameter('ez_privacy_cookie.cookie_name') : $options[ 'cookieName' ],","path":"Twig/PrivacyCookieTwigExtension.php","position":62,"original_position":62,"commit_id":"6484451d2f7f1f9c5e75877430b24046bfe7cf85","original_commit_id":"6484451d2f7f1f9c5e75877430b24046bfe7cf85","user":{"login":"bdunogier","id":235928,"avatar_url":"https://avatars.githubusercontent.com/u/235928?v=3","gravatar_id":"","url":"https://api.github.com/users/bdunogier","html_url":"https://github.com/bdunogier","followers_url":"https://api.github.com/users/bdunogier/followers","following_url":"https://api.github.com/users/bdunogier/following{/other_user}","gists_url":"https://api.github.com/users/bdunogier/gists{/gist_id}","starred_url":"https://api.github.com/users/bdunogier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdunogier/subscriptions","organizations_url":"https://api.github.com/users/bdunogier/orgs","repos_url":"https://api.github.com/users/bdunogier/repos","events_url":"https://api.github.com/users/bdunogier/events{/privacy}","received_events_url":"https://api.github.com/users/bdunogier/received_events","type":"User","site_admin":false},"body":"Please don't do that :-)\r\n\r\nInject the values from the container in services.yml. Less code, and no container required in the service anymore.","created_at":"2015-04-01T19:46:14Z","updated_at":"2015-04-01T19:46:14Z","html_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1#discussion_r27604318","pull_request_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/comments/27604318"},"html":{"href":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1#discussion_r27604318"},"pull_request":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1","id":32425436,"html_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1","diff_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1.diff","patch_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1.patch","issue_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/1","number":1,"state":"open","locked":false,"title":"EZP-24150: Implement privacy cookie law in demo bundle","user":{"login":"clash82","id":3033038,"avatar_url":"https://avatars.githubusercontent.com/u/3033038?v=3","gravatar_id":"","url":"https://api.github.com/users/clash82","html_url":"https://github.com/clash82","followers_url":"https://api.github.com/users/clash82/followers","following_url":"https://api.github.com/users/clash82/following{/other_user}","gists_url":"https://api.github.com/users/clash82/gists{/gist_id}","starred_url":"https://api.github.com/users/clash82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clash82/subscriptions","organizations_url":"https://api.github.com/users/clash82/orgs","repos_url":"https://api.github.com/users/clash82/repos","events_url":"https://api.github.com/users/clash82/events{/privacy}","received_events_url":"https://api.github.com/users/clash82/received_events","type":"User","site_admin":false},"body":"Link to Jira task: https://jira.ez.no/browse/EZP-24150\r\n\r\nSee it in action:\r\nhttps://www.youtube.com/watch?v=aVhTuGT6SiM","created_at":"2015-04-01T14:43:01Z","updated_at":"2015-04-01T19:46:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1040fa3596f12b51ac760bcf82c863c7dc7324a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/1/comments","statuses_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/statuses/6484451d2f7f1f9c5e75877430b24046bfe7cf85","head":{"label":"clash82:initial","ref":"initial","sha":"6484451d2f7f1f9c5e75877430b24046bfe7cf85","user":{"login":"clash82","id":3033038,"avatar_url":"https://avatars.githubusercontent.com/u/3033038?v=3","gravatar_id":"","url":"https://api.github.com/users/clash82","html_url":"https://github.com/clash82","followers_url":"https://api.github.com/users/clash82/followers","following_url":"https://api.github.com/users/clash82/following{/other_user}","gists_url":"https://api.github.com/users/clash82/gists{/gist_id}","starred_url":"https://api.github.com/users/clash82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clash82/subscriptions","organizations_url":"https://api.github.com/users/clash82/orgs","repos_url":"https://api.github.com/users/clash82/repos","events_url":"https://api.github.com/users/clash82/events{/privacy}","received_events_url":"https://api.github.com/users/clash82/received_events","type":"User","site_admin":false},"repo":{"id":33252783,"name":"EzSystemsPrivacyCookieBundle","full_name":"clash82/EzSystemsPrivacyCookieBundle","owner":{"login":"clash82","id":3033038,"avatar_url":"https://avatars.githubusercontent.com/u/3033038?v=3","gravatar_id":"","url":"https://api.github.com/users/clash82","html_url":"https://github.com/clash82","followers_url":"https://api.github.com/users/clash82/followers","following_url":"https://api.github.com/users/clash82/following{/other_user}","gists_url":"https://api.github.com/users/clash82/gists{/gist_id}","starred_url":"https://api.github.com/users/clash82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clash82/subscriptions","organizations_url":"https://api.github.com/users/clash82/orgs","repos_url":"https://api.github.com/users/clash82/repos","events_url":"https://api.github.com/users/clash82/events{/privacy}","received_events_url":"https://api.github.com/users/clash82/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clash82/EzSystemsPrivacyCookieBundle","description":"","fork":true,"url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle","forks_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/forks","keys_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/teams","hooks_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/hooks","issue_events_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/issues/events{/number}","events_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/events","assignees_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/assignees{/user}","branches_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/branches{/branch}","tags_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/tags","blobs_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/languages","stargazers_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/stargazers","contributors_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/contributors","subscribers_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/subscribers","subscription_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/subscription","commits_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/contents/{+path}","compare_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/merges","archive_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/downloads","issues_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/issues{/number}","pulls_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/labels{/name}","releases_url":"https://api.github.com/repos/clash82/EzSystemsPrivacyCookieBundle/releases{/id}","created_at":"2015-04-01T14:37:24Z","updated_at":"2015-04-01T14:25:12Z","pushed_at":"2015-04-01T14:42:08Z","git_url":"git://github.com/clash82/EzSystemsPrivacyCookieBundle.git","ssh_url":"git@github.com:clash82/EzSystemsPrivacyCookieBundle.git","clone_url":"https://github.com/clash82/EzSystemsPrivacyCookieBundle.git","svn_url":"https://github.com/clash82/EzSystemsPrivacyCookieBundle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"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":"ezsystems:master","ref":"master","sha":"7741e5694e94d13f38543677d22bb601e00c5450","user":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"repo":{"id":33252077,"name":"EzSystemsPrivacyCookieBundle","full_name":"ezsystems/EzSystemsPrivacyCookieBundle","owner":{"login":"ezsystems","id":295311,"avatar_url":"https://avatars.githubusercontent.com/u/295311?v=3","gravatar_id":"","url":"https://api.github.com/users/ezsystems","html_url":"https://github.com/ezsystems","followers_url":"https://api.github.com/users/ezsystems/followers","following_url":"https://api.github.com/users/ezsystems/following{/other_user}","gists_url":"https://api.github.com/users/ezsystems/gists{/gist_id}","starred_url":"https://api.github.com/users/ezsystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ezsystems/subscriptions","organizations_url":"https://api.github.com/users/ezsystems/orgs","repos_url":"https://api.github.com/users/ezsystems/repos","events_url":"https://api.github.com/users/ezsystems/events{/privacy}","received_events_url":"https://api.github.com/users/ezsystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle","description":"","fork":false,"url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle","forks_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/forks","keys_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/teams","hooks_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/hooks","issue_events_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/events{/number}","events_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/events","assignees_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/assignees{/user}","branches_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/branches{/branch}","tags_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/tags","blobs_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/languages","stargazers_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/stargazers","contributors_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/contributors","subscribers_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/subscribers","subscription_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/subscription","commits_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/contents/{+path}","compare_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/merges","archive_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/downloads","issues_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues{/number}","pulls_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/labels{/name}","releases_url":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/releases{/id}","created_at":"2015-04-01T14:25:12Z","updated_at":"2015-04-01T14:25:12Z","pushed_at":"2015-04-01T14:43:02Z","git_url":"git://github.com/ezsystems/EzSystemsPrivacyCookieBundle.git","ssh_url":"git@github.com:ezsystems/EzSystemsPrivacyCookieBundle.git","clone_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle.git","svn_url":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1"},"html":{"href":"https://github.com/ezsystems/EzSystemsPrivacyCookieBundle/pull/1"},"issue":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/1"},"comments":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ezsystems/EzSystemsPrivacyCookieBundle/statuses/6484451d2f7f1f9c5e75877430b24046bfe7cf85"}}}}