From 509c8cae6381ec46af7c8303eb92fda6ce496a4a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 4 Jul 2022 09:53:26 +0200 Subject: Dynamic OPML (#4407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark --- app/Models/Context.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'app/Models/Context.php') diff --git a/app/Models/Context.php b/app/Models/Context.php index 55607f5c4..ab855966b 100644 --- a/app/Models/Context.php +++ b/app/Models/Context.php @@ -197,6 +197,20 @@ class FreshRSS_Context { } } + /** + * @return bool true if the current request targets all feeds (main view), false otherwise. + */ + public static function isAll(): bool { + return self::$current_get['all'] != false; + } + + /** + * @return bool true if the current request targets a category, false otherwise. + */ + public static function isCategory(): bool { + return self::$current_get['category'] != false; + } + /** * @return bool true if the current request targets a feed (and not a category or all articles), false otherwise. */ @@ -251,8 +265,7 @@ class FreshRSS_Context { */ public static function _get($get) { $type = $get[0]; - $id = substr($get, 2); - $nb_unread = 0; + $id = intval(substr($get, 2)); if (empty(self::$categories)) { $catDAO = FreshRSS_Factory::createCategoryDao(); -- cgit v1.2.3