diff --git a/admin/controllers/dashboard.php b/admin/controllers/dashboard.php index dcde423c..63322461 100644 --- a/admin/controllers/dashboard.php +++ b/admin/controllers/dashboard.php @@ -22,7 +22,7 @@ $_newPages = $dbPages->regenerate(); $_draftPosts = array(); foreach($posts as $Post) { - if(!$Post->published()) { + if($Post->draft()) { array_push($_draftPosts, $Post); } } @@ -33,5 +33,4 @@ foreach($pages as $Page) if(!$Page->published()) { array_push($_draftPages, $Page); } -} - +} \ No newline at end of file diff --git a/kernel/post.class.php b/kernel/post.class.php index d9db0409..6a8d2aea 100644 --- a/kernel/post.class.php +++ b/kernel/post.class.php @@ -74,6 +74,12 @@ class Post extends fileContent return ( ($this->getField('status')==='published') && ($this->getField('date')>$currentDate) ); } + // Returns TRUE if the post is draft, FALSE otherwise. + public function draft() + { + return ($this->getField('status')=='draft'); + } + public function username() { return $this->getField('username');