aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Router.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-13 12:07:13 +0200
committerArthurHoaro <arthur@hoa.ro>2020-10-13 12:07:13 +0200
commitd9f6275ebca035fec8331652c677981056793ccc (patch)
tree37a64baf4f0eba6b781040605965383d8aded2cc /application/Router.php
parent38672ba0d1c722e5d6d33a58255ceb55e9410e46 (diff)
parentd63ff87a009313141ae684ec447b902562ff6ee7 (diff)
downloadShaarli-stable.tar.gz
Shaarli-stable.tar.zst
Shaarli-stable.zip
Merge branch 'v0.11' into stablestable
Diffstat (limited to 'application/Router.php')
-rw-r--r--application/Router.php49
1 files changed, 28 insertions, 21 deletions
diff --git a/application/Router.php b/application/Router.php
index beb3165b..d7187487 100644
--- a/application/Router.php
+++ b/application/Router.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2namespace Shaarli;
2 3
3/** 4/**
4 * Class Router 5 * Class Router
@@ -37,6 +38,8 @@ class Router
37 38
38 public static $PAGE_DELETELINK = 'delete_link'; 39 public static $PAGE_DELETELINK = 'delete_link';
39 40
41 public static $PAGE_CHANGE_VISIBILITY = 'change_visibility';
42
40 public static $PAGE_PINLINK = 'pin'; 43 public static $PAGE_PINLINK = 'pin';
41 44
42 public static $PAGE_EXPORT = 'export'; 45 public static $PAGE_EXPORT = 'export';
@@ -75,43 +78,43 @@ class Router
75 return self::$PAGE_LINKLIST; 78 return self::$PAGE_LINKLIST;
76 } 79 }
77 80
78 if (startsWith($query, 'do='. self::$PAGE_LOGIN) && $loggedIn === false) { 81 if (startsWith($query, 'do=' . self::$PAGE_LOGIN) && $loggedIn === false) {
79 return self::$PAGE_LOGIN; 82 return self::$PAGE_LOGIN;
80 } 83 }
81 84
82 if (startsWith($query, 'do='. self::$PAGE_PICWALL)) { 85 if (startsWith($query, 'do=' . self::$PAGE_PICWALL)) {
83 return self::$PAGE_PICWALL; 86 return self::$PAGE_PICWALL;
84 } 87 }
85 88
86 if (startsWith($query, 'do='. self::$PAGE_TAGCLOUD)) { 89 if (startsWith($query, 'do=' . self::$PAGE_TAGCLOUD)) {
87 return self::$PAGE_TAGCLOUD; 90 return self::$PAGE_TAGCLOUD;
88 } 91 }
89 92
90 if (startsWith($query, 'do='. self::$PAGE_TAGLIST)) { 93 if (startsWith($query, 'do=' . self::$PAGE_TAGLIST)) {
91 return self::$PAGE_TAGLIST; 94 return self::$PAGE_TAGLIST;
92 } 95 }
93 96
94 if (startsWith($query, 'do='. self::$PAGE_OPENSEARCH)) { 97 if (startsWith($query, 'do=' . self::$PAGE_OPENSEARCH)) {
95 return self::$PAGE_OPENSEARCH; 98 return self::$PAGE_OPENSEARCH;
96 } 99 }
97 100
98 if (startsWith($query, 'do='. self::$PAGE_DAILY)) { 101 if (startsWith($query, 'do=' . self::$PAGE_DAILY)) {
99 return self::$PAGE_DAILY; 102 return self::$PAGE_DAILY;
100 } 103 }
101 104
102 if (startsWith($query, 'do='. self::$PAGE_FEED_ATOM)) { 105 if (startsWith($query, 'do=' . self::$PAGE_FEED_ATOM)) {
103 return self::$PAGE_FEED_ATOM; 106 return self::$PAGE_FEED_ATOM;
104 } 107 }
105 108
106 if (startsWith($query, 'do='. self::$PAGE_FEED_RSS)) { 109 if (startsWith($query, 'do=' . self::$PAGE_FEED_RSS)) {
107 return self::$PAGE_FEED_RSS; 110 return self::$PAGE_FEED_RSS;
108 } 111 }
109 112
110 if (startsWith($query, 'do='. self::$PAGE_THUMBS_UPDATE)) { 113 if (startsWith($query, 'do=' . self::$PAGE_THUMBS_UPDATE)) {
111 return self::$PAGE_THUMBS_UPDATE; 114 return self::$PAGE_THUMBS_UPDATE;
112 } 115 }
113 116
114 if (startsWith($query, 'do='. self::$AJAX_THUMB_UPDATE)) { 117 if (startsWith($query, 'do=' . self::$AJAX_THUMB_UPDATE)) {
115 return self::$AJAX_THUMB_UPDATE; 118 return self::$AJAX_THUMB_UPDATE;
116 } 119 }
117 120
@@ -120,23 +123,23 @@ class Router
120 return self::$PAGE_LINKLIST; 123 return self::$PAGE_LINKLIST;
121 } 124 }
122 125
123 if (startsWith($query, 'do='. self::$PAGE_TOOLS)) { 126 if (startsWith($query, 'do=' . self::$PAGE_TOOLS)) {
124 return self::$PAGE_TOOLS; 127 return self::$PAGE_TOOLS;
125 } 128 }
126 129
127 if (startsWith($query, 'do='. self::$PAGE_CHANGEPASSWORD)) { 130 if (startsWith($query, 'do=' . self::$PAGE_CHANGEPASSWORD)) {
128 return self::$PAGE_CHANGEPASSWORD; 131 return self::$PAGE_CHANGEPASSWORD;
129 } 132 }
130 133
131 if (startsWith($query, 'do='. self::$PAGE_CONFIGURE)) { 134 if (startsWith($query, 'do=' . self::$PAGE_CONFIGURE)) {
132 return self::$PAGE_CONFIGURE; 135 return self::$PAGE_CONFIGURE;
133 } 136 }
134 137
135 if (startsWith($query, 'do='. self::$PAGE_CHANGETAG)) { 138 if (startsWith($query, 'do=' . self::$PAGE_CHANGETAG)) {
136 return self::$PAGE_CHANGETAG; 139 return self::$PAGE_CHANGETAG;
137 } 140 }
138 141
139 if (startsWith($query, 'do='. self::$PAGE_ADDLINK)) { 142 if (startsWith($query, 'do=' . self::$PAGE_ADDLINK)) {
140 return self::$PAGE_ADDLINK; 143 return self::$PAGE_ADDLINK;
141 } 144 }
142 145
@@ -148,27 +151,31 @@ class Router
148 return self::$PAGE_DELETELINK; 151 return self::$PAGE_DELETELINK;
149 } 152 }
150 153
151 if (startsWith($query, 'do='. self::$PAGE_PINLINK)) { 154 if (isset($get[self::$PAGE_CHANGE_VISIBILITY])) {
155 return self::$PAGE_CHANGE_VISIBILITY;
156 }
157
158 if (startsWith($query, 'do=' . self::$PAGE_PINLINK)) {
152 return self::$PAGE_PINLINK; 159 return self::$PAGE_PINLINK;
153 } 160 }
154 161
155 if (startsWith($query, 'do='. self::$PAGE_EXPORT)) { 162 if (startsWith($query, 'do=' . self::$PAGE_EXPORT)) {
156 return self::$PAGE_EXPORT; 163 return self::$PAGE_EXPORT;
157 } 164 }
158 165
159 if (startsWith($query, 'do='. self::$PAGE_IMPORT)) { 166 if (startsWith($query, 'do=' . self::$PAGE_IMPORT)) {
160 return self::$PAGE_IMPORT; 167 return self::$PAGE_IMPORT;
161 } 168 }
162 169
163 if (startsWith($query, 'do='. self::$PAGE_PLUGINSADMIN)) { 170 if (startsWith($query, 'do=' . self::$PAGE_PLUGINSADMIN)) {
164 return self::$PAGE_PLUGINSADMIN; 171 return self::$PAGE_PLUGINSADMIN;
165 } 172 }
166 173
167 if (startsWith($query, 'do='. self::$PAGE_SAVE_PLUGINSADMIN)) { 174 if (startsWith($query, 'do=' . self::$PAGE_SAVE_PLUGINSADMIN)) {
168 return self::$PAGE_SAVE_PLUGINSADMIN; 175 return self::$PAGE_SAVE_PLUGINSADMIN;
169 } 176 }
170 177
171 if (startsWith($query, 'do='. self::$GET_TOKEN)) { 178 if (startsWith($query, 'do=' . self::$GET_TOKEN)) {
172 return self::$GET_TOKEN; 179 return self::$GET_TOKEN;
173 } 180 }
174 181