From 2decc82c3eaeaf205295667e836087f309156822 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 21 Jun 2019 08:42:06 +0200 Subject: Change category configuration (#2410) * Change category configuration Before, we had a drop-down list to interract on categories. It was not working the same way as feeds. Now, categories and feeds behave in a similar manner. At the moment, there is no change in features but it will allow to expand them. See #2369 * Minor whitespace --- app/Models/Category.php | 7 +++++++ app/Models/CategoryDAO.php | 1 + 2 files changed, 8 insertions(+) (limited to 'app/Models') diff --git a/app/Models/Category.php b/app/Models/Category.php index 240dbca73..fa711aa66 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -7,6 +7,7 @@ class FreshRSS_Category extends Minz_Model { private $nbNotRead = -1; private $feeds = null; private $hasFeedsWithError = false; + private $isDefault = false; public function __construct($name = '', $feeds = null) { $this->_name($name); @@ -28,6 +29,9 @@ class FreshRSS_Category extends Minz_Model { public function name() { return $this->name; } + public function isDefault() { + return $this->isDefault; + } public function nbFeed() { if ($this->nbFeed < 0) { $catDAO = FreshRSS_Factory::createCategoryDao(); @@ -70,6 +74,9 @@ class FreshRSS_Category extends Minz_Model { public function _name($value) { $this->name = trim($value); } + public function _isDefault($value) { + $this->isDefault = $value; + } public function _feeds($values) { if (!is_array($values)) { $values = array($values); diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index ba7eb765e..6535adae7 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -282,6 +282,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable $dao['name'] ); $cat->_id($dao['id']); + $cat->_isDefault(static::DEFAULTCATEGORYID === intval($dao['id'])); $list[$key] = $cat; } -- cgit v1.2.3