summaryrefslogtreecommitdiff
path: root/app/Models/EntryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-04-12 11:51:44 -0400
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-04-12 11:51:44 -0400
commit3e665bcf9aefe40499b5d16e901d0c7427e367af (patch)
treefe1ab6cc6e192b80ac368dd962dac90dccb57738 /app/Models/EntryDAO.php
parent6a04683171ecee8fdc5e601b88a1e5c16f8210c4 (diff)
Delete favorite button
I extract drop-down menu actions to make them as button action in the page header. I removed the favorite button on the category list because it is a duplicate from the button action. Now button action act as filters and you can combine them. It is a test to see if we can keep it like that. There is still work to do to extract other actions from the drop-down list. I did not want to change everything if we don't keep it. See #376 and #277
Diffstat (limited to 'app/Models/EntryDAO.php')
-rw-r--r--app/Models/EntryDAO.php32
1 files changed, 18 insertions, 14 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 6d00967fc..2f5a9e1f6 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -415,9 +415,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$where .= 'f.priority > 0 ';
$joinFeed = true;
break;
- case 's':
- $where .= 'e1.is_favorite = 1 ';
- break;
case 'c':
$where .= 'f.category = ? ';
$values[] = intval($id);
@@ -433,21 +430,28 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
default:
throw new FreshRSS_EntriesGetter_Exception ('Bad type in Entry->listByType: [' . $type . ']!');
}
- switch ($state) {
- case 'all':
- break;
- case 'not_read':
+
+ if ($state & FreshRSS_Configuration::STATE_NOT_READ) {
+ if (!($state & FreshRSS_Configuration::STATE_READ)) {
$where .= 'AND e1.is_read = 0 ';
- break;
- case 'read':
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_READ) {
+ if (!($state & FreshRSS_Configuration::STATE_NOT_READ)) {
$where .= 'AND e1.is_read = 1 ';
- break;
- case 'favorite':
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_NOT_FAVORITE) {
+ if (!($state & FreshRSS_Configuration::STATE_FAVORITE)) {
+ $where .= 'AND e1.is_favorite = 0 ';
+ }
+ }
+ if ($state & FreshRSS_Configuration::STATE_FAVORITE) {
+ if (!($state & FreshRSS_Configuration::STATE_NOT_FAVORITE)) {
$where .= 'AND e1.is_favorite = 1 ';
- break;
- default:
- throw new FreshRSS_EntriesGetter_Exception ('Bad state in Entry->listByType: [' . $state . ']!');
+ }
}
+
switch ($order) {
case 'DESC':
case 'ASC':