aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2015-09-12 18:58:08 -0400
committerGravatar Alexis Degrugillier <github@ainw.org> 2015-09-12 18:58:08 -0400
commit84824f8599ef8b7613c7c6829221aa8b88aa3846 (patch)
treec443f0297e8096605db88d036b24ba1d3639dcd6 /app/Models
parent7378b0c7237c8ba2b8bd313e584a20fc14b37477 (diff)
Add a visual alert on categories
When a category has one or more feeds with errors, a visual warning is displayed before the name of the category.
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Category.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Models/Category.php b/app/Models/Category.php
index 37cb44dc3..9a44a2d09 100644
--- a/app/Models/Category.php
+++ b/app/Models/Category.php
@@ -6,6 +6,7 @@ class FreshRSS_Category extends Minz_Model {
private $nbFeed = -1;
private $nbNotRead = -1;
private $feeds = null;
+ private $hasFeedsWithError = false;
public function __construct($name = '', $feeds = null) {
$this->_name($name);
@@ -16,6 +17,7 @@ class FreshRSS_Category extends Minz_Model {
foreach ($feeds as $feed) {
$this->nbFeed++;
$this->nbNotRead += $feed->nbNotRead();
+ $this->hasFeedsWithError |= $feed->inError();
}
}
}
@@ -51,12 +53,17 @@ class FreshRSS_Category extends Minz_Model {
foreach ($this->feeds as $feed) {
$this->nbFeed++;
$this->nbNotRead += $feed->nbNotRead();
+ $this->hasFeedsWithError |= $feed->inError();
}
}
return $this->feeds;
}
+ public function hasFeedsWithError() {
+ return $this->hasFeedsWithError;
+ }
+
public function _id($value) {
$this->id = $value;
}