From 8395d0b76145969f4b8940a415af5e46528f04a5 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 10 Mar 2016 18:48:21 +0100 Subject: Adds a route for ATOM and RSS feeds page --- application/Router.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application/Router.php') diff --git a/application/Router.php b/application/Router.php index 6185f08e..d98312b5 100644 --- a/application/Router.php +++ b/application/Router.php @@ -15,6 +15,10 @@ class Router public static $PAGE_DAILY = 'daily'; + public static $PAGE_FEED_ATOM = 'atom'; + + public static $PAGE_FEED_RSS = 'rss'; + public static $PAGE_TOOLS = 'tools'; public static $PAGE_CHANGEPASSWORD = 'changepasswd'; @@ -79,6 +83,14 @@ class Router return self::$PAGE_DAILY; } + if (startsWith($query, 'do='. self::$PAGE_FEED_ATOM)) { + return self::$PAGE_FEED_ATOM; + } + + if (startsWith($query, 'do='. self::$PAGE_FEED_RSS)) { + return self::$PAGE_FEED_RSS; + } + // At this point, only loggedin pages. if (!$loggedIn) { return self::$PAGE_LINKLIST; -- cgit v1.2.3 From 82e3680203896f024958ae969e2c4fccee9682f4 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 12 Mar 2016 16:08:01 +0100 Subject: Create a FeedBuilder class which build data for both ATOM and RSS feed. --- application/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'application/Router.php') diff --git a/application/Router.php b/application/Router.php index d98312b5..a1e594a0 100644 --- a/application/Router.php +++ b/application/Router.php @@ -53,7 +53,7 @@ class Router * @param array $get $_SERVER['GET']. * @param bool $loggedIn true if authenticated user. * - * @return self::page found. + * @return string page found. */ public static function findPage($query, $get, $loggedIn) { -- cgit v1.2.3