diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-10-12 13:58:35 +0200 |
commit | bc22c9a0acb095970e9494cbe8954f0612e05dc0 (patch) | |
tree | 4e3a94b7469f5b2e3eaf946756235730429bf9d4 /application/Router.php | |
parent | 890afc32f744859d11b97eb26ed5c030af9b4145 (diff) | |
parent | ebd67c6e1b40aebdd3a52285ce9ff9412b2a3038 (diff) | |
download | Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.gz Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.zst Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.zip |
Merge tag 'v0.7.0' of github.com:shaarli/Shaarli into stable
Release v0.7.0
Diffstat (limited to 'application/Router.php')
-rw-r--r-- | application/Router.php | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/application/Router.php b/application/Router.php index 6185f08e..2c3934b0 100644 --- a/application/Router.php +++ b/application/Router.php | |||
@@ -15,6 +15,10 @@ class Router | |||
15 | 15 | ||
16 | public static $PAGE_DAILY = 'daily'; | 16 | public static $PAGE_DAILY = 'daily'; |
17 | 17 | ||
18 | public static $PAGE_FEED_ATOM = 'atom'; | ||
19 | |||
20 | public static $PAGE_FEED_RSS = 'rss'; | ||
21 | |||
18 | public static $PAGE_TOOLS = 'tools'; | 22 | public static $PAGE_TOOLS = 'tools'; |
19 | 23 | ||
20 | public static $PAGE_CHANGEPASSWORD = 'changepasswd'; | 24 | public static $PAGE_CHANGEPASSWORD = 'changepasswd'; |
@@ -49,7 +53,7 @@ class Router | |||
49 | * @param array $get $_SERVER['GET']. | 53 | * @param array $get $_SERVER['GET']. |
50 | * @param bool $loggedIn true if authenticated user. | 54 | * @param bool $loggedIn true if authenticated user. |
51 | * | 55 | * |
52 | * @return self::page found. | 56 | * @return string page found. |
53 | */ | 57 | */ |
54 | public static function findPage($query, $get, $loggedIn) | 58 | public static function findPage($query, $get, $loggedIn) |
55 | { | 59 | { |
@@ -59,19 +63,19 @@ class Router | |||
59 | return self::$PAGE_LINKLIST; | 63 | return self::$PAGE_LINKLIST; |
60 | } | 64 | } |
61 | 65 | ||
62 | if (startswith($query, 'do='. self::$PAGE_LOGIN) && $loggedIn === false) { | 66 | if (startsWith($query, 'do='. self::$PAGE_LOGIN) && $loggedIn === false) { |
63 | return self::$PAGE_LOGIN; | 67 | return self::$PAGE_LOGIN; |
64 | } | 68 | } |
65 | 69 | ||
66 | if (startswith($query, 'do='. self::$PAGE_PICWALL)) { | 70 | if (startsWith($query, 'do='. self::$PAGE_PICWALL)) { |
67 | return self::$PAGE_PICWALL; | 71 | return self::$PAGE_PICWALL; |
68 | } | 72 | } |
69 | 73 | ||
70 | if (startswith($query, 'do='. self::$PAGE_TAGCLOUD)) { | 74 | if (startsWith($query, 'do='. self::$PAGE_TAGCLOUD)) { |
71 | return self::$PAGE_TAGCLOUD; | 75 | return self::$PAGE_TAGCLOUD; |
72 | } | 76 | } |
73 | 77 | ||
74 | if (startswith($query, 'do='. self::$PAGE_OPENSEARCH)) { | 78 | if (startsWith($query, 'do='. self::$PAGE_OPENSEARCH)) { |
75 | return self::$PAGE_OPENSEARCH; | 79 | return self::$PAGE_OPENSEARCH; |
76 | } | 80 | } |
77 | 81 | ||
@@ -79,28 +83,36 @@ class Router | |||
79 | return self::$PAGE_DAILY; | 83 | return self::$PAGE_DAILY; |
80 | } | 84 | } |
81 | 85 | ||
86 | if (startsWith($query, 'do='. self::$PAGE_FEED_ATOM)) { | ||
87 | return self::$PAGE_FEED_ATOM; | ||
88 | } | ||
89 | |||
90 | if (startsWith($query, 'do='. self::$PAGE_FEED_RSS)) { | ||
91 | return self::$PAGE_FEED_RSS; | ||
92 | } | ||
93 | |||
82 | // At this point, only loggedin pages. | 94 | // At this point, only loggedin pages. |
83 | if (!$loggedIn) { | 95 | if (!$loggedIn) { |
84 | return self::$PAGE_LINKLIST; | 96 | return self::$PAGE_LINKLIST; |
85 | } | 97 | } |
86 | 98 | ||
87 | if (startswith($query, 'do='. self::$PAGE_TOOLS)) { | 99 | if (startsWith($query, 'do='. self::$PAGE_TOOLS)) { |
88 | return self::$PAGE_TOOLS; | 100 | return self::$PAGE_TOOLS; |
89 | } | 101 | } |
90 | 102 | ||
91 | if (startswith($query, 'do='. self::$PAGE_CHANGEPASSWORD)) { | 103 | if (startsWith($query, 'do='. self::$PAGE_CHANGEPASSWORD)) { |
92 | return self::$PAGE_CHANGEPASSWORD; | 104 | return self::$PAGE_CHANGEPASSWORD; |
93 | } | 105 | } |
94 | 106 | ||
95 | if (startswith($query, 'do='. self::$PAGE_CONFIGURE)) { | 107 | if (startsWith($query, 'do='. self::$PAGE_CONFIGURE)) { |
96 | return self::$PAGE_CONFIGURE; | 108 | return self::$PAGE_CONFIGURE; |
97 | } | 109 | } |
98 | 110 | ||
99 | if (startswith($query, 'do='. self::$PAGE_CHANGETAG)) { | 111 | if (startsWith($query, 'do='. self::$PAGE_CHANGETAG)) { |
100 | return self::$PAGE_CHANGETAG; | 112 | return self::$PAGE_CHANGETAG; |
101 | } | 113 | } |
102 | 114 | ||
103 | if (startswith($query, 'do='. self::$PAGE_ADDLINK)) { | 115 | if (startsWith($query, 'do='. self::$PAGE_ADDLINK)) { |
104 | return self::$PAGE_ADDLINK; | 116 | return self::$PAGE_ADDLINK; |
105 | } | 117 | } |
106 | 118 | ||
@@ -108,19 +120,19 @@ class Router | |||
108 | return self::$PAGE_EDITLINK; | 120 | return self::$PAGE_EDITLINK; |
109 | } | 121 | } |
110 | 122 | ||
111 | if (startswith($query, 'do='. self::$PAGE_EXPORT)) { | 123 | if (startsWith($query, 'do='. self::$PAGE_EXPORT)) { |
112 | return self::$PAGE_EXPORT; | 124 | return self::$PAGE_EXPORT; |
113 | } | 125 | } |
114 | 126 | ||
115 | if (startswith($query, 'do='. self::$PAGE_IMPORT)) { | 127 | if (startsWith($query, 'do='. self::$PAGE_IMPORT)) { |
116 | return self::$PAGE_IMPORT; | 128 | return self::$PAGE_IMPORT; |
117 | } | 129 | } |
118 | 130 | ||
119 | if (startswith($query, 'do='. self::$PAGE_PLUGINSADMIN)) { | 131 | if (startsWith($query, 'do='. self::$PAGE_PLUGINSADMIN)) { |
120 | return self::$PAGE_PLUGINSADMIN; | 132 | return self::$PAGE_PLUGINSADMIN; |
121 | } | 133 | } |
122 | 134 | ||
123 | if (startswith($query, 'do='. self::$PAGE_SAVE_PLUGINSADMIN)) { | 135 | if (startsWith($query, 'do='. self::$PAGE_SAVE_PLUGINSADMIN)) { |
124 | return self::$PAGE_SAVE_PLUGINSADMIN; | 136 | return self::$PAGE_SAVE_PLUGINSADMIN; |
125 | } | 137 | } |
126 | 138 | ||