From 71617080e224b8d3a3397a27b78e1f509499431c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 18 Sep 2014 21:06:38 -0400 Subject: Refactor code for strict unread message display Before, when you choose the show unread message option and the hide categories and feeds options, the categories and feeds weren't hidden. Now it is working properly. Before, the unread filter icon was not selected with the previous way of using the constants. Now, the filter is highlighted when selected in strict mode. See #619 --- app/Models/Configuration.php | 2 +- app/Models/Entry.php | 3 +-- app/Models/EntryDAO.php | 5 ++--- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/views/configure/reading.phtml | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index f94d82402..ea1556cbb 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -147,7 +147,7 @@ class FreshRSS_Configuration { // left blank on purpose case FreshRSS_Entry::STATE_NOT_READ: // left blank on purpose - case FreshRSS_Entry::STATE_NOT_READ_STRICT: + case FreshRSS_Entry::STATE_STRICT + FreshRSS_Entry::STATE_NOT_READ: $this->data['default_view'] = $value; break; default: diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 5f1c8abc4..9d7dd5dc4 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -6,8 +6,7 @@ class FreshRSS_Entry extends Minz_Model { const STATE_NOT_READ = 2; const STATE_FAVORITE = 4; const STATE_NOT_FAVORITE = 8; - const STATE_READ_STRICT = 16; - const STATE_NOT_READ_STRICT = 32; + const STATE_STRICT = 16; private $id = 0; private $guid; diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index dee49212d..c1f87ee34 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -333,14 +333,13 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo { if ($state & FreshRSS_Entry::STATE_NOT_READ) { if (!($state & FreshRSS_Entry::STATE_READ)) { $where .= 'AND e1.is_read=0 '; + } elseif ($state & FreshRSS_Entry::STATE_STRICT) { + $where .= 'AND e1.is_read=0 '; } } elseif ($state & FreshRSS_Entry::STATE_READ) { $where .= 'AND e1.is_read=1 '; } - elseif ($state & FreshRSS_Entry::STATE_NOT_READ_STRICT) { - $where .= 'AND e1.is_read=0 '; - } if ($state & FreshRSS_Entry::STATE_FAVORITE) { if (!($state & FreshRSS_Entry::STATE_NOT_FAVORITE)) { $where .= 'AND e1.is_favorite=1 '; diff --git a/app/i18n/en.php b/app/i18n/en.php index 8598e61cb..c53adb409 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -281,7 +281,7 @@ return array ( 'auto_load_more' => 'Load next articles at the page bottom', 'display_articles_unfolded' => 'Show articles unfolded by default', 'display_categories_unfolded' => 'Show categories folded by default', - 'hide_read_feeds' => 'Hide categories & feeds with no unread article (only in “unread articles” display mode)', + 'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)', 'after_onread' => 'After “mark all as read”,', 'jump_next' => 'jump to next unread sibling (feed or category)', 'article_icons' => 'Article icons', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4af819cac..58dccd2d4 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -281,7 +281,7 @@ return array ( 'auto_load_more' => 'Charger les articles suivants en bas de page', 'display_articles_unfolded' => 'Afficher les articles dépliés par défaut', 'display_categories_unfolded' => 'Afficher les catégories pliées par défaut', - 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (uniquement en affichage “articles non lus”)', + 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (ne fonctionne pas avec la configuration “Afficher tous les articles”)', 'after_onread' => 'Après “marquer tout comme lu”,', 'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)', 'article_icons' => 'Icônes d’article', diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 3dd457a2b..86d816eb3 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -43,7 +43,7 @@ -- cgit v1.2.3 From 204b5a77fac46cb1244d08c64b8066a03722639c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 18 Sep 2014 21:34:53 -0400 Subject: Optimize screwdriver icons Remove all icons that are copies from the default and optimize SVG for the specific icons See #624 --- p/themes/Screwdriver/icons/add.svg | 5 -- p/themes/Screwdriver/icons/all.svg | 7 --- p/themes/Screwdriver/icons/apple-touch-icon.png | Bin 5648 -> 0 bytes p/themes/Screwdriver/icons/bookmark-add.svg | 6 -- p/themes/Screwdriver/icons/bookmark.svg | 65 ++------------------ p/themes/Screwdriver/icons/category-white.svg | 7 --- p/themes/Screwdriver/icons/category.svg | 7 --- p/themes/Screwdriver/icons/close.svg | 7 --- p/themes/Screwdriver/icons/configure.svg | 5 -- p/themes/Screwdriver/icons/down.svg | 5 -- p/themes/Screwdriver/icons/favicon-16-32-48-64.ico | Bin 32038 -> 0 bytes p/themes/Screwdriver/icons/favicon-256.png | Bin 17174 -> 0 bytes p/themes/Screwdriver/icons/favicon.svg | 13 ---- p/themes/Screwdriver/icons/grey.gif | Bin 56 -> 0 bytes p/themes/Screwdriver/icons/help.svg | 7 --- p/themes/Screwdriver/icons/icon.svg | 12 ---- p/themes/Screwdriver/icons/key.svg | 7 --- p/themes/Screwdriver/icons/link.svg | 7 --- p/themes/Screwdriver/icons/login.svg | 6 -- p/themes/Screwdriver/icons/logout.svg | 6 -- p/themes/Screwdriver/icons/next.svg | 5 -- p/themes/Screwdriver/icons/non-starred.svg | 5 -- p/themes/Screwdriver/icons/prev.svg | 5 -- p/themes/Screwdriver/icons/read.svg | 60 +----------------- p/themes/Screwdriver/icons/refresh.svg | 5 -- p/themes/Screwdriver/icons/rss.svg | 6 -- p/themes/Screwdriver/icons/search.svg | 6 -- p/themes/Screwdriver/icons/share.svg | 8 --- p/themes/Screwdriver/icons/starred.svg | 65 ++------------------ p/themes/Screwdriver/icons/tag.svg | 5 -- p/themes/Screwdriver/icons/unread.svg | 68 +-------------------- p/themes/Screwdriver/icons/up.svg | 5 -- p/themes/Screwdriver/icons/view-global.svg | 1 - p/themes/Screwdriver/icons/view-normal.svg | 1 - p/themes/Screwdriver/icons/view-reader.svg | 1 - 35 files changed, 16 insertions(+), 402 deletions(-) delete mode 100644 p/themes/Screwdriver/icons/add.svg delete mode 100644 p/themes/Screwdriver/icons/all.svg delete mode 100644 p/themes/Screwdriver/icons/apple-touch-icon.png delete mode 100644 p/themes/Screwdriver/icons/bookmark-add.svg delete mode 100644 p/themes/Screwdriver/icons/category-white.svg delete mode 100644 p/themes/Screwdriver/icons/category.svg delete mode 100644 p/themes/Screwdriver/icons/close.svg delete mode 100644 p/themes/Screwdriver/icons/configure.svg delete mode 100644 p/themes/Screwdriver/icons/down.svg delete mode 100644 p/themes/Screwdriver/icons/favicon-16-32-48-64.ico delete mode 100644 p/themes/Screwdriver/icons/favicon-256.png delete mode 100644 p/themes/Screwdriver/icons/favicon.svg delete mode 100644 p/themes/Screwdriver/icons/grey.gif delete mode 100644 p/themes/Screwdriver/icons/help.svg delete mode 100644 p/themes/Screwdriver/icons/icon.svg delete mode 100644 p/themes/Screwdriver/icons/key.svg delete mode 100644 p/themes/Screwdriver/icons/link.svg delete mode 100644 p/themes/Screwdriver/icons/login.svg delete mode 100644 p/themes/Screwdriver/icons/logout.svg delete mode 100644 p/themes/Screwdriver/icons/next.svg delete mode 100644 p/themes/Screwdriver/icons/non-starred.svg delete mode 100644 p/themes/Screwdriver/icons/prev.svg delete mode 100644 p/themes/Screwdriver/icons/refresh.svg delete mode 100644 p/themes/Screwdriver/icons/rss.svg delete mode 100644 p/themes/Screwdriver/icons/search.svg delete mode 100644 p/themes/Screwdriver/icons/share.svg delete mode 100644 p/themes/Screwdriver/icons/tag.svg delete mode 100644 p/themes/Screwdriver/icons/up.svg delete mode 100644 p/themes/Screwdriver/icons/view-global.svg delete mode 100644 p/themes/Screwdriver/icons/view-normal.svg delete mode 100644 p/themes/Screwdriver/icons/view-reader.svg diff --git a/p/themes/Screwdriver/icons/add.svg b/p/themes/Screwdriver/icons/add.svg deleted file mode 100644 index 652491775..000000000 --- a/p/themes/Screwdriver/icons/add.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/all.svg b/p/themes/Screwdriver/icons/all.svg deleted file mode 100644 index aeaa96277..000000000 --- a/p/themes/Screwdriver/icons/all.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/apple-touch-icon.png b/p/themes/Screwdriver/icons/apple-touch-icon.png deleted file mode 100644 index 0bbab07ea..000000000 Binary files a/p/themes/Screwdriver/icons/apple-touch-icon.png and /dev/null differ diff --git a/p/themes/Screwdriver/icons/bookmark-add.svg b/p/themes/Screwdriver/icons/bookmark-add.svg deleted file mode 100644 index 51db9c498..000000000 --- a/p/themes/Screwdriver/icons/bookmark-add.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/bookmark.svg b/p/themes/Screwdriver/icons/bookmark.svg index 4041c6503..edf5a02db 100644 --- a/p/themes/Screwdriver/icons/bookmark.svg +++ b/p/themes/Screwdriver/icons/bookmark.svg @@ -1,60 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/category-white.svg b/p/themes/Screwdriver/icons/category-white.svg deleted file mode 100644 index 5bb5cecd9..000000000 --- a/p/themes/Screwdriver/icons/category-white.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/category.svg b/p/themes/Screwdriver/icons/category.svg deleted file mode 100644 index b5470d84a..000000000 --- a/p/themes/Screwdriver/icons/category.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/close.svg b/p/themes/Screwdriver/icons/close.svg deleted file mode 100644 index 20d1577ab..000000000 --- a/p/themes/Screwdriver/icons/close.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/configure.svg b/p/themes/Screwdriver/icons/configure.svg deleted file mode 100644 index 2957a7abe..000000000 --- a/p/themes/Screwdriver/icons/configure.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/down.svg b/p/themes/Screwdriver/icons/down.svg deleted file mode 100644 index 8a234ee99..000000000 --- a/p/themes/Screwdriver/icons/down.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico b/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico deleted file mode 100644 index 90f7d5118..000000000 Binary files a/p/themes/Screwdriver/icons/favicon-16-32-48-64.ico and /dev/null differ diff --git a/p/themes/Screwdriver/icons/favicon-256.png b/p/themes/Screwdriver/icons/favicon-256.png deleted file mode 100644 index 8b1021e1a..000000000 Binary files a/p/themes/Screwdriver/icons/favicon-256.png and /dev/null differ diff --git a/p/themes/Screwdriver/icons/favicon.svg b/p/themes/Screwdriver/icons/favicon.svg deleted file mode 100644 index a252050b9..000000000 --- a/p/themes/Screwdriver/icons/favicon.svg +++ /dev/null @@ -1,13 +0,0 @@ - - Logo FreshRSS - - - - - - - - - - - diff --git a/p/themes/Screwdriver/icons/grey.gif b/p/themes/Screwdriver/icons/grey.gif deleted file mode 100644 index c7212bc1f..000000000 Binary files a/p/themes/Screwdriver/icons/grey.gif and /dev/null differ diff --git a/p/themes/Screwdriver/icons/help.svg b/p/themes/Screwdriver/icons/help.svg deleted file mode 100644 index 9a0022f76..000000000 --- a/p/themes/Screwdriver/icons/help.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/icon.svg b/p/themes/Screwdriver/icons/icon.svg deleted file mode 100644 index caa987dac..000000000 --- a/p/themes/Screwdriver/icons/icon.svg +++ /dev/null @@ -1,12 +0,0 @@ - - Logo FreshRSS - - - - - - - - - - diff --git a/p/themes/Screwdriver/icons/key.svg b/p/themes/Screwdriver/icons/key.svg deleted file mode 100644 index 9193f4552..000000000 --- a/p/themes/Screwdriver/icons/key.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/p/themes/Screwdriver/icons/link.svg b/p/themes/Screwdriver/icons/link.svg deleted file mode 100644 index e5290af76..000000000 --- a/p/themes/Screwdriver/icons/link.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/login.svg b/p/themes/Screwdriver/icons/login.svg deleted file mode 100644 index 954a0b74b..000000000 --- a/p/themes/Screwdriver/icons/login.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/logout.svg b/p/themes/Screwdriver/icons/logout.svg deleted file mode 100644 index 8dd4ef08b..000000000 --- a/p/themes/Screwdriver/icons/logout.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/next.svg b/p/themes/Screwdriver/icons/next.svg deleted file mode 100644 index d504d096c..000000000 --- a/p/themes/Screwdriver/icons/next.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/non-starred.svg b/p/themes/Screwdriver/icons/non-starred.svg deleted file mode 100644 index 4ebcfccbd..000000000 --- a/p/themes/Screwdriver/icons/non-starred.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/prev.svg b/p/themes/Screwdriver/icons/prev.svg deleted file mode 100644 index ea4372098..000000000 --- a/p/themes/Screwdriver/icons/prev.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/read.svg b/p/themes/Screwdriver/icons/read.svg index ab6fe6422..5e454e36b 100644 --- a/p/themes/Screwdriver/icons/read.svg +++ b/p/themes/Screwdriver/icons/read.svg @@ -1,57 +1,3 @@ - - - - - - image/svg+xml - - - - - - - - - + + + \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/refresh.svg b/p/themes/Screwdriver/icons/refresh.svg deleted file mode 100644 index 62fe56c1e..000000000 --- a/p/themes/Screwdriver/icons/refresh.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/rss.svg b/p/themes/Screwdriver/icons/rss.svg deleted file mode 100644 index 2a8713be3..000000000 --- a/p/themes/Screwdriver/icons/rss.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/search.svg b/p/themes/Screwdriver/icons/search.svg deleted file mode 100644 index 35a28dfca..000000000 --- a/p/themes/Screwdriver/icons/search.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/share.svg b/p/themes/Screwdriver/icons/share.svg deleted file mode 100644 index db7a3649c..000000000 --- a/p/themes/Screwdriver/icons/share.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/starred.svg b/p/themes/Screwdriver/icons/starred.svg index 4b4a8f7ed..cd06525fd 100644 --- a/p/themes/Screwdriver/icons/starred.svg +++ b/p/themes/Screwdriver/icons/starred.svg @@ -1,60 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/tag.svg b/p/themes/Screwdriver/icons/tag.svg deleted file mode 100644 index 0d6db6ed8..000000000 --- a/p/themes/Screwdriver/icons/tag.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/unread.svg b/p/themes/Screwdriver/icons/unread.svg index 596dec0ac..a27acf2b6 100644 --- a/p/themes/Screwdriver/icons/unread.svg +++ b/p/themes/Screwdriver/icons/unread.svg @@ -1,65 +1,3 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/up.svg b/p/themes/Screwdriver/icons/up.svg deleted file mode 100644 index 4819c9205..000000000 --- a/p/themes/Screwdriver/icons/up.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/view-global.svg b/p/themes/Screwdriver/icons/view-global.svg deleted file mode 100644 index d81e79790..000000000 --- a/p/themes/Screwdriver/icons/view-global.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/view-normal.svg b/p/themes/Screwdriver/icons/view-normal.svg deleted file mode 100644 index c35b101df..000000000 --- a/p/themes/Screwdriver/icons/view-normal.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/p/themes/Screwdriver/icons/view-reader.svg b/p/themes/Screwdriver/icons/view-reader.svg deleted file mode 100644 index 3243aed6e..000000000 --- a/p/themes/Screwdriver/icons/view-reader.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file -- cgit v1.2.3 From 8731de5c3ad4eea8ae30d1f6435c569ed31b8828 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 10:37:29 +0200 Subject: Fix repartition stats with 0 or 1 article. --- app/Models/StatsDAO.php | 8 +++++++- app/Models/StatsDAOSQLite.php | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Models/StatsDAO.php b/app/Models/StatsDAO.php index bd4271ba8..b8dc40592 100644 --- a/app/Models/StatsDAO.php +++ b/app/Models/StatsDAO.php @@ -209,8 +209,14 @@ SQL; $date_max = new \DateTime(); $date_max->setTimestamp($res['date_max']); $interval = $date_max->diff($date_min, true); + $interval_in_days = $interval->format('%a'); + if ($interval_in_days <= 0) { + // Surely only one article. + // We will return count / (period/period) == count. + $interval_in_days = $period; + } - return round($res['count'] / ($interval->format('%a') / ($period)), 2); + return round($res['count'] / ($interval_in_days / $period), 2); } /** diff --git a/app/Models/StatsDAOSQLite.php b/app/Models/StatsDAOSQLite.php index 6cb54ddf6..3b1256de1 100644 --- a/app/Models/StatsDAOSQLite.php +++ b/app/Models/StatsDAOSQLite.php @@ -53,6 +53,7 @@ SQL; $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_NAMED); + $repartition = array(); foreach ($res as $value) { $repartition[(int) $value['period']] = (int) $value['count']; } -- cgit v1.2.3 From ba378791c2f36251a22e8a98351ab9b23a640c17 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 13:52:50 +0200 Subject: Fix blank page for invalid user queries Add a "deprecated" information See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/Controllers/configureController.php | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index b1cd45014..f72683e34 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -328,6 +328,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Request::forward(array('c' => 'configure', 'a' => 'queries'), true); } else { $this->view->query_get = array(); + $cat_dao = new FreshRSS_CategoryDAO(); + $feed_dao = FreshRSS_Factory::createFeedDao(); foreach ($this->view->conf->queries as $key => $query) { if (!isset($query['get'])) { continue; @@ -335,31 +337,49 @@ class FreshRSS_configure_Controller extends Minz_ActionController { switch ($query['get'][0]) { case 'c': - $dao = new FreshRSS_CategoryDAO(); - $category = $dao->searchById(substr($query['get'], 2)); + $category = $cat_dao->searchById(substr($query['get'], 2)); + + $deprecated = true; + $cat_name = ''; + if ($category) { + $cat_name = $category->name(); + $deprecated = false; + } + $this->view->query_get[$key] = array( 'type' => 'category', - 'name' => $category->name(), + 'name' => $cat_name, + 'deprecated' => $deprecated, ); break; case 'f': - $dao = FreshRSS_Factory::createFeedDao(); - $feed = $dao->searchById(substr($query['get'], 2)); + $feed = $feed_dao->searchById(substr($query['get'], 2)); + + $deprecated = true; + $feed_name = ''; + if ($feed) { + $feed_name = $feed->name(); + $deprecated = false; + } + $this->view->query_get[$key] = array( 'type' => 'feed', - 'name' => $feed->name(), + 'name' => $feed_name, + 'deprecated' => $deprecated, ); break; case 's': $this->view->query_get[$key] = array( 'type' => 'favorite', 'name' => 'favorite', + 'deprecated' => false, ); break; case 'a': $this->view->query_get[$key] = array( 'type' => 'all', 'name' => 'all', + 'deprecated' => false, ); break; } -- cgit v1.2.3 From 08cc7c4cd4f652da551964a7f5ac584ec18884ab Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 14:35:02 +0200 Subject: Add an error message when a query is deprecated. See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/configure/queries.phtml | 15 +++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/i18n/en.php b/app/i18n/en.php index c53adb409..e2bd21623 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -46,6 +46,7 @@ return array ( 'no_query' => 'You haven’t created any user query yet.', 'query_filter' => 'Filter applied:', 'no_query_filter' => 'No filter', + 'query_deprecated' => 'This query is no longer valid. The concerned category or feed has been deleted.', 'about' => 'About', 'stats' => 'Statistics', 'stats_idle' => 'Idle feeds', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 58dccd2d4..e06bba487 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -46,6 +46,7 @@ return array ( 'no_query' => 'Vous n’avez pas encore créé de filtre.', 'query_filter' => 'Filtres appliqués :', 'no_query_filter' => 'Aucun filtre appliqué', + 'query_deprecated' => 'Ce filtre n’est plus valide. La catégorie ou le flux concerné a été supprimé.', 'about' => 'À propos', 'stats' => 'Statistiques', 'stats_idle' => 'Flux inactifs', diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml index 2895f584c..e778ce078 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -42,30 +42,37 @@ + (isset($query['get']) ? 1 : 0); // If the only filter is "all" articles, we consider there is no filter $exist = ($exist === 1 && isset($query['get']) && $query['get'] === 'a') ? 0 : $exist; + + $deprecated = (isset($this->query_get[$key]) && + $this->query_get[$key]['deprecated']); ?>
+ +
+
+
    - +
  • - +
  • - +
  • - +
  • query_get[$key]['type'], $this->query_get[$key]['name']); ?>
-- cgit v1.2.3 From ae4ecd8e099b23d38e761dec6de68da801816734 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 15:44:33 +0200 Subject: Coding style (user queries) --- app/Controllers/configureController.php | 17 ++++++----------- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/layout/nav_menu.phtml | 5 ++++- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index f72683e34..91b74aa29 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -313,19 +313,14 @@ class FreshRSS_configure_Controller extends Minz_ActionController { foreach ($queries as $key => $query) { if (!$query['name']) { - $query['name'] = Minz_Translate::t('query_number', $key + 1); + $query['name'] = _t('query_number', $key + 1); } } $this->view->conf->_queries($queries); $this->view->conf->save(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'queries'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'queries')); } else { $this->view->query_get = array(); $cat_dao = new FreshRSS_CategoryDAO(); @@ -392,14 +387,14 @@ class FreshRSS_configure_Controller extends Minz_ActionController { public function addQueryAction() { $queries = $this->view->conf->queries; $query = Minz_Request::params(); - $query['name'] = Minz_Translate::t('query_number', count($queries) + 1); + $query['name'] = _t('query_number', count($queries) + 1); unset($query['output']); unset($query['token']); $queries[] = $query; $this->view->conf->_queries($queries); $this->view->conf->save(); - // Minz_Request::forward(array('params' => $query), true); - Minz_Request::forward(array('c' => 'configure', 'a' => 'queries'), true); + Minz_Request::good(_t('query_created', $query['name']), + array('c' => 'configure', 'a' => 'queries')); } } diff --git a/app/i18n/en.php b/app/i18n/en.php index e2bd21623..e84787508 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -43,6 +43,7 @@ return array ( 'query_state_15' => 'Display all articles', 'query_number' => 'Query n°%d', 'add_query' => 'Add a query', + 'query_created' => 'Query "%s" has been created.', 'no_query' => 'You haven’t created any user query yet.', 'query_filter' => 'Filter applied:', 'no_query_filter' => 'No filter', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index e06bba487..fab5c3470 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -43,6 +43,7 @@ return array ( 'query_state_15' => 'Afficher tous les articles', 'query_number' => 'Filtre n°%d', 'add_query' => 'Créer un filtre', + 'query_created' => 'Le filtre "%s" a bien été créé.', 'no_query' => 'Vous n’avez pas encore créé de filtre.', 'query_filter' => 'Filtres appliqués :', 'no_query_filter' => 'Aucun filtre appliqué', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 2a09b0c12..03f496d1f 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -93,7 +93,10 @@
+
+
+ + + +
+
@@ -80,17 +87,13 @@
- -
- - - -
-
-
-
- +
+ + + + +
diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml index 608e2d33c..14b83ae95 100644 --- a/app/views/stats/idle.phtml +++ b/app/views/stats/idle.phtml @@ -23,7 +23,9 @@
-
  • +
  • + () +
  • diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml index ead275696..b425c1458 100644 --- a/app/views/stats/repartition.phtml +++ b/app/views/stats/repartition.phtml @@ -24,8 +24,8 @@ feed) {?> - - + + diff --git a/p/themes/icons/stats.svg b/p/themes/icons/stats.svg new file mode 100644 index 000000000..408d9e67f --- /dev/null +++ b/p/themes/icons/stats.svg @@ -0,0 +1,31 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + + -- cgit v1.2.3 From c4c4ad867a6b9c5e2b03443a5530e871e34b63fe Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 16:53:05 +0200 Subject: Optimise stats.svg file --- p/themes/icons/stats.svg | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/p/themes/icons/stats.svg b/p/themes/icons/stats.svg index 408d9e67f..90a23215f 100644 --- a/p/themes/icons/stats.svg +++ b/p/themes/icons/stats.svg @@ -1,31 +1,6 @@ - - - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - Gnome Symbolic Icon Theme - - - - - - - - - - - - - + + + + + -- cgit v1.2.3 From 4620d0b136295d5fca2fcbdfc91db6cc3a500c5a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 17:16:38 +0200 Subject: Remove unnecessary empty class --- app/views/configure/feed.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index aa653e585..0959652c2 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -72,7 +72,7 @@
    -- cgit v1.2.3 From 522c68df60ab43c455227185b3e5cd6cd741aba9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 19 Sep 2014 18:24:37 +0200 Subject: Details i18n https://github.com/marienfressinaud/FreshRSS/issues/618 --- app/i18n/en.php | 8 ++++---- app/i18n/fr.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/i18n/en.php b/app/i18n/en.php index b9588c8b8..157cbd3ba 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -5,7 +5,7 @@ return array ( 'login' => 'Login', 'keep_logged_in' => 'Keep me logged in (1 month)', 'login_with_persona' => 'Login with Persona', - 'login_persona_problem' => 'Problem of connection with Persona?', + 'login_persona_problem' => 'Connection problem with Persona?', 'logout' => 'Logout', 'search' => 'Search words or #tags', 'search_short' => 'Search', @@ -47,7 +47,7 @@ return array ( 'no_query' => 'You haven’t created any user query yet.', 'query_filter' => 'Filter applied:', 'no_query_filter' => 'No filter', - 'query_deprecated' => 'This query is no longer valid. The concerned category or feed has been deleted.', + 'query_deprecated' => 'This query is no longer valid. The referenced category or feed has been deleted.', 'about' => 'About', 'stats' => 'Statistics', 'stats_idle' => 'Idle feeds', @@ -444,8 +444,8 @@ return array ( 'update_finished' => 'Update completed!', 'auth_reset' => 'Authentication reset', - 'auth_will_reset' => 'Authentication system will be reseted: form will be used instead of Persona.', - 'auth_not_persona' => 'Only Persona system can be reseted.', + 'auth_will_reset' => 'Authentication system will be reset: a form will be used instead of Persona.', + 'auth_not_persona' => 'Only Persona system can be reset.', 'auth_no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', 'auth_form_set' => 'Form is now your default authentication system.', 'auth_form_not_set' => 'A problem occured during authentication system configuration. Please retry later.', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4cc9c8598..e1cf9896a 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -289,7 +289,7 @@ return array ( 'article_icons' => 'Icônes d’article', 'top_line' => 'Ligne du haut', 'bottom_line' => 'Ligne du bas', - 'html5_notif_timeout' => 'Temps d\'affichage de la notification HTML5', + 'html5_notif_timeout' => 'Temps d’affichage de la notification HTML5', 'seconds_(0_means_no_timeout)' => 'secondes (0 signifie aucun timeout ) ', 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', 'sticky_post' => 'Aligner l’article en haut quand il est ouvert', @@ -443,9 +443,9 @@ return array ( 'update_problem' => 'La mise à jour a rencontré un problème : %s', 'update_finished' => 'La mise à jour est terminée !', - 'auth_reset' => 'Reset de l’authentification', - 'auth_will_reset' => 'Le système d’authentification va être remis à zéro : le formulaire sera utilisé à la place de Persona.', - 'auth_not_persona' => 'Seul le système d’authentification Persona peut être remis à zéro.', + 'auth_reset' => 'Réinitialisation de l’authentification', + 'auth_will_reset' => 'Le système d’authentification va être réinitialisé : un formulaire sera utilisé à la place de Persona.', + 'auth_not_persona' => 'Seul le système d’authentification Persona peut être réinitialisé.', 'auth_no_password_set' => 'Aucun mot de passe administrateur n’a été précisé. Cette fonctionnalité n’est pas disponible.', 'auth_form_set' => 'Le formulaire est désormais votre système d’authentification.', 'auth_form_not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', -- cgit v1.2.3 From 64b3d140f64d8fcaba30a514e0f956929f9bb126 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 18:33:11 +0200 Subject: Improve "no feed to display" box --- app/i18n/de.php | 2 +- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/views/helpers/view/global_view.phtml | 8 ++++++++ app/views/helpers/view/normal_view.phtml | 6 +++--- app/views/helpers/view/reader_view.phtml | 6 +++--- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/i18n/de.php b/app/i18n/de.php index 6caa3cd84..6f485214b 100644 --- a/app/i18n/de.php +++ b/app/i18n/de.php @@ -169,7 +169,7 @@ return array ( 'not_yet_implemented' => 'Noch nicht implementiert', 'access_protected_feeds' => 'Die Verbindung erlaubt Zugriff zu HTTP-geschützten RSS Feeds', 'no_selected_feed' => 'Kein Feed ausgewählt.', - 'think_to_add' => 'Sie können Feeds hinzufügen.', + 'think_to_add' => 'Sie können Feeds hinzufügen.', 'current_user' => 'Aktuelle Nutzung', 'default_user' => 'Nutzername des Standardnutzers (maximal 16 Zeichen - alphanumerisch)', diff --git a/app/i18n/en.php b/app/i18n/en.php index b9588c8b8..8a24d010b 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -237,7 +237,7 @@ return array ( 'not_yet_implemented' => 'Not yet implemented', 'access_protected_feeds' => 'Connection allows to access HTTP protected RSS feeds', 'no_selected_feed' => 'No feed selected.', - 'think_to_add' => 'You may add some feeds.', + 'think_to_add' => 'You may add some feeds.', 'current_user' => 'Current user', 'default_user' => 'Username of the default user (maximum 16 alphanumeric characters)', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4cc9c8598..f1e531f96 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -237,7 +237,7 @@ return array ( 'not_yet_implemented' => 'Pas encore implémenté', 'access_protected_feeds' => 'La connexion permet d’accéder aux flux protégés par une authentification HTTP.', 'no_selected_feed' => 'Aucun flux sélectionné.', - 'think_to_add' => 'Vous pouvez ajouter des flux.', + 'think_to_add' => 'Vous pouvez ajouter des flux.', 'current_user' => 'Utilisateur actuel', 'password_form' => 'Mot de passe
    (pour connexion par formulaire)', diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index db937eeae..48aa5d46f 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -1,5 +1,6 @@ partial ('nav_menu'); ?> +entries)) { ?>
    'index', 'a' => 'index', 'params' => array()); @@ -43,3 +44,10 @@
    conf->display_posts ? '' : ' class="hide_posts"'; ?>>
    + + +
    +

    +

    +
    + diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 87bf2e22a..6659a9a6b 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -183,8 +183,8 @@ if (!empty($this->entries)) { partial ('nav_entries'); ?> -
    - - +
    +

    +

    diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 665f72849..832b27be4 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -37,8 +37,8 @@ if (!empty($this->entries)) {
    -
    - - +
    +

    +

    -- cgit v1.2.3 From 635ea04d52b3078e6a76c64072cf86d60b6c1561 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 18:38:00 +0200 Subject: Move loading of crypto form See https://github.com/marienfressinaud/FreshRSS/commit/f727a1383639d5bdc762f73dfe93b9a5d577cb41#commitcomment-7853832 --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p/scripts/main.js b/p/scripts/main.js index b2ca90c5b..2503116ee 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1250,7 +1250,6 @@ function init_all() { break; } init_confirm_action(); - init_crypto_form(); $stream = $('#stream'); if ($stream.length > 0) { init_actualize(); @@ -1265,6 +1264,7 @@ function init_all() { init_notifs_html5(); window.setInterval(refreshUnreads, 120000); } else { + init_crypto_form(); init_share_observers(); init_remove_observers(); init_feed_observers(); -- cgit v1.2.3 From 07d123f1aa09afc79c322b2364132981f5285ac1 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 18:47:49 +0200 Subject: Load $nb/2 articles when reading view Fix https://github.com/marienfressinaud/FreshRSS/commit/7d5e57b35b4eca07417c296c156edb3b88eef90b See https://github.com/marienfressinaud/FreshRSS/issues/559 --- app/Controllers/indexController.php | 2 +- app/i18n/en.php | 2 +- app/i18n/fr.php | 2 +- app/views/configure/reading.phtml | 4 +--- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index b69c09127..bc03f1916 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -84,7 +84,7 @@ class FreshRSS_index_Controller extends Minz_ActionController { $first = Minz_Request::param ('next', ''); $ajax_request = Minz_Request::param('ajax', false); - if ($ajax_request == 1 && $this->view->conf->display_posts) { + if ($output === 'reader') { $nb = max(1, round($nb / 2)); } diff --git a/app/i18n/en.php b/app/i18n/en.php index 82c853255..4c6ce6eab 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -276,7 +276,7 @@ return array ( 'reading_configuration' => 'Reading', 'display_configuration' => 'Display', 'articles_per_page' => 'Number of articles per page', - 'number_divided_when_unfolded' => 'Divided by 2 during loading of unfolded articles.', + 'number_divided_when_reader' => 'Divided by 2 in the reading view.', 'default_view' => 'Default view', 'articles_to_display' => 'Articles to display', 'sort_order' => 'Sort order', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index b5ab32dae..889bdd173 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -276,7 +276,7 @@ return array ( 'reading_configuration' => 'Lecture', 'display_configuration' => 'Affichage', 'articles_per_page' => 'Nombre d’articles par page', - 'number_divided_when_unfolded' => 'Divisé par 2 lors du chargement d’articles dépliés.', + 'number_divided_when_reader' => 'Divisé par 2 dans la vue de lecture.', 'default_view' => 'Vue par défaut', 'articles_to_display' => 'Articles à afficher', 'sort_order' => 'Ordre de tri', diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtml index 86d816eb3..8b2da2a28 100644 --- a/app/views/configure/reading.phtml +++ b/app/views/configure/reading.phtml @@ -10,9 +10,7 @@
    - conf->display_posts) { ?> - - +
    -- cgit v1.2.3 From 921dd88e646621a0118c97716cae6b34a0ed26b1 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 19:00:00 +0200 Subject: Add a message if there is no idle feed (stats) --- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/stats/idle.phtml | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/app/i18n/en.php b/app/i18n/en.php index 4c6ce6eab..f95a97d11 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -431,6 +431,7 @@ return array ( 'stats_entry_per_category' => 'Entries per category', 'stats_top_feed' => 'Top ten feeds', 'stats_entry_count' => 'Entry count', + 'stats_no_idle' => 'There is no idle feed!', 'update' => 'Update', 'update_system' => 'Update system', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 889bdd173..c541a79e9 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -431,6 +431,7 @@ return array ( 'stats_entry_per_category' => 'Articles par catégorie', 'stats_top_feed' => 'Les dix plus gros flux', 'stats_entry_count' => 'Nombre d’articles', + 'stats_no_idle' => 'Il n’a aucun flux inactif !', 'update' => 'Mise à jour', 'update_system' => 'Système de mise à jour', diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml index 14b83ae95..3ce8d3d3e 100644 --- a/app/views/stats/idle.phtml +++ b/app/views/stats/idle.phtml @@ -6,8 +6,10 @@

    idleFeeds as $period => $feeds) { if (!empty($feeds)) { + $nothing = false; ?>

    @@ -32,5 +34,11 @@ +

    + +

    +
    -- cgit v1.2.3 From d284958d52f633738e8cc736f7f4a50e0c984ecf Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 19:44:40 +0200 Subject: Improve redirection when deleting an idle feed --- app/Controllers/feedController.php | 9 ++++++--- app/views/stats/idle.phtml | 6 +++++- lib/Minz/Request.php | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 3326b2059..65d4b3a37 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -412,10 +412,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { Minz_Session::_param ('notification', $notif); - if ($type == 'category') { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'categorize'), true); + $redirect_url = Minz_Request::param('r', false, true); + if ($redirect_url) { + Minz_Request::forward($redirect_url); + } elseif ($type == 'category') { + Minz_Request::forward(array ('c' => 'configure', 'a' => 'categorize'), true); } else { - Minz_Request::forward (array ('c' => 'configure', 'a' => 'feed'), true); + Minz_Request::forward(array ('c' => 'configure', 'a' => 'feed'), true); } } } diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtml index 3ce8d3d3e..6f3d4a117 100644 --- a/app/views/stats/idle.phtml +++ b/app/views/stats/idle.phtml @@ -6,6 +6,10 @@

    'stats', 'a' => 'idle'), + 'php', true + )); $nothing = true; foreach ($this->idleFeeds as $period => $feeds) { if (!empty($feeds)) { @@ -22,7 +26,7 @@
    - +
  • diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 52f53012f..f7a24c026 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -124,6 +124,11 @@ class Minz_Request { * > sinon, le dispatcher recharge en interne */ public static function forward($url = array(), $redirect = false) { + if (!is_array($url)) { + header('Location: ' . $url); + exit(); + } + $url = Minz_Url::checkUrl($url); if ($redirect) { -- cgit v1.2.3 From e134891733a5e7916edeff09bd8ce6ea0042f86a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 19:51:02 +0200 Subject: Fix bug of JavaScript loading Introduced by https://github.com/marienfressinaud/FreshRSS/commit/64b3d140f64d8fcaba30a514e0f956929f9bb126 --- app/views/helpers/view/global_view.phtml | 2 +- app/views/helpers/view/normal_view.phtml | 2 +- app/views/helpers/view/reader_view.phtml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/helpers/view/global_view.phtml b/app/views/helpers/view/global_view.phtml index 48aa5d46f..72bcf4c73 100644 --- a/app/views/helpers/view/global_view.phtml +++ b/app/views/helpers/view/global_view.phtml @@ -46,7 +46,7 @@
  • -
    +



    diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 6659a9a6b..1dbf14f4c 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -183,7 +183,7 @@ if (!empty($this->entries)) { partial ('nav_entries'); ?> -
    +



    diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index 832b27be4..c80dca519 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -37,7 +37,7 @@ if (!empty($this->entries)) {
    -
    +



    -- cgit v1.2.3 From f0dbe3c3ee8b0d4339d484aeb87cfc0dd4d444f7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 19:56:55 +0200 Subject: Details i18n --- app/i18n/fr.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/i18n/fr.php b/app/i18n/fr.php index c541a79e9..759207d90 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -57,11 +57,11 @@ return array ( 'stats_entry_per_day_of_week' => 'Par jour de la semaine', 'stats_entry_per_month' => 'Par mois', - 'last_week' => 'La dernière semaine', - 'last_month' => 'Le dernier mois', - 'last_3_month' => 'Les derniers trois mois', - 'last_6_month' => 'Les derniers six mois', - 'last_year' => 'La dernière année', + 'last_week' => 'Depuis la semaine dernière', + 'last_month' => 'Depuis le mois dernier', + 'last_3_month' => 'Depuis les trois derniers mois', + 'last_6_month' => 'Depuis les six derniers mois', + 'last_year' => 'Depuis l’année dernière', 'your_rss_feeds' => 'Vos flux RSS', 'add_rss_feed' => 'Ajouter un flux RSS', @@ -431,7 +431,7 @@ return array ( 'stats_entry_per_category' => 'Articles par catégorie', 'stats_top_feed' => 'Les dix plus gros flux', 'stats_entry_count' => 'Nombre d’articles', - 'stats_no_idle' => 'Il n’a aucun flux inactif !', + 'stats_no_idle' => 'Il n’y a aucun flux inactif !', 'update' => 'Mise à jour', 'update_system' => 'Système de mise à jour', -- cgit v1.2.3 From a14d325432b1d6515beaaccef73fa01f3ab3a85c Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 19 Sep 2014 20:30:54 +0200 Subject: Auto-redirect from formLogin if already logged in --- app/Controllers/indexController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index bc03f1916..e8e26b142 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -337,6 +337,10 @@ class FreshRSS_index_Controller extends Minz_ActionController { } public function formLoginAction () { + if ($this->view->loginOk) { + Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true); + } + if (Minz_Request::isPost()) { $ok = false; $nonce = Minz_Session::param('nonce'); -- cgit v1.2.3 From fc8e2d0e67830dfb618d05d08a3d8a88aee6df9b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 20 Sep 2014 12:51:03 +0200 Subject: Entities i18n A few bugs + conversion to Unicode --- app/i18n/de.php | 126 ++++++++++++++++++++++++++++---------------------------- app/i18n/en.php | 6 +-- app/i18n/fr.php | 2 +- 3 files changed, 67 insertions(+), 67 deletions(-) diff --git a/app/i18n/de.php b/app/i18n/de.php index 6f485214b..77fb805fb 100644 --- a/app/i18n/de.php +++ b/app/i18n/de.php @@ -15,16 +15,16 @@ return array ( 'feed' => 'Feed', 'feeds' => 'Feeds', 'shortcuts' => 'Shortcuts', - 'about' => 'Über', + 'about' => 'Über', 'stats' => 'Statistiken', 'your_rss_feeds' => 'Ihre RSS Feeds', - 'add_rss_feed' => 'RSS-Feed hinzufügen', + 'add_rss_feed' => 'RSS-Feed hinzufügen', 'no_rss_feed' => 'Kein RSS Feed', 'import_export_opml' => 'Import / Export (OPML)', 'subscription_management' => 'Abonnementsverwaltung', - 'main_stream' => 'Haupt-Nachrichtenfluß', + 'main_stream' => 'Haupt-Nachrichtenfluß', 'all_feeds' => 'Alle Feeds', 'favorite_feeds' => 'Favoriten (%d)', 'not_read' => '%d ungelesen', @@ -42,22 +42,22 @@ return array ( 'mark_cat_read' => 'Kategorie als gelesen markieren', 'before_one_day' => 'Vor einem Tag', 'before_one_week' => 'Vor einer Woche', - 'display' => 'Anzeige', + 'display' => 'Anzeige', 'normal_view' => 'Normale Anzeige', 'reader_view' => 'Leseanzeige-Modus', 'global_view' => 'Globale Anzeige', - 'rss_view' => 'RSS-Feed', + 'rss_view' => 'RSS-Feed', 'show_all_articles' => 'zeige alle Artikel', 'show_not_reads' => 'zeige nicht gelesene', - 'show_read' => 'zeige nur gelesene', + 'show_read' => 'zeige nur gelesene', 'show_favorite' => 'Favoriten anzeigen', - 'older_first' => 'Älteste zuerst', + 'older_first' => 'Älteste zuerst', 'newer_first' => 'Neuere zuerst', // Pagination 'first' => 'Erste', 'previous' => 'Vorherige', - 'next' => 'Nächste', + 'next' => 'Nächste', 'last' => 'Letzte', // CONTROLLERS @@ -67,7 +67,7 @@ return array ( 'access_denied' => 'Sie haben nicht die Berechtigung, diese Seite aufzurufen', 'page_not_found' => 'Sie suchen nach einer Seite, die es nicht gibt', 'error_occurred' => 'Es gab einen Fehler', - 'error_occurred_update' => 'Es wurde nichts geändert', + 'error_occurred_update' => 'Es wurde nichts geändert', 'default_category' => 'Unkategorisiert', 'categories_updated' => 'Kategorien wurden aktualisiert', @@ -75,67 +75,67 @@ return array ( 'feed_updated' => 'Der Feed wurde aktualisiert', 'rss_feed_management' => 'Verwaltung der RSS Feeds', 'configuration_updated' => 'Die Konfiguration wurde aktualisiert', - 'sharing_management' => 'Verwaltung der Optionen für das Teilen', - 'bad_opml_file' => 'Ihre OPML-Datei ist ungültig', + 'sharing_management' => 'Verwaltung der Optionen für das Teilen', + 'bad_opml_file' => 'Ihre OPML-Datei ist ungültig', 'shortcuts_updated' => 'Shortcuts wurden aktualisiert', 'shortcuts_management' => 'Verwaltung der Shortcuts', 'shortcuts_navigation' => 'Navigation', - 'shortcuts_navigation_help' => 'Mit der "Shift" Taste gelten die Navigations-Shortcuts für Feeds.
    Mit der "Alt" Taste gelten die Navigations-Shortcuts für Kategorien.', + 'shortcuts_navigation_help' => 'Mit der "Shift" Taste gelten die Navigations-Shortcuts für Feeds.
    Mit der "Alt" Taste gelten die Navigations-Shortcuts für Kategorien.', 'shortcuts_article_action' => 'Artikelaktionen', 'shortcuts_other_action' => 'Andere Aktionen', 'feeds_marked_read' => 'Die Feeds wurden als gelesen markiert', - 'updated' => 'Die Änderungen wurden aktualisiert', + 'updated' => 'Die Änderungen wurden aktualisiert', 'already_subscribed' => 'Sie haben bereits %s abonniert', - 'feed_added' => 'Der RSS Feed %s wurde hinzugefügt', - 'feed_not_added' => '%s konnte nicht hinzugefügt werden', - 'internal_problem_feed' => 'Der RSS Feed konnte nicht hinzugefügt werden. überprüfen Sie die Protokolldateien von FressRSS für weitere Informationen.', - 'invalid_url' => 'URL %s ist ungültig', + 'feed_added' => 'Der RSS Feed %s wurde hinzugefügt', + 'feed_not_added' => '%s konnte nicht hinzugefügt werden', + 'internal_problem_feed' => 'Der RSS Feed konnte nicht hinzugefügt werden. überprüfen Sie die Protokolldateien von FressRSS für weitere Informationen.', + 'invalid_url' => 'URL %s ist ungültig', 'feed_actualized' => '%s wurde aktualisiert', 'n_feeds_actualized' => '%d Feeds wurden aktualisiert', 'feeds_actualized' => 'RSS Feeds wurden aktualisiert', 'no_feed_actualized' => 'Es wurden keine RSS Feeds aktualisiert', - 'n_entries_deleted' => '%d Artikel wurden gelöscht', + 'n_entries_deleted' => '%d Artikel wurden gelöscht', 'feeds_imported_with_errors' => 'Ihre Feeds wurden importiert, es gab aber einige Fehler', 'feeds_imported' => 'Ihre Feeds wurden importiert und werden jetzt aktualisiert', 'category_emptied' => 'Die Kategorie wurde geleert', - 'feed_deleted' => 'Der Feed wurde gelöscht', - 'feed_validator' => '&Üuml;berprüfen Sie die Gültigkeit des Feeds', + 'feed_deleted' => 'Der Feed wurde gelöscht', + 'feed_validator' => 'Überprüfen Sie die Gültigkeit des Feeds', 'optimization_complete' => 'Die Optimierung ist beendet', 'your_rss_feeds' => 'Ihre RSS Feeds', 'your_favorites' => 'Ihre Favoriten', - 'public' => 'Öffentlich', - 'invalid_login' => 'Das Login ist ungültig', + 'public' => 'Öffentlich', + 'invalid_login' => 'Das Login ist ungültig', // VIEWS 'save' => 'Speichern', - 'delete' => 'Löschen', + 'delete' => 'Löschen', 'cancel' => 'Abbrechen', - 'back_to_rss_feeds' => '← Zurück zu den RSS Feeds gehen', - 'feeds_moved_category_deleted' => 'Wenn Sie eine Kategorie löschen, werden deren Feeds automatisch in die Kategorie %s eingefügt.', + 'back_to_rss_feeds' => '← Zurück zu den RSS Feeds gehen', + 'feeds_moved_category_deleted' => 'Wenn Sie eine Kategorie löschen, werden deren Feeds automatisch in die Kategorie %s eingefügt.', 'category_number' => 'Kategorie n°%d', 'ask_empty' => 'Leeren?', 'number_feeds' => '%d Feeds', - 'can_not_be_deleted' => 'Kann nicht gelöscht werden', - 'add_category' => 'Füge eine Kategorie hinzu', + 'can_not_be_deleted' => 'Kann nicht gelöscht werden', + 'add_category' => 'Füge eine Kategorie hinzu', 'new_category' => 'Neue Kategorie', - 'javascript_for_shortcuts' => 'JavaScript muss ermöglicht werden, wenn Shortcuts verwendet werden sollen', - 'javascript_should_be_activated'=> 'JavaScript muss ermöglicht werden', + 'javascript_for_shortcuts' => 'JavaScript muss ermöglicht werden, wenn Shortcuts verwendet werden sollen', + 'javascript_should_be_activated'=> 'JavaScript muss ermöglicht werden', 'shift_for_all_read' => '+ shift um alle Artikel als gelesen zu markieren', 'see_on_website' => 'Auf der Originalwebseite anschauen', - 'next_article' => 'Zum nächsten Artikel springen', + 'next_article' => 'Zum nächsten Artikel springen', 'last_article' => 'Zum letzten Artikel springen', 'previous_article' => 'Zum vorherigen Artikel springen', 'first_article' => 'Zum ersten Artikel springen', - 'next_page' => 'Zur nächsten Seite springen', + 'next_page' => 'Zur nächsten Seite springen', 'previous_page' => 'Zur vorherigen Seite springen', 'collapse_article' => 'Zusammenfalten', 'auto_share' => 'Teilen', - 'auto_share_help' => 'Wenn es nur eine Option zum Teilen gibt, wird die verwendet. Ansonsten werden die Optionen über die Nummer ausgewählt.', + 'auto_share_help' => 'Wenn es nur eine Option zum Teilen gibt, wird die verwendet. Ansonsten werden die Optionen über die Nummer ausgewählt.', 'file_to_import' => 'Datei zum importieren', 'import' => 'Import', @@ -155,70 +155,70 @@ return array ( 'by_default' => 'Als Vorgabe', 'keep_history' => 'Kleinste Anzahl der Artikel, die behalten werden', 'categorize' => 'In einer Kategorie speichern', - 'truncate' => 'Alle Artikel löschen', + 'truncate' => 'Alle Artikel löschen', 'advanced' => 'Erweitert', 'show_in_all_flux' => 'Im Hauptstrom anzeigen', 'yes' => 'Ja', 'no' => 'Nein', 'css_path_on_website' => 'Pfad zur CSS-Datei des Artikels auf der Original Webseite', - 'retrieve_truncated_feeds' => 'Gekürzte RSS Feeds abrufen (Achtung, benötigt mehr Zeit!)', + 'retrieve_truncated_feeds' => 'Gekürzte RSS Feeds abrufen (Achtung, benötigt mehr Zeit!)', 'http_authentication' => 'HTTP Authentifizierung', 'http_username' => 'HTTP Nutzername', 'http_password' => 'HTTP Passwort', 'blank_to_disable' => 'Zum Ausschalten frei lassen', 'not_yet_implemented' => 'Noch nicht implementiert', - 'access_protected_feeds' => 'Die Verbindung erlaubt Zugriff zu HTTP-geschützten RSS Feeds', - 'no_selected_feed' => 'Kein Feed ausgewählt.', - 'think_to_add' => 'Sie können Feeds hinzufügen.', + 'access_protected_feeds' => 'Die Verbindung erlaubt Zugriff zu HTTP-geschützten RSS Feeds', + 'no_selected_feed' => 'Kein Feed ausgewählt.', + 'think_to_add' => 'Sie können Feeds hinzufügen.', 'current_user' => 'Aktuelle Nutzung', 'default_user' => 'Nutzername des Standardnutzers (maximal 16 Zeichen - alphanumerisch)', - 'password_form' => 'Passwort
    (für die Anmeldemethode per Webformular)', - 'persona_connection_email' => 'Login E-Mail Adresse
    (für Mozilla Persona)', + 'password_form' => 'Passwort
    (für die Anmeldemethode per Webformular)', + 'persona_connection_email' => 'Login E-Mail Adresse
    (für Mozilla Persona)', 'allow_anonymous' => 'Anonymes lesen der Artikel des Standardnutzers (%s) wird erlaubt', 'allow_anonymous_refresh' => 'Aktualisieren der Artikel wird anonymen Nutzern erlaubt', 'auth_token' => 'Authentifizierungs-Token', - 'explain_token' => 'Erlaube den Zugriff auf die RSS-Ausgabe des Standardnutzers ohne Authentifizierung.
    %s?output=rss&token=%s', + 'explain_token' => 'Erlaube den Zugriff auf die RSS-Ausgabe des Standardnutzers ohne Authentifizierung.
    %s?output=rss&token=%s', 'login_configuration' => 'Login', 'is_admin' => 'ist Administrator', 'auth_type' => 'Authentifizierungsmethode', - 'auth_none' => 'Keine (gefährlich)', - 'auth_form' => 'Webformular (traditionell, JavaScript wird benötigt)', - 'http_auth' => 'HTTP (mit HTTPS für erfahrene Nutzer)', - 'auth_persona' => 'Mozilla Persona (modern, JavaScript wird benötigt)', + 'auth_none' => 'Keine (gefährlich)', + 'auth_form' => 'Webformular (traditionell, JavaScript wird benötigt)', + 'http_auth' => 'HTTP (mit HTTPS für erfahrene Nutzer)', + 'auth_persona' => 'Mozilla Persona (modern, JavaScript wird benötigt)', 'users_list' => 'Liste der Nutzer', 'create_user' => 'Neuen Nutzer erstellen', 'username' => 'Nutzername', 'password' => 'Passwort', 'create' => 'Erstellen', 'user_created' => 'Nutzer %s wurde erstellt', - 'user_deleted' => 'Nutzer %s wurde gelöscht', + 'user_deleted' => 'Nutzer %s wurde gelöscht', 'language' => 'Sprache', 'month' => 'Monate', 'archiving_configuration' => 'Archivieren', 'delete_articles_every' => 'Entfernen von Artikeln nach', 'purge_now' => 'Jetzt bereinigen', - 'purge_completed' => 'Die Bereinigung ist abgeschlossen (%d Artikel wurden gelöscht)', - 'archiving_configuration_help' => 'Es gibt weitere Optionen bei den Einstellungen der individuellen Nachrichtenströme', + 'purge_completed' => 'Die Bereinigung ist abgeschlossen (%d Artikel wurden gelöscht)', + 'archiving_configuration_help' => 'Es gibt weitere Optionen bei den Einstellungen der individuellen Nachrichtenströme', 'reading_configuration' => 'Lesen', 'articles_per_page' => 'Anzahl der Artikel pro Seite', 'default_view' => 'Standard-Ansicht', 'sort_order' => 'Sortierreihenfolge', - 'auto_load_more' => 'Die nächsten Artikel am Seitenende laden', + 'auto_load_more' => 'Die nächsten Artikel am Seitenende laden', 'display_articles_unfolded' => 'Die Artikel als Standard zusammen gefaltet anzeigen', 'after_onread' => 'Nach “als gelesen markieren”', - 'jump_next' => 'springe zum nächsten ungelesenen Geschwisterelement (Feed oder Kategorie)', + 'jump_next' => 'springe zum nächsten ungelesenen Geschwisterelement (Feed oder Kategorie)', 'reading_icons' => 'Lese Symbol', 'top_line' => 'Kopfzeile', 'bottom_line' => 'Fusszeile', 'html5_notif_timeout' => 'HTML5 notification timeout', 'seconds_(0_means_no_timeout)' => 'seconds (0 means no timeout)', - 'img_with_lazyload' => 'Verwende die "träge laden" Methode zum laden von Bildern', + 'img_with_lazyload' => 'Verwende die "träge laden" Methode zum laden von Bildern', 'auto_read_when' => 'Artikel als gelesen markieren…', - 'article_selected' => 'wenn der Artikel ausgewählt ist', - 'article_open_on_website' => 'wenn der Artikel auf der Originalwebseite geöffnet ist', - 'scroll' => 'während des Seiten-Scrollens', + 'article_selected' => 'wenn der Artikel ausgewählt ist', + 'article_open_on_website' => 'wenn der Artikel auf der Originalwebseite geöffnet ist', + 'scroll' => 'während des Seiten-Scrollens', 'upon_reception' => 'beim Empfang des Artikels', 'your_shaarli' => 'Ihr Shaarli', 'your_wallabag' => 'Ihr wallabag', @@ -227,7 +227,7 @@ return array ( 'share' => 'teile', 'by_email' => 'Per E-Mail', 'optimize_bdd' => 'Datenbank optimieren', - 'optimize_todo_sometimes' => 'Sollte gelegentlich gemacht werden, um die Größe der Datenbank zu reduzieren', + 'optimize_todo_sometimes' => 'Sollte gelegentlich gemacht werden, um die Größe der Datenbank zu reduzieren', 'theme' => 'Thema', 'more_information' => 'Weitere Informationen', 'activate_sharing' => 'Teilen aktivieren', @@ -243,7 +243,7 @@ return array ( 'article' => 'Artikel', 'title' => 'Titel', 'author' => 'Autor', - 'publication_date' => 'Datum der Veröffentlichung', + 'publication_date' => 'Datum der Veröffentlichung', 'by' => 'von', 'load_more' => 'Weitere Artikel laden', @@ -262,7 +262,7 @@ return array ( 'related_tags' => 'Verwandte tags', 'no_feed_to_display' => 'Es gibt keinen Artikel zum anzeigen.', - 'about_freshrss' => 'Über FreshRSS', + 'about_freshrss' => 'Über FreshRSS', 'project_website' => 'Projekt Webseite', 'lead_developer' => 'Hauptentwickler', 'website' => 'Webseite', @@ -280,14 +280,14 @@ return array ( 'clear_logs' => 'Protokolldateien leeren', 'forbidden_access' => 'Der Zugriff ist verboten!', - 'login_required' => 'Das Login ist nötig:', + 'login_required' => 'Das Login ist nötig:', - 'confirm_action' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Die Aktion kann nicht abgebrochen werden!', + 'confirm_action' => 'Sind Sie sicher, dass Sie diese Aktion durchführen wollen? Die Aktion kann nicht abgebrochen werden!', // DATE 'january' => 'januar', 'february' => 'februar', - 'march' => 'märz', + 'march' => 'märz', 'april' => 'april', 'may' => 'mai', 'june' => 'juni', @@ -319,10 +319,10 @@ return array ( 'status_unread' => 'Ungelesen', 'status_total' => 'Gesamt', - 'stats_entry_repartition' => 'Verteilung der Einträge', - 'stats_entry_per_day' => 'Einträge pro Tag (während der letzten 30 Tage)', + 'stats_entry_repartition' => 'Verteilung der Einträge', + 'stats_entry_per_day' => 'Einträge pro Tag (während der letzten 30 Tage)', 'stats_feed_per_category' => 'Feeds pro Kategorie', - 'stats_entry_per_category' => 'Einträge pro Kategorie', + 'stats_entry_per_category' => 'Einträge pro Kategorie', 'stats_top_feed' => 'Top 10 Feeds', - 'stats_entry_count' => 'Zähler für Einträge', + 'stats_entry_count' => 'Zähler für Einträge', ); diff --git a/app/i18n/en.php b/app/i18n/en.php index f95a97d11..e5def46be 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -115,7 +115,7 @@ return array ( 'access_denied' => 'You don’t have permission to access this page', 'page_not_found' => 'You are looking for a page which doesn’t exist', 'error_occurred' => 'An error occurred', - 'error_occurred_update' => 'Nothing was changed', + 'error_occurred_update' => 'Nothing was changed', 'default_category' => 'Uncategorized', 'categories_updated' => 'Categories have been updated', @@ -249,7 +249,7 @@ return array ( 'unsafe_autologin' => 'Allow unsafe automatic login using the format: ', 'api_enabled' => 'Allow API access (required for mobile apps)', 'auth_token' => 'Authentication token', - 'explain_token' => 'Allows to access RSS output of the default user without authentication.
    %s?output=rss&token=%s', + 'explain_token' => 'Allows to access RSS output of the default user without authentication.
    %s?output=rss&token=%s', 'login_configuration' => 'Login', 'is_admin' => 'is administrator', 'auth_type' => 'Authentication method', @@ -269,7 +269,7 @@ return array ( 'language' => 'Language', 'month' => 'months', 'archiving_configuration' => 'Archiving', - 'delete_articles_every' => 'Remove articles after', + 'delete_articles_every' => 'Remove articles after', 'purge_now' => 'Purge now', 'purge_completed' => 'Purge completed (%d articles deleted)', 'archiving_configuration_help' => 'More options are available in the individual stream settings', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 759207d90..4d39f7eb4 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -249,7 +249,7 @@ return array ( 'unsafe_autologin' => 'Autoriser les connexions automatiques non-sûres au format : ', 'api_enabled' => 'Autoriser l’accès par API (nécessaire pour les applis mobiles)', 'auth_token' => 'Jeton d’identification', - 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
    %s?output=rss&token=%s', + 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
    %s?output=rss&token=%s', 'login_configuration' => 'Identification', 'is_admin' => 'est administrateur', 'auth_type' => 'Méthode d’authentification', -- cgit v1.2.3 From ea7f21ba7f4049b51c2978b7ebaad00e17fa5af5 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 11:21:51 -0400 Subject: Add some comments It is a work in progress. I only did that for a single class so you can tell me if this is a good idea, if the content is missing something. Any comments are welcome. --- app/Controllers/configureController.php | 172 +++++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 2 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 91b74aa29..8fae29ea2 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -1,6 +1,17 @@ view->loginOk) { Minz_Error::error( @@ -13,6 +24,17 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $catDAO->checkDefault(); } + /** + * This action handles the category configuration page + * + * It displays the category configuration page. + * If this action is reached through a POST request, it loops through + * every category to check for modification then add a new category if + * needed then sends a notification to the user. + * If a category name is emptied, the category is deleted and all + * related feeds are moved to the default category. + * If a category name is changed, it is updated. + */ public function categorizeAction() { $feedDAO = FreshRSS_Factory::createFeedDao(); $catDAO = new FreshRSS_CategoryDAO(); @@ -66,6 +88,28 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('categories_management') . ' · '); } + /** + * This action handles the feed configuration page. + * + * It displays the feed configuration page. + * If this action is reached through a POST request, it stores all new + * configuraiton values then sends a notification to the user. + * + * The options available on the page are: + * - name + * - description + * - website URL + * - feed URL + * - category id (default: default category id) + * - CSS path to article on website + * - display in main stream (default: 0) + * - HTTP authentication + * - number of article to retain (default: -2) + * - refresh frequency (default: -2) + * Default values are empty strings unless specified. + * + * @todo change the notification code + */ public function feedAction() { $catDAO = new FreshRSS_CategoryDAO(); $this->view->categories = $catDAO->listCategories(false); @@ -138,6 +182,33 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } } + /** + * This action handles the display configuration page. + * + * It displays the display configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - language (default: en) + * - theme (default: Origin) + * - content width (default: thin) + * - display of read action in header + * - display of favorite action in header + * - display of date in header + * - display of open action in header + * - display of read action in footer + * - display of favorite action in footer + * - display of sharing action in footer + * - display of tags in footer + * - display of date in footer + * - display of open action in footer + * - html5 notification timeout (default: 0) + * Default values are false unless specified. + * + * @todo refactor to theme section to use the same syntax everywhere + * @todo change the notification code + */ public function displayAction() { if (Minz_Request::isPost()) { $this->view->conf->_language(Minz_Request::param('language', 'en')); @@ -178,6 +249,35 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('display_configuration') . ' · '); } + /** + * This action handles the reading configuration page. + * + * It displays the reading configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on the page are: + * - number of posts per page (default: 10) + * - view mode (default: normal) + * - default article view (default: all) + * - load automatically articles + * - display expanded articles + * - display expanded categories + * - hide categories and feeds without unread articles + * - jump on next category or feed when marked as read + * - image lazy loading + * - stick open articles to the top + * - display a confirmation when reading all articles + * - article order (default: DESC) + * - mark articles as read when: + * - displayed + * - opened on site + * - scrolled + * - received + * Default values are false unless specified. + * + * @todo change the notification code + */ public function readingAction() { if (Minz_Request::isPost()) { $this->view->conf->_posts_per_page(Minz_Request::param('posts_per_page', 10)); @@ -216,6 +316,15 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('reading_configuration') . ' · '); } + /** + * This action handles the sharing configuration page. + * + * It displays the sharing configuration page. + * If this action is reached through a POST request, it stores all + * configuration values then sends a notification to the user. + * + * @todo change the notification code + */ public function sharingAction() { if (Minz_Request::isPost()) { $params = Minz_Request::params(); @@ -235,6 +344,22 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('sharing') . ' · '); } + /** + * This action handles the shortcut configuration page. + * + * It displays the shortcut configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The authorized values for shortcuts are letters (a to z), numbers (0 + * to 9), function keys (f1 to f12), backspace, delete, down, end, enter, + * escape, home, insert, left, page down, page up, return, right, space, + * tab and up. + * + * @todo remove numbers from the list of authorized shortcuts since they + * are used to access shortcuts and user queries + * @todo change the notification code + */ public function shortcutAction() { $list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', 'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left', @@ -271,10 +396,31 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('shortcuts') . ' · '); } + /** + * This action display the user configuration page + * + * @todo move that action in the user controller + */ public function usersAction() { Minz_View::prependTitle(Minz_Translate::t('users') . ' · '); } + /** + * This action handles the archive configuration page. + * + * It displays the archive configuration page. + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user. + * + * The options available on that page are: + * - duration to retain old article (default: 3) + * - number of article to retain per feed (default: 0) + * - refresh frequency (default: -2) + * + * @todo explain why the default value is -2 but this value does not + * exist in the drop-down list + * @todo change the notification code + */ public function archivingAction() { if (Minz_Request::isPost()) { $old = Minz_Request::param('old_entries', 3); @@ -306,7 +452,17 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->size_total = $entryDAO->size(true); } } - + + /** + * This action handles the user queries configuration page. + * + * If this action is reached through a POST request, it stores all new + * configuration values then sends a notification to the user then + * redirect to the same page. + * If this action is not reached through a POST request, it displays the + * configuration page and verifies that every user query is runable by + * checking if categories and feeds are still in use. + */ public function queriesAction() { if (Minz_Request::isPost()) { $queries = Minz_Request::param('queries', array()); @@ -383,7 +539,19 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_View::prependTitle(Minz_Translate::t('queries') . ' · '); } - + + /** + * This action handles the creation of a user query. + * + * It gets the GET parameters and stores them in the configuration query + * storage. Before it is saved, the unwanted parameters are unset to keep + * lean data. + * + * @todo change the way of keeping lean data to have a more defensive + * code. At the moment, the code accepts any parameters and discard those + * on the black list. I think it is safer if we maintain a whitelist + * instead. + */ public function addQueryAction() { $queries = $this->view->conf->queries; $query = Minz_Request::params(); -- cgit v1.2.3 From cf01508fa58b5bdd85606fb766a79643a04ca6b7 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 11:25:53 -0400 Subject: Fix typo --- app/Controllers/configureController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 8fae29ea2..7340ca17a 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -206,7 +206,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - html5 notification timeout (default: 0) * Default values are false unless specified. * - * @todo refactor to theme section to use the same syntax everywhere + * @todo refactor theme section to use the same syntax everywhere * @todo change the notification code */ public function displayAction() { -- cgit v1.2.3 From bad165b0c424c9c650e22fec11ceecf1748d98e7 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 11:28:46 -0400 Subject: Add a todo --- app/Controllers/configureController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 7340ca17a..99c72d869 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -420,6 +420,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * @todo explain why the default value is -2 but this value does not * exist in the drop-down list * @todo change the notification code + * @todo refactor configuration setting syntax to be consistent with the + * other methods */ public function archivingAction() { if (Minz_Request::isPost()) { -- cgit v1.2.3 From 0420a989391c9af30ee6d85638c81bfb4f605132 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 11:51:53 -0400 Subject: Add comments on the stat controller --- app/Controllers/statsController.php | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 000b41dd2..64f66f2fa 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -1,7 +1,21 @@ view->topFeed = $statsDAO->calculateTopFeed(); } + /** + * This action handles the idle feed statistic page. + * + * It displays the list of idle feed for different period. The supported + * periods are: + * - last year + * - last 6 months + * - last 3 months + * - last month + * - last week + */ public function idleAction() { $statsDAO = FreshRSS_Factory::createStatsDAO(); $feeds = $statsDAO->calculateFeedLastDate(); @@ -56,6 +81,18 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $this->view->idleFeeds = $idleFeeds; } + /** + * This action handles the article repartition statistic page. + * + * It displays the number of article and the average of article for the + * following periods: + * - hour of the day + * - day of the week + * - month + * + * @todo verify that the metrics used here make some sense. Especially + * for the average. + */ public function repartitionAction() { $statsDAO = FreshRSS_Factory::createStatsDAO(); $categoryDAO = new FreshRSS_CategoryDAO(); @@ -74,6 +111,11 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id); } + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ public function firstAction() { if (!$this->view->loginOk) { Minz_Error::error( -- cgit v1.2.3 From 5889ef35c8ecbbae948420af9f2b05e7010593ae Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 12:01:36 -0400 Subject: Change todo align --- app/Controllers/configureController.php | 14 +++++++------- app/Controllers/statsController.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 99c72d869..7b8dd672f 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -10,7 +10,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * underlying framework. * * @todo see if the category default configuration is needed here or if - * we can move it to the categorize action + * we can move it to the categorize action */ public function firstAction() { if (!$this->view->loginOk) { @@ -357,7 +357,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * tab and up. * * @todo remove numbers from the list of authorized shortcuts since they - * are used to access shortcuts and user queries + * are used to access shortcuts and user queries * @todo change the notification code */ public function shortcutAction() { @@ -418,10 +418,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - refresh frequency (default: -2) * * @todo explain why the default value is -2 but this value does not - * exist in the drop-down list + * exist in the drop-down list * @todo change the notification code * @todo refactor configuration setting syntax to be consistent with the - * other methods + * other methods */ public function archivingAction() { if (Minz_Request::isPost()) { @@ -550,9 +550,9 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * lean data. * * @todo change the way of keeping lean data to have a more defensive - * code. At the moment, the code accepts any parameters and discard those - * on the black list. I think it is safer if we maintain a whitelist - * instead. + * code. At the moment, the code accepts any parameters and discard + * those on the black list. I think it is safer if we maintain a + * whitelist instead. */ public function addQueryAction() { $queries = $this->view->conf->queries; diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 64f66f2fa..256543f37 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -91,7 +91,7 @@ class FreshRSS_stats_Controller extends Minz_ActionController { * - month * * @todo verify that the metrics used here make some sense. Especially - * for the average. + * for the average. */ public function repartitionAction() { $statsDAO = FreshRSS_Factory::createStatsDAO(); -- cgit v1.2.3 From f87dfbc528f4fa451a2a213fdbd3fcaf27308de8 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 18:09:10 -0400 Subject: Change notification code Before, it was using the old way to display notifications to the user. Now, it uses the encapsulated method to do that. --- app/Controllers/configureController.php | 63 +++++++-------------------------- 1 file changed, 12 insertions(+), 51 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 7b8dd672f..1e341b412 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -72,13 +72,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('categories_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'categorize'), true); + Minz_Request::good(_t('categories_updated'), + array('c' => 'configure', 'a' => 'categorize')); } $this->view->categories = $catDAO->listCategories(false); @@ -107,8 +102,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - number of article to retain (default: -2) * - refresh frequency (default: -2) * Default values are empty strings unless specified. - * - * @todo change the notification code */ public function feedAction() { $catDAO = new FreshRSS_CategoryDAO(); @@ -207,7 +200,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * Default values are false unless specified. * * @todo refactor theme section to use the same syntax everywhere - * @todo change the notification code */ public function displayAction() { if (Minz_Request::isPost()) { @@ -235,13 +227,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Translate::reset(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'display'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'display')); } $this->view->themes = FreshRSS_Themes::get(); @@ -275,8 +262,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - scrolled * - received * Default values are false unless specified. - * - * @todo change the notification code */ public function readingAction() { if (Minz_Request::isPost()) { @@ -304,13 +289,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Translate::reset(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'reading'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'reading')); } Minz_View::prependTitle(Minz_Translate::t('reading_configuration') . ' · '); @@ -322,8 +302,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * It displays the sharing configuration page. * If this action is reached through a POST request, it stores all * configuration values then sends a notification to the user. - * - * @todo change the notification code */ public function sharingAction() { if (Minz_Request::isPost()) { @@ -332,13 +310,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->conf->save(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'sharing'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'sharing')); } Minz_View::prependTitle(Minz_Translate::t('sharing') . ' · '); @@ -358,7 +331,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * * @todo remove numbers from the list of authorized shortcuts since they * are used to access shortcuts and user queries - * @todo change the notification code */ public function shortcutAction() { $list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', @@ -384,13 +356,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->conf->save(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('shortcuts_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'shortcut'), true); + Minz_Request::good(_t('shortcuts_updated'), + array('c' => 'configure', 'a' => 'shortcut')); } Minz_View::prependTitle(Minz_Translate::t('shortcuts') . ' · '); @@ -419,7 +386,6 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * * @todo explain why the default value is -2 but this value does not * exist in the drop-down list - * @todo change the notification code * @todo refactor configuration setting syntax to be consistent with the * other methods */ @@ -435,13 +401,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->conf->save(); invalidateHttpCache(); - $notif = array( - 'type' => 'good', - 'content' => Minz_Translate::t('configuration_updated') - ); - Minz_Session::_param('notification', $notif); - - Minz_Request::forward(array('c' => 'configure', 'a' => 'archiving'), true); + Minz_Request::good(_t('configuration_updated'), + array('c' => 'configure', 'a' => 'archiving')); } Minz_View::prependTitle(Minz_Translate::t('archiving_configuration') . ' · '); -- cgit v1.2.3 From 3753ea8fd673feb16a2bfb323fea2b5ff964d77e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 18:23:25 -0400 Subject: Change parameter settings to be consistent through out the file --- app/Controllers/configureController.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 1e341b412..0e4c0be52 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -198,17 +198,11 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * - display of open action in footer * - html5 notification timeout (default: 0) * Default values are false unless specified. - * - * @todo refactor theme section to use the same syntax everywhere */ public function displayAction() { if (Minz_Request::isPost()) { $this->view->conf->_language(Minz_Request::param('language', 'en')); - $themeId = Minz_Request::param('theme', ''); - if ($themeId == '') { - $themeId = FreshRSS_Themes::defaultTheme; - } - $this->view->conf->_theme($themeId); + $this->view->conf->_theme(Minz_Request::param('theme', FreshRSS_Themes::$defaultTheme)); $this->view->conf->_content_width(Minz_Request::param('content_width', 'thin')); $this->view->conf->_topline_read(Minz_Request::param('topline_read', false)); $this->view->conf->_topline_favorite(Minz_Request::param('topline_favorite', false)); @@ -386,18 +380,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * * @todo explain why the default value is -2 but this value does not * exist in the drop-down list - * @todo refactor configuration setting syntax to be consistent with the - * other methods */ public function archivingAction() { if (Minz_Request::isPost()) { - $old = Minz_Request::param('old_entries', 3); - $keepHistoryDefault = Minz_Request::param('keep_history_default', 0); - $ttlDefault = Minz_Request::param('ttl_default', -2); - - $this->view->conf->_old_entries($old); - $this->view->conf->_keep_history_default($keepHistoryDefault); - $this->view->conf->_ttl_default($ttlDefault); + $this->view->conf->_old_entries(Minz_Request::param('old_entries', 3)); + $this->view->conf->_keep_history_default(Minz_Request::param('keep_history_default', 0)); + $this->view->conf->_ttl_default(Minz_Request::param('ttl_default', -2)); $this->view->conf->save(); invalidateHttpCache(); -- cgit v1.2.3 From 04403c5dfae2db051416ccf0b41559d02bb0d287 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 18:26:27 -0400 Subject: Remove number values for shortcuts as they are used in the default configuration --- app/Controllers/configureController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 0e4c0be52..a44ef3104 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -322,17 +322,13 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * to 9), function keys (f1 to f12), backspace, delete, down, end, enter, * escape, home, insert, left, page down, page up, return, right, space, * tab and up. - * - * @todo remove numbers from the list of authorized shortcuts since they - * are used to access shortcuts and user queries */ public function shortcutAction() { $list_keys = array('a', 'b', 'backspace', 'c', 'd', 'delete', 'down', 'e', 'end', 'enter', 'escape', 'f', 'g', 'h', 'home', 'i', 'insert', 'j', 'k', 'l', 'left', 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', - 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', + 'z', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12'); $this->view->list_keys = $list_keys; -- cgit v1.2.3 From 23e4577e02944567b8ac15581d9c0a0561d82046 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 18:40:08 -0400 Subject: Change param filter for user queries Before, the filter was based on a blacklist so the user could add something and have unwanted behavior. Now, the filter is based on a whilelist so the user can use only predetermined parameters. --- app/Controllers/configureController.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index a44ef3104..2bd13997f 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -493,18 +493,17 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * It gets the GET parameters and stores them in the configuration query * storage. Before it is saved, the unwanted parameters are unset to keep * lean data. - * - * @todo change the way of keeping lean data to have a more defensive - * code. At the moment, the code accepts any parameters and discard - * those on the black list. I think it is safer if we maintain a - * whitelist instead. */ public function addQueryAction() { + $whitelist = array('get', 'order', 'name', 'search', 'state'); $queries = $this->view->conf->queries; $query = Minz_Request::params(); $query['name'] = _t('query_number', count($queries) + 1); - unset($query['output']); - unset($query['token']); + foreach ($query as $key => $value) { + if (!in_array($key, $whitelist)) { + unset($query[$key]); + } + } $queries[] = $query; $this->view->conf->_queries($queries); $this->view->conf->save(); -- cgit v1.2.3 From c791d84ded1eeb1b32fe81918ac1bcfa520c6bda Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 21 Sep 2014 18:49:34 -0400 Subject: Fix user queries Before, when adding a user query where the state contains the strict filter, the label applied to the query was wrong. Now, the strict filter is always removed so the label applied is correct. --- app/Controllers/configureController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 2bd13997f..426cad34d 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -504,6 +504,9 @@ class FreshRSS_configure_Controller extends Minz_ActionController { unset($query[$key]); } } + if ($query['state'] & FreshRSS_Entry::STATE_STRICT) { + $query['state'] -= FreshRSS_Entry::STATE_STRICT; + } $queries[] = $query; $this->view->conf->_queries($queries); $this->view->conf->save(); -- cgit v1.2.3 From 0ea3a5a3943b30eb6a5d8763b698a939fe1a98ae Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 11:49:32 +0200 Subject: Coding style configureController.php --- app/Controllers/configureController.php | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 426cad34d..4422f33af 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -16,7 +16,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { if (!$this->view->loginOk) { Minz_Error::error( 403, - array('error' => array(Minz_Translate::t('access_denied'))) + array('error' => array(_t('access_denied'))) ); } @@ -73,14 +73,14 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('categories_updated'), - array('c' => 'configure', 'a' => 'categorize')); + array('c' => 'configure', 'a' => 'categorize')); } $this->view->categories = $catDAO->listCategories(false); $this->view->defaultCategory = $catDAO->getDefault(); $this->view->feeds = $feedDAO->listFeeds(); - Minz_View::prependTitle(Minz_Translate::t('categories_management') . ' · '); + Minz_View::prependTitle(_t('categories_management') . ' · '); } /** @@ -122,7 +122,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { if (!$this->view->flux) { Minz_Error::error( 404, - array('error' => array(Minz_Translate::t('page_not_found'))) + array('error' => array(_t('page_not_found'))) ); } else { if (Minz_Request::isPost() && $this->view->flux) { @@ -154,12 +154,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->flux->faviconPrepare(); $notif = array( 'type' => 'good', - 'content' => Minz_Translate::t('feed_updated') + 'content' => _t('feed_updated') ); } else { $notif = array( 'type' => 'bad', - 'content' => Minz_Translate::t('error_occurred_update') + 'content' => _t('error_occurred_update') ); } invalidateHttpCache(); @@ -168,10 +168,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { Minz_Request::forward(array('c' => 'configure', 'a' => 'feed', 'params' => array('id' => $id)), true); } - Minz_View::prependTitle(Minz_Translate::t('rss_feed_management') . ' — ' . $this->view->flux->name() . ' · '); + Minz_View::prependTitle(_t('rss_feed_management') . ' — ' . $this->view->flux->name() . ' · '); } } else { - Minz_View::prependTitle(Minz_Translate::t('rss_feed_management') . ' · '); + Minz_View::prependTitle(_t('rss_feed_management') . ' · '); } } @@ -222,12 +222,12 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('configuration_updated'), - array('c' => 'configure', 'a' => 'display')); + array('c' => 'configure', 'a' => 'display')); } $this->view->themes = FreshRSS_Themes::get(); - Minz_View::prependTitle(Minz_Translate::t('display_configuration') . ' · '); + Minz_View::prependTitle(_t('display_configuration') . ' · '); } /** @@ -284,10 +284,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('configuration_updated'), - array('c' => 'configure', 'a' => 'reading')); + array('c' => 'configure', 'a' => 'reading')); } - Minz_View::prependTitle(Minz_Translate::t('reading_configuration') . ' · '); + Minz_View::prependTitle(_t('reading_configuration') . ' · '); } /** @@ -305,10 +305,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('configuration_updated'), - array('c' => 'configure', 'a' => 'sharing')); + array('c' => 'configure', 'a' => 'sharing')); } - Minz_View::prependTitle(Minz_Translate::t('sharing') . ' · '); + Minz_View::prependTitle(_t('sharing') . ' · '); } /** @@ -347,10 +347,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('shortcuts_updated'), - array('c' => 'configure', 'a' => 'shortcut')); + array('c' => 'configure', 'a' => 'shortcut')); } - Minz_View::prependTitle(Minz_Translate::t('shortcuts') . ' · '); + Minz_View::prependTitle(_t('shortcuts') . ' · '); } /** @@ -359,7 +359,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * @todo move that action in the user controller */ public function usersAction() { - Minz_View::prependTitle(Minz_Translate::t('users') . ' · '); + Minz_View::prependTitle(_t('users') . ' · '); } /** @@ -386,10 +386,10 @@ class FreshRSS_configure_Controller extends Minz_ActionController { invalidateHttpCache(); Minz_Request::good(_t('configuration_updated'), - array('c' => 'configure', 'a' => 'archiving')); + array('c' => 'configure', 'a' => 'archiving')); } - Minz_View::prependTitle(Minz_Translate::t('archiving_configuration') . ' · '); + Minz_View::prependTitle(_t('archiving_configuration') . ' · '); $entryDAO = FreshRSS_Factory::createEntryDao(); $this->view->nb_total = $entryDAO->count(); @@ -484,7 +484,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } } - Minz_View::prependTitle(Minz_Translate::t('queries') . ' · '); + Minz_View::prependTitle(_t('queries') . ' · '); } /** -- cgit v1.2.3 From a80e12cbf7a38d5a745b8ce980e9c662f9c64dfb Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 12:32:49 +0200 Subject: Remove queries at the same time as categories See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/Controllers/configureController.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 4422f33af..d2ca0777f 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -32,7 +32,8 @@ class FreshRSS_configure_Controller extends Minz_ActionController { * every category to check for modification then add a new category if * needed then sends a notification to the user. * If a category name is emptied, the category is deleted and all - * related feeds are moved to the default category. + * related feeds are moved to the default category. Related user queries + * are deleted too. * If a category name is changed, it is updated. */ public function categorizeAction() { @@ -56,6 +57,18 @@ class FreshRSS_configure_Controller extends Minz_ActionController { } elseif ($ids[$key] != $defaultId) { $feedDAO->changeCategory($ids[$key], $defaultId); $catDAO->deleteCategory($ids[$key]); + + // Remove related queries. + $final_queries = array(); + $id_cat_in_query = 'c_' . $ids[$key]; + foreach ($this->view->conf->queries as $key => $query) { + if (empty($query['get']) || + $query['get'] !== $id_cat_in_query) { + $final_queries[$key] = $query; + } + } + $this->view->conf->_queries($final_queries); + $this->view->conf->save(); } } -- cgit v1.2.3 From 666162ae56c2df8ae6a7ed6602b69f6caad10c7c Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 12:34:44 +0200 Subject: Fix a bug when $query['state'] doesn't exist Add a test in addQueryAction(). --- app/Controllers/configureController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index d2ca0777f..e6e9172e6 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -517,7 +517,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { unset($query[$key]); } } - if ($query['state'] & FreshRSS_Entry::STATE_STRICT) { + if (!empty($query['state']) && $query['state'] & FreshRSS_Entry::STATE_STRICT) { $query['state'] -= FreshRSS_Entry::STATE_STRICT; } $queries[] = $query; -- cgit v1.2.3 From 5a1baff9be7cf9fe3f59fe2a7dc34fbadacc1a99 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 13:28:09 +0200 Subject: Refactor removing query by get param See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/Controllers/configureController.php | 10 +--------- app/Models/Configuration.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index e6e9172e6..231865bd7 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -59,15 +59,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $catDAO->deleteCategory($ids[$key]); // Remove related queries. - $final_queries = array(); - $id_cat_in_query = 'c_' . $ids[$key]; - foreach ($this->view->conf->queries as $key => $query) { - if (empty($query['get']) || - $query['get'] !== $id_cat_in_query) { - $final_queries[$key] = $query; - } - } - $this->view->conf->_queries($final_queries); + $this->view->conf->remove_query_by_get('c_' . $ids[$key]); $this->view->conf->save(); } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index ea1556cbb..91d2ab846 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -124,6 +124,16 @@ class FreshRSS_Configuration { return $this->available_languages; } + public function remove_query_by_get($get) { + $final_queries = array(); + foreach ($this->queries as $key => $query) { + if (empty($query['get']) || $query['get'] !== $get) { + $final_queries[$key] = $query; + } + } + $this->_queries($final_queries); + } + public function _language($value) { if (!isset($this->available_languages[$value])) { $value = 'en'; -- cgit v1.2.3 From 17f686095ddebe1a7c94fe665eddfdfef9696015 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 13:38:07 +0200 Subject: Remove queries at the same time as feeds See https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/Controllers/feedController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 65d4b3a37..c7cc25fbb 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -383,7 +383,16 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedDAO = FreshRSS_Factory::createFeedDao(); if ($type == 'category') { + // List feeds to remove then related user queries. + $feeds = $feedDAO->listByCategory($id); + if ($feedDAO->deleteFeedByCategory ($id)) { + // Remove related queries + foreach ($feeds as $feed) { + $this->view->conf->remove_query_by_get('f_' . $feed->id()); + } + $this->view->conf->save(); + $notif = array ( 'type' => 'good', 'content' => Minz_Translate::t ('category_emptied') @@ -397,6 +406,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } } else { if ($feedDAO->deleteFeed ($id)) { + // Remove related queries + $this->view->conf->remove_query_by_get('f_' . $id); + $this->view->conf->save(); + $notif = array ( 'type' => 'good', 'content' => Minz_Translate::t ('feed_deleted') -- cgit v1.2.3 From bcb1e3750a9eee51070d602cc77def06f7f071c9 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 13:56:40 +0200 Subject: More explicit message when deleting feeds or cats Introduce "data-str-confirm" to override default message for confirm actions. Fix https://github.com/marienfressinaud/FreshRSS/issues/625 --- app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/configure/categorize.phtml | 5 ++++- app/views/configure/feed.phtml | 7 +++++-- app/views/helpers/javascript_vars.phtml | 2 +- p/scripts/main.js | 5 +++++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/i18n/en.php b/app/i18n/en.php index e5def46be..1ceb7b1fa 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -368,6 +368,7 @@ return array ( 'login_required' => 'Login required:', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', + 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You may lost related favorites and user queries. It cannot be cancelled!', 'notif_title_new_articles' => 'FreshRSS: new articles!', 'notif_body_new_articles' => 'There are \d new articles to read on FreshRSS.', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4d39f7eb4..b0fbf15ae 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -368,6 +368,7 @@ return array ( 'login_required' => 'Accès protégé par mot de passe :', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', + 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous pourriez perdre les favoris et les filtres associés. Cette action ne peut être annulée !', 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', 'notif_body_new_articles' => 'Il y a \d nouveaux articles à lire sur FreshRSS.', diff --git a/app/views/configure/categorize.phtml b/app/views/configure/categorize.phtml index 2f0e554ca..23d1c9fa1 100644 --- a/app/views/configure/categorize.phtml +++ b/app/views/configure/categorize.phtml @@ -21,7 +21,10 @@ - +
    (nbFeed ()); ?>) diff --git a/app/views/configure/feed.phtml b/app/views/configure/feed.phtml index 0959652c2..e96a28739 100644 --- a/app/views/configure/feed.phtml +++ b/app/views/configure/feed.phtml @@ -79,8 +79,11 @@
    - - + +
    diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index bf0ffdb76..1139eb446 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -51,7 +51,7 @@ echo 'authType="', $authType, '",', 'url_login="', _url ('index', 'login'), '",', 'url_logout="', _url ('index', 'logout'), '",'; -echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; +echo 'str_confirmation_default="', Minz_Translate::t('confirm_action'), '"', ",\n"; echo 'str_notif_title_articles="', Minz_Translate::t('notif_title_new_articles'), '"', ",\n"; echo 'str_notif_body_articles="', Minz_Translate::t('notif_body_new_articles'), '"', ",\n"; echo 'html5_notif_timeout=', $this->conf->html5_notif_timeout,",\n"; diff --git a/p/scripts/main.js b/p/scripts/main.js index 2503116ee..f6d5d2907 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1109,6 +1109,11 @@ function init_persona() { function init_confirm_action() { $('body').on('click', '.confirm', function () { + var str_confirmation = $(this).attr('data-str-confirm'); + if (!str_confirmation) { + str_confirmation = str_confirmation_default; + } + return confirm(str_confirmation); }); } -- cgit v1.2.3 From e6a25f78f5abaea4dc0bfeba2bbb0a90119c624b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 24 Sep 2014 14:14:33 +0200 Subject: Fix bug mark as read a complete feed Related to https://github.com/marienfressinaud/FreshRSS/issues/599 Fix https://github.com/marienfressinaud/FreshRSS/issues/633 --- app/layout/aside_flux.phtml | 10 +++++++++- app/layout/nav_menu.phtml | 10 +++++----- app/views/helpers/pagination.phtml | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtml index 9688a3273..76f53e8dc 100644 --- a/app/layout/aside_flux.phtml +++ b/app/layout/aside_flux.phtml @@ -3,6 +3,8 @@
      loginOk) { ?> + +
    • @@ -87,7 +89,13 @@
    • -
    • +
    • + conf->reading_confirm ? 'confirm' : ''; ?> + +
    diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 03f496d1f..af2323325 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -187,12 +187,12 @@ Minz_Session::_param('markReadUrl', $markReadUrl); ?> - +