{"action":"created","comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/140792408","pull_request_review_id":64914942,"id":140792408,"diff_hunk":"@@ -94,24 +94,76 @@ public static function association($articleid)\n \t/**\n \t * Show the feature/unfeature links\n \t *\n-\t * @param   integer  $value      The state value\n-\t * @param   integer  $i          Row number\n-\t * @param   boolean  $canChange  Is user allowed to change?\n+\t * @param   integer  $value          The state value\n+\t * @param   integer  $i              Row number\n+\t * @param   boolean  $canChange      Is user allowed to change?\n+\t * @param   string   $featured_up    An optional start featured date.\n+\t * @param   string   $featured_down  An optional finish featured date.\n \t *\n \t * @return  string       HTML code\n \t */\n-\tpublic static function featured($value = 0, $i, $canChange = true)\n+\tpublic static function featured($value = 0, $i, $canChange = true, $featured_up = null, $featured_down = null)\n \t{\n \t\tJHtml::_('bootstrap.tooltip');\n \n \t\t// Array of image, task, title, action\n \t\t$states = array(\n \t\t\t0 => array('unfeatured', 'articles.featured', 'COM_CONTENT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),\n-\t\t\t1 => array('featured', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'JGLOBAL_TOGGLE_FEATURED'),\n+\t\t\t1 => array('featured', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'JLIB_HTML_FEATURED_ITEM'),\n \t\t);\n \t\t$state = ArrayHelper::getValue($states, (int) $value, $states[1]);\n-\t\t$icon  = $state[0];\n \n+\t\t// Special state for dates\n+\t\tif (((int) $value == 1) && ($featured_up || $featured_down))\n+\t\t{\n+\t\t\t$nullDate = JFactory::getDbo()->getNullDate();\n+\t\t\t$nowDate = JFactory::getDate()->toUnix();\n+\t\n+\t\t\t$tz = JFactory::getUser()->getTimezone();\n+\t\n+\t\t\t$featured_up = ($featured_up != $nullDate) ? JFactory::getDate($featured_up, 'UTC')->setTimeZone($tz) : false;\n+\t\t\t$featured_down = ($featured_down != $nullDate) ? JFactory::getDate($featured_down, 'UTC')->setTimeZone($tz) : false;\n+\t\n+\t\t\t// Create tip text, only we have publish up or down settings\n+\t\t\t$tips = array();\n+\t\n+\t\t\t// Add tips and set icon\n+\t\t\tif ($featured_up > $nullDate)\n+\t\t\t{\n+\t\t\t\tif ($nowDate < $featured_up->toUnix())\n+\t\t\t\t{\n+\t\t\t\t\t$tips[] = JText::sprintf('JLIB_HTML_FEATURED_START', $featured_up->format(JDate::$format, true));\n+\t\t\t\t\t$state[0] = 'pending';\n+\t\t\t\t}\n+\t\t\t\telse\n+\t\t\t\t{\n+\t\t\t\t\t$tips[] = JText::sprintf('JLIB_HTML_FEATURED_STARTED', $featured_up->format(JDate::$format, true));\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\t\t\n+\t\t\tif ($featured_down > $nullDate)\n+\t\t\t{\n+\t\t\t\tif ($nowDate > $featured_down->toUnix())\n+\t\t\t\t{\n+\t\t\t\t\t$tips[] = JText::sprintf('JLIB_HTML_FEATURED_FINISHED', $featured_down->format(JDate::$format, true));\n+\t\t\t\t\t$state[0] = 'expired';\n+\t\t\t\t}\n+\t\t\t\telse\n+\t\t\t\t{\n+\t\t\t\t\t$tips[] = JText::sprintf('JLIB_HTML_FEATURED_FINISH', $featured_down->format(JDate::$format, true));\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\t\t\n+\t\t\t// Add tips to titles\n+\t\t\tif (!empty($tips))\n+\t\t\t{\n+\t\t\t\t$tip = implode('<br />', $tips);\n+\t\t\t\t$state[1] = JText::_($state[1]);\n+\t\t\t\t$state[2] = JText::_($state[2]) . '<br />' . $tip;\n+\t\t\t\t$state[3] = JText::_($state[3]) . '<br />' . $tip;\n+\t\t\t}\n+\t\t}\n+\t\t$icon = $state[0];","path":"administrator/components/com_content/helpers/html/contentadministrator.php","position":79,"original_position":79,"commit_id":"a0d6cf250de2d0133c2b25029e212460b7ee035a","original_commit_id":"a0d6cf250de2d0133c2b25029e212460b7ee035a","user":{"login":"Quy","id":368084,"avatar_url":"https://avatars2.githubusercontent.com/u/368084?v=4","gravatar_id":"","url":"https://api.github.com/users/Quy","html_url":"https://github.com/Quy","followers_url":"https://api.github.com/users/Quy/followers","following_url":"https://api.github.com/users/Quy/following{/other_user}","gists_url":"https://api.github.com/users/Quy/gists{/gist_id}","starred_url":"https://api.github.com/users/Quy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quy/subscriptions","organizations_url":"https://api.github.com/users/Quy/orgs","repos_url":"https://api.github.com/users/Quy/repos","events_url":"https://api.github.com/users/Quy/events{/privacy}","received_events_url":"https://api.github.com/users/Quy/received_events","type":"User","site_admin":false},"body":"Add blank line before and after this line.","created_at":"2017-09-25T14:29:31Z","updated_at":"2017-09-25T14:29:31Z","html_url":"https://github.com/joomla/joomla-cms/pull/18052#discussion_r140792408","pull_request_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/140792408"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/18052#discussion_r140792408"},"pull_request":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052"}}},"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052","id":142446191,"html_url":"https://github.com/joomla/joomla-cms/pull/18052","diff_url":"https://github.com/joomla/joomla-cms/pull/18052.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/18052.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/18052","number":18052,"state":"open","locked":false,"title":"[New Feature] Schedule featured articles #13596","user":{"login":"eshiol","id":12718836,"avatar_url":"https://avatars0.githubusercontent.com/u/12718836?v=4","gravatar_id":"","url":"https://api.github.com/users/eshiol","html_url":"https://github.com/eshiol","followers_url":"https://api.github.com/users/eshiol/followers","following_url":"https://api.github.com/users/eshiol/following{/other_user}","gists_url":"https://api.github.com/users/eshiol/gists{/gist_id}","starred_url":"https://api.github.com/users/eshiol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshiol/subscriptions","organizations_url":"https://api.github.com/users/eshiol/orgs","repos_url":"https://api.github.com/users/eshiol/repos","events_url":"https://api.github.com/users/eshiol/events{/privacy}","received_events_url":"https://api.github.com/users/eshiol/received_events","type":"User","site_admin":false},"body":"Pull Request for Issue #13596.\r\n\r\n### Summary of Changes\r\nAdded two fields in the article editor `featured_up` (Start Featured) and `featured_down` (End Featured)\r\n![image](https://user-images.githubusercontent.com/12718836/27852039-d6711708-615d-11e7-8e53-1b8494c12532.png)\r\nAn article is featured if `featured` is yes and (`featured_up` is null or is less than or is equal to now) and (`featured_down` is null or is greater than or is equal to now)\r\n\r\n### Testing Instructions\r\ncreate 5 articles:\r\n1) not featured\r\n2) featured, featured_up = null, featured_down = null\r\n3) featured, featured_up = tomorrow, featured_down = null\r\n4) featured, featured_up = null, featured_down = yesterday\r\n5) featured, featured_up = yesterday, featured_down = tomorrow\r\n\r\nCreate an `Articles » Featured Articles` menu item\r\nCreate a `News Flash` module and set the option `Featured Articles` to `Only show Featured Articles`.\r\n\r\n### Expected result\r\nOnly the articles 2 and 5 will be shown in the `Articles » Featured Articles` menu item and in the `News Flash` module.\r\n\r\n### Actual result\r\n\r\n### Documentation Changes Required\r\n","created_at":"2017-09-21T21:08:12Z","updated_at":"2017-09-25T14:29:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d46c50beaa71312f56710874dd875ec449bf35e5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/18052/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/a0d6cf250de2d0133c2b25029e212460b7ee035a","head":{"label":"eshiol:staging","ref":"staging","sha":"a0d6cf250de2d0133c2b25029e212460b7ee035a","user":{"login":"eshiol","id":12718836,"avatar_url":"https://avatars0.githubusercontent.com/u/12718836?v=4","gravatar_id":"","url":"https://api.github.com/users/eshiol","html_url":"https://github.com/eshiol","followers_url":"https://api.github.com/users/eshiol/followers","following_url":"https://api.github.com/users/eshiol/following{/other_user}","gists_url":"https://api.github.com/users/eshiol/gists{/gist_id}","starred_url":"https://api.github.com/users/eshiol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshiol/subscriptions","organizations_url":"https://api.github.com/users/eshiol/orgs","repos_url":"https://api.github.com/users/eshiol/repos","events_url":"https://api.github.com/users/eshiol/events{/privacy}","received_events_url":"https://api.github.com/users/eshiol/received_events","type":"User","site_admin":false},"repo":{"id":104391093,"name":"joomla-cms","full_name":"eshiol/joomla-cms","owner":{"login":"eshiol","id":12718836,"avatar_url":"https://avatars0.githubusercontent.com/u/12718836?v=4","gravatar_id":"","url":"https://api.github.com/users/eshiol","html_url":"https://github.com/eshiol","followers_url":"https://api.github.com/users/eshiol/followers","following_url":"https://api.github.com/users/eshiol/following{/other_user}","gists_url":"https://api.github.com/users/eshiol/gists{/gist_id}","starred_url":"https://api.github.com/users/eshiol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshiol/subscriptions","organizations_url":"https://api.github.com/users/eshiol/orgs","repos_url":"https://api.github.com/users/eshiol/repos","events_url":"https://api.github.com/users/eshiol/events{/privacy}","received_events_url":"https://api.github.com/users/eshiol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eshiol/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/eshiol/joomla-cms","forks_url":"https://api.github.com/repos/eshiol/joomla-cms/forks","keys_url":"https://api.github.com/repos/eshiol/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eshiol/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eshiol/joomla-cms/teams","hooks_url":"https://api.github.com/repos/eshiol/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/eshiol/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/eshiol/joomla-cms/events","assignees_url":"https://api.github.com/repos/eshiol/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/eshiol/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/eshiol/joomla-cms/tags","blobs_url":"https://api.github.com/repos/eshiol/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eshiol/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eshiol/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/eshiol/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eshiol/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/eshiol/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/eshiol/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/eshiol/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/eshiol/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/eshiol/joomla-cms/subscription","commits_url":"https://api.github.com/repos/eshiol/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/eshiol/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/eshiol/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/eshiol/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/eshiol/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/eshiol/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eshiol/joomla-cms/merges","archive_url":"https://api.github.com/repos/eshiol/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eshiol/joomla-cms/downloads","issues_url":"https://api.github.com/repos/eshiol/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/eshiol/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/eshiol/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/eshiol/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eshiol/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/eshiol/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/eshiol/joomla-cms/deployments","created_at":"2017-09-21T19:40:37Z","updated_at":"2017-09-21T19:40:58Z","pushed_at":"2017-09-25T13:59:20Z","git_url":"git://github.com/eshiol/joomla-cms.git","ssh_url":"git@github.com:eshiol/joomla-cms.git","clone_url":"https://github.com/eshiol/joomla-cms.git","svn_url":"https://github.com/eshiol/joomla-cms","homepage":"https://www.joomla.org","size":205519,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"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":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"b13c4e1764db706745da5a7ef6ddae09de892619","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2017-09-25T12:22:28Z","pushed_at":"2017-09-25T14:23:17Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":205715,"stargazers_count":2499,"watchers_count":2499,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2561,"mirror_url":null,"open_issues_count":834,"forks":2561,"open_issues":834,"watchers":2499,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/18052"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/18052"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/18052/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/18052/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/a0d6cf250de2d0133c2b25029e212460b7ee035a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Quy"}}