@@ -27,12 +27,12 @@ |
||
27 | 27 | |
28 | 28 | protected function check_for_special_redirect($uri) |
29 | 29 | { |
30 | - if(preg_match('@^/piece/([a-z0-9-]+)(/?)$@', $uri, $matches)) |
|
30 | + if (preg_match('@^/piece/([a-z0-9-]+)(/?)$@', $uri, $matches)) |
|
31 | 31 | { |
32 | 32 | Loader::load('collector', 'portfolio/PortfolioCollector'); |
33 | 33 | $piece = PortfolioCollector::getPieceByURI($matches[1]); |
34 | 34 | |
35 | - if($piece === null) |
|
35 | + if ($piece === null) |
|
36 | 36 | { |
37 | 37 | Loader::loadNew('controller', '/Error404Controller') |
38 | 38 | ->activate(); |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
97 | 97 | $redirect_uri .= '/'; |
98 | 98 | |
99 | - if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
|
100 | - $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
|
101 | - } |
|
99 | + if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
|
100 | + $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
|
101 | + } |
|
102 | 102 | |
103 | 103 | if($redirect_uri == URLDecode::getURI()) |
104 | 104 | return; |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $image = new ImageOld($file); |
132 | - if(!$image->isValid()) { |
|
133 | - Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
132 | + if(!$image->isValid()) { |
|
133 | + Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
134 | 134 | exit(); |
135 | 135 | } |
136 | 136 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | URLDecode::getExtension() != 'jpg' && |
202 | 202 | URLDecode::getExtension() != 'png' && |
203 | 203 | URLDecode::getExtension() != 'ico' && |
204 | - strstr(URLDecode::getURI(), '#') === false); |
|
204 | + strstr(URLDecode::getURI(), '#') === false); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | } |
@@ -19,26 +19,26 @@ discard block |
||
19 | 19 | |
20 | 20 | private static function get_router_name() |
21 | 21 | { |
22 | - if(Request::isAJAX()) |
|
22 | + if (Request::isAJAX()) |
|
23 | 23 | return 'AJAXRouter'; |
24 | - if(URLDecode::getURI() == '/robots.txt') |
|
24 | + if (URLDecode::getURI() == '/robots.txt') |
|
25 | 25 | return 'RobotRouter'; |
26 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
26 | + if (URLDecode::getURI() == '/sitemap.xml') |
|
27 | 27 | return 'SitemapRouter'; |
28 | - if(URLDecode::getURI() == '/rss/') |
|
28 | + if (URLDecode::getURI() == '/rss/') |
|
29 | 29 | return 'RSSRouter'; |
30 | - if(URLDecode::getExtension() == 'css') |
|
30 | + if (URLDecode::getExtension() == 'css') |
|
31 | 31 | return 'StyleRouter'; |
32 | - if(URLDecode::getExtension() == 'js') |
|
32 | + if (URLDecode::getExtension() == 'js') |
|
33 | 33 | return 'ScriptRouter'; |
34 | - if(URLDecode::getExtension() == 'ico') |
|
34 | + if (URLDecode::getExtension() == 'ico') |
|
35 | 35 | return 'ImageRouter'; |
36 | - if(URLDecode::getExtension() == 'jpg') |
|
36 | + if (URLDecode::getExtension() == 'jpg') |
|
37 | 37 | return 'ImageRouter'; |
38 | - if(URLDecode::getExtension() == 'png') |
|
38 | + if (URLDecode::getExtension() == 'png') |
|
39 | 39 | return 'ImageRouter'; |
40 | 40 | |
41 | - switch(URLDecode::getSite()) |
|
41 | + switch (URLDecode::getSite()) |
|
42 | 42 | { |
43 | 43 | case 'ajax' : |
44 | 44 | return 'AjaxRouter'; |
@@ -86,37 +86,37 @@ discard block |
||
86 | 86 | |
87 | 87 | final protected function check_for_redirect($redirect_uri) |
88 | 88 | { |
89 | - foreach($this->get_redirect_array() as $check) |
|
89 | + foreach ($this->get_redirect_array() as $check) |
|
90 | 90 | { |
91 | 91 | $redirect_uri = preg_replace($check->pattern, $check->replace, $redirect_uri); |
92 | 92 | } |
93 | 93 | |
94 | 94 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
95 | 95 | |
96 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
96 | + if ($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
97 | 97 | $redirect_uri .= '/'; |
98 | 98 | |
99 | 99 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
100 | 100 | $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
101 | 101 | } |
102 | 102 | |
103 | - if($redirect_uri == URLDecode::getURI()) |
|
103 | + if ($redirect_uri == URLDecode::getURI()) |
|
104 | 104 | return; |
105 | 105 | |
106 | 106 | $controller_check = $redirect_uri; |
107 | - if(substr($redirect_uri, 0, 4) == 'http') |
|
107 | + if (substr($redirect_uri, 0, 4) == 'http') |
|
108 | 108 | $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
109 | 109 | |
110 | 110 | $controller = $this->get_controller($controller_check); |
111 | - if($controller == '/Error404Controller') |
|
111 | + if ($controller == '/Error404Controller') |
|
112 | 112 | { |
113 | 113 | Loader::loadNew('controller', '/Error404Controller') |
114 | 114 | ->activate(); |
115 | 115 | exit; |
116 | 116 | } |
117 | 117 | |
118 | - if($this->get_primary_folder() == 'images') { |
|
119 | - $file = $controller_check;//URLDecode::getURI(); |
|
118 | + if ($this->get_primary_folder() == 'images') { |
|
119 | + $file = $controller_check; //URLDecode::getURI(); |
|
120 | 120 | |
121 | 121 | if ( |
122 | 122 | URLDecode::getSite() == 'images' || |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $image = new ImageOld($file); |
132 | - if(!$image->isValid()) { |
|
132 | + if (!$image->isValid()) { |
|
133 | 133 | Loader::loadNew('controller', '/Error404Controller')->activate(); |
134 | 134 | exit(); |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - if(substr($redirect_uri, 0, 4) != 'http') |
|
138 | + if (substr($redirect_uri, 0, 4) != 'http') |
|
139 | 139 | { |
140 | 140 | $redirect_uri = substr($redirect_uri, 1); |
141 | 141 | $redirect_uri = URLDecode::getBase() . $redirect_uri; |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | |
153 | 153 | final private function get_controller($uri) |
154 | 154 | { |
155 | - foreach($this->get_direct_array() as $check) |
|
155 | + foreach ($this->get_direct_array() as $check) |
|
156 | 156 | { |
157 | - if($uri == $check->match) |
|
157 | + if ($uri == $check->match) |
|
158 | 158 | return "{$this->get_primary_folder()}/{$check->controller}"; |
159 | 159 | |
160 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
160 | + if (preg_match("@^{$check->match}$@", $uri)) |
|
161 | 161 | return "{$this->get_primary_folder()}/{$check->controller}"; |
162 | 162 | } |
163 | 163 | |
@@ -166,19 +166,19 @@ discard block |
||
166 | 166 | |
167 | 167 | final private function get_primary_folder() |
168 | 168 | { |
169 | - if(Request::isAjax()) |
|
169 | + if (Request::isAjax()) |
|
170 | 170 | return 'ajax'; |
171 | - if(URLDecode::getURI() == '/robots.txt') |
|
171 | + if (URLDecode::getURI() == '/robots.txt') |
|
172 | 172 | return 'robot'; |
173 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
173 | + if (URLDecode::getURI() == '/sitemap.xml') |
|
174 | 174 | return 'sitemap'; |
175 | - if(URLDecode::getURI() == '/rss/') |
|
175 | + if (URLDecode::getURI() == '/rss/') |
|
176 | 176 | return 'rss'; |
177 | - if(URLDecode::getExtension() == 'css') |
|
177 | + if (URLDecode::getExtension() == 'css') |
|
178 | 178 | return 'styles'; |
179 | - if(URLDecode::getExtension() == 'js') |
|
179 | + if (URLDecode::getExtension() == 'js') |
|
180 | 180 | return 'scripts'; |
181 | - if( |
|
181 | + if ( |
|
182 | 182 | URLDecode::getExtension() == 'jpg' || |
183 | 183 | URLDecode::getExtension() == 'ico' || |
184 | 184 | URLDecode::getExtension() == 'png') |
@@ -19,24 +19,33 @@ discard block |
||
19 | 19 | |
20 | 20 | private static function get_router_name() |
21 | 21 | { |
22 | - if(Request::isAJAX()) |
|
23 | - return 'AJAXRouter'; |
|
24 | - if(URLDecode::getURI() == '/robots.txt') |
|
25 | - return 'RobotRouter'; |
|
26 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
27 | - return 'SitemapRouter'; |
|
28 | - if(URLDecode::getURI() == '/rss/') |
|
29 | - return 'RSSRouter'; |
|
30 | - if(URLDecode::getExtension() == 'css') |
|
31 | - return 'StyleRouter'; |
|
32 | - if(URLDecode::getExtension() == 'js') |
|
33 | - return 'ScriptRouter'; |
|
34 | - if(URLDecode::getExtension() == 'ico') |
|
35 | - return 'ImageRouter'; |
|
36 | - if(URLDecode::getExtension() == 'jpg') |
|
37 | - return 'ImageRouter'; |
|
38 | - if(URLDecode::getExtension() == 'png') |
|
39 | - return 'ImageRouter'; |
|
22 | + if(Request::isAJAX()) { |
|
23 | + return 'AJAXRouter'; |
|
24 | + } |
|
25 | + if(URLDecode::getURI() == '/robots.txt') { |
|
26 | + return 'RobotRouter'; |
|
27 | + } |
|
28 | + if(URLDecode::getURI() == '/sitemap.xml') { |
|
29 | + return 'SitemapRouter'; |
|
30 | + } |
|
31 | + if(URLDecode::getURI() == '/rss/') { |
|
32 | + return 'RSSRouter'; |
|
33 | + } |
|
34 | + if(URLDecode::getExtension() == 'css') { |
|
35 | + return 'StyleRouter'; |
|
36 | + } |
|
37 | + if(URLDecode::getExtension() == 'js') { |
|
38 | + return 'ScriptRouter'; |
|
39 | + } |
|
40 | + if(URLDecode::getExtension() == 'ico') { |
|
41 | + return 'ImageRouter'; |
|
42 | + } |
|
43 | + if(URLDecode::getExtension() == 'jpg') { |
|
44 | + return 'ImageRouter'; |
|
45 | + } |
|
46 | + if(URLDecode::getExtension() == 'png') { |
|
47 | + return 'ImageRouter'; |
|
48 | + } |
|
40 | 49 | |
41 | 50 | switch(URLDecode::getSite()) |
42 | 51 | { |
@@ -93,19 +102,22 @@ discard block |
||
93 | 102 | |
94 | 103 | $redirect_uri = $this->check_for_special_redirect($redirect_uri); |
95 | 104 | |
96 | - if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') |
|
97 | - $redirect_uri .= '/'; |
|
105 | + if($this->requires_trailing_slash() && substr($redirect_uri, -1) != '/') { |
|
106 | + $redirect_uri .= '/'; |
|
107 | + } |
|
98 | 108 | |
99 | 109 | if (URLDecode::getHost() == 'waterfalls.jacobemerick.com') { |
100 | 110 | $redirect_uri = 'http://' . (!Loader::isLive() ? 'dev' : 'www') . '.waterfallsofthekeweenaw.com' . $redirect_uri; |
101 | 111 | } |
102 | 112 | |
103 | - if($redirect_uri == URLDecode::getURI()) |
|
104 | - return; |
|
113 | + if($redirect_uri == URLDecode::getURI()) { |
|
114 | + return; |
|
115 | + } |
|
105 | 116 | |
106 | 117 | $controller_check = $redirect_uri; |
107 | - if(substr($redirect_uri, 0, 4) == 'http') |
|
108 | - $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
|
118 | + if(substr($redirect_uri, 0, 4) == 'http') { |
|
119 | + $controller_check = preg_replace('@^http://([a-z\.]+)@', '', $redirect_uri); |
|
120 | + } |
|
109 | 121 | |
110 | 122 | $controller = $this->get_controller($controller_check); |
111 | 123 | if($controller == '/Error404Controller') |
@@ -154,11 +166,13 @@ discard block |
||
154 | 166 | { |
155 | 167 | foreach($this->get_direct_array() as $check) |
156 | 168 | { |
157 | - if($uri == $check->match) |
|
158 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
169 | + if($uri == $check->match) { |
|
170 | + return "{$this->get_primary_folder()}/{$check->controller}"; |
|
171 | + } |
|
159 | 172 | |
160 | - if(preg_match("@^{$check->match}$@", $uri)) |
|
161 | - return "{$this->get_primary_folder()}/{$check->controller}"; |
|
173 | + if(preg_match("@^{$check->match}$@", $uri)) { |
|
174 | + return "{$this->get_primary_folder()}/{$check->controller}"; |
|
175 | + } |
|
162 | 176 | } |
163 | 177 | |
164 | 178 | return '/Error404Controller'; |
@@ -166,23 +180,30 @@ discard block |
||
166 | 180 | |
167 | 181 | final private function get_primary_folder() |
168 | 182 | { |
169 | - if(Request::isAjax()) |
|
170 | - return 'ajax'; |
|
171 | - if(URLDecode::getURI() == '/robots.txt') |
|
172 | - return 'robot'; |
|
173 | - if(URLDecode::getURI() == '/sitemap.xml') |
|
174 | - return 'sitemap'; |
|
175 | - if(URLDecode::getURI() == '/rss/') |
|
176 | - return 'rss'; |
|
177 | - if(URLDecode::getExtension() == 'css') |
|
178 | - return 'styles'; |
|
179 | - if(URLDecode::getExtension() == 'js') |
|
180 | - return 'scripts'; |
|
183 | + if(Request::isAjax()) { |
|
184 | + return 'ajax'; |
|
185 | + } |
|
186 | + if(URLDecode::getURI() == '/robots.txt') { |
|
187 | + return 'robot'; |
|
188 | + } |
|
189 | + if(URLDecode::getURI() == '/sitemap.xml') { |
|
190 | + return 'sitemap'; |
|
191 | + } |
|
192 | + if(URLDecode::getURI() == '/rss/') { |
|
193 | + return 'rss'; |
|
194 | + } |
|
195 | + if(URLDecode::getExtension() == 'css') { |
|
196 | + return 'styles'; |
|
197 | + } |
|
198 | + if(URLDecode::getExtension() == 'js') { |
|
199 | + return 'scripts'; |
|
200 | + } |
|
181 | 201 | if( |
182 | 202 | URLDecode::getExtension() == 'jpg' || |
183 | 203 | URLDecode::getExtension() == 'ico' || |
184 | - URLDecode::getExtension() == 'png') |
|
185 | - return 'images'; |
|
204 | + URLDecode::getExtension() == 'png') { |
|
205 | + return 'images'; |
|
206 | + } |
|
186 | 207 | |
187 | 208 | return URLDecode::getSite(); |
188 | 209 | } |
@@ -26,6 +26,6 @@ |
||
26 | 26 | ) |
27 | 27 | ); |
28 | 28 | |
29 | -Router::route($redirect,$direct); |
|
29 | +Router::route($redirect, $direct); |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | \ No newline at end of file |
@@ -16,9 +16,9 @@ |
||
16 | 16 | protected function get_direct_array() |
17 | 17 | { |
18 | 18 | $site = URLDecode::getSite(); |
19 | - if ($site == 'waterfalls') { |
|
20 | - $site = 'waterfall'; |
|
21 | - } |
|
19 | + if ($site == 'waterfalls') { |
|
20 | + $site = 'waterfall'; |
|
21 | + } |
|
22 | 22 | $site = ucwords($site); |
23 | 23 | |
24 | 24 | return array( |
@@ -153,9 +153,9 @@ |
||
153 | 153 | return self::run_query($query); |
154 | 154 | } |
155 | 155 | |
156 | - public static function getParentWatercourse($watercourse) |
|
157 | - { |
|
158 | - } |
|
156 | + public static function getParentWatercourse($watercourse) |
|
157 | + { |
|
158 | + } |
|
159 | 159 | |
160 | 160 | public static function getLogCountForWatercourse($watercourse) |
161 | 161 | { |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function set_response($message, $type = 'internal') |
30 | 30 | { |
31 | - switch($type) |
|
31 | + switch ($type) |
|
32 | 32 | { |
33 | 33 | case 'internal' : |
34 | 34 | $this->response['internal'] = $message; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $post_result = PostCollector::getMainList(250); |
28 | 28 | |
29 | - foreach($post_result as $post) |
|
29 | + foreach ($post_result as $post) |
|
30 | 30 | { |
31 | 31 | $this->addItem( |
32 | 32 | $post->title, |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | private function get_title() |
48 | 48 | { |
49 | - switch($this->tag) |
|
49 | + switch ($this->tag) |
|
50 | 50 | { |
51 | 51 | case 'blog' : |
52 | 52 | return 'Jacob has a Blog'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | private function get_description() |
73 | 73 | { |
74 | - switch($this->tag) |
|
74 | + switch ($this->tag) |
|
75 | 75 | { |
76 | 76 | case 'blog' : |
77 | 77 | return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | protected function get_page_number() |
98 | 98 | { |
99 | 99 | $page = URLDecode::getPiece(3); |
100 | - if(isset($page) && is_numeric($page)) |
|
100 | + if (isset($page) && is_numeric($page)) |
|
101 | 101 | return $page; |
102 | 102 | return 1; |
103 | 103 | } |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | |
118 | 118 | protected function get_list_next_link() |
119 | 119 | { |
120 | - if($this->page == 1) |
|
120 | + if ($this->page == 1) |
|
121 | 121 | return; |
122 | - if($this->page == 2) |
|
122 | + if ($this->page == 2) |
|
123 | 123 | return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
124 | 124 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function get_list_prev_link() |
128 | 128 | { |
129 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
129 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
130 | 130 | return; |
131 | 131 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
132 | 132 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | private $total_post_count; |
135 | 135 | protected function get_total_post_count() |
136 | 136 | { |
137 | - if(!isset($this->total_post_count)) |
|
137 | + if (!isset($this->total_post_count)) |
|
138 | 138 | $this->total_post_count = ActivityCollector::getCountForTag($this->tag); |
139 | 139 | return $this->total_post_count; |
140 | 140 | } |
@@ -97,8 +97,9 @@ discard block |
||
97 | 97 | protected function get_page_number() |
98 | 98 | { |
99 | 99 | $page = URLDecode::getPiece(3); |
100 | - if(isset($page) && is_numeric($page)) |
|
101 | - return $page; |
|
100 | + if(isset($page) && is_numeric($page)) { |
|
101 | + return $page; |
|
102 | + } |
|
102 | 103 | return 1; |
103 | 104 | } |
104 | 105 | |
@@ -117,25 +118,29 @@ discard block |
||
117 | 118 | |
118 | 119 | protected function get_list_next_link() |
119 | 120 | { |
120 | - if($this->page == 1) |
|
121 | - return; |
|
122 | - if($this->page == 2) |
|
123 | - return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
121 | + if($this->page == 1) { |
|
122 | + return; |
|
123 | + } |
|
124 | + if($this->page == 2) { |
|
125 | + return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
126 | + } |
|
124 | 127 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
125 | 128 | } |
126 | 129 | |
127 | 130 | protected function get_list_prev_link() |
128 | 131 | { |
129 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
130 | - return; |
|
132 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) { |
|
133 | + return; |
|
134 | + } |
|
131 | 135 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
132 | 136 | } |
133 | 137 | |
134 | 138 | private $total_post_count; |
135 | 139 | protected function get_total_post_count() |
136 | 140 | { |
137 | - if(!isset($this->total_post_count)) |
|
138 | - $this->total_post_count = $this->postRepository->getPostsByTypeCount($this->tag); |
|
141 | + if(!isset($this->total_post_count)) { |
|
142 | + $this->total_post_count = $this->postRepository->getPostsByTypeCount($this->tag); |
|
143 | + } |
|
139 | 144 | return $this->total_post_count; |
140 | 145 | } |
141 | 146 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | protected function get_page_number() |
39 | 39 | { |
40 | 40 | $page = URLDecode::getPiece(2); |
41 | - if(isset($page) && is_numeric($page)) |
|
41 | + if (isset($page) && is_numeric($page)) |
|
42 | 42 | return $page; |
43 | 43 | return 1; |
44 | 44 | } |
@@ -58,16 +58,16 @@ discard block |
||
58 | 58 | |
59 | 59 | protected function get_list_next_link() |
60 | 60 | { |
61 | - if($this->page == 1) |
|
61 | + if ($this->page == 1) |
|
62 | 62 | return; |
63 | - if($this->page == 2) |
|
63 | + if ($this->page == 2) |
|
64 | 64 | return Loader::getRootUrl('lifestream'); |
65 | 65 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/'; |
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function get_list_prev_link() |
69 | 69 | { |
70 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
70 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
71 | 71 | return; |
72 | 72 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/'; |
73 | 73 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | private $total_post_count; |
76 | 76 | protected function get_total_post_count() |
77 | 77 | { |
78 | - if(!isset($this->total_post_count)) |
|
78 | + if (!isset($this->total_post_count)) |
|
79 | 79 | $this->total_post_count = ActivityCollector::getCount(); |
80 | 80 | return $this->total_post_count; |
81 | 81 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | protected function get_list_results() |
47 | 47 | { |
48 | - return $this->postRepository->getPosts(self::$POSTS_PER_PAGE, $this->offset); |
|
48 | + return $this->postRepository->getPosts(self::$POSTS_PER_PAGE, $this->offset); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function get_list_description() |
@@ -38,8 +38,9 @@ discard block |
||
38 | 38 | protected function get_page_number() |
39 | 39 | { |
40 | 40 | $page = URLDecode::getPiece(2); |
41 | - if(isset($page) && is_numeric($page)) |
|
42 | - return $page; |
|
41 | + if(isset($page) && is_numeric($page)) { |
|
42 | + return $page; |
|
43 | + } |
|
43 | 44 | return 1; |
44 | 45 | } |
45 | 46 | |
@@ -58,25 +59,29 @@ discard block |
||
58 | 59 | |
59 | 60 | protected function get_list_next_link() |
60 | 61 | { |
61 | - if($this->page == 1) |
|
62 | - return; |
|
63 | - if($this->page == 2) |
|
64 | - return Loader::getRootUrl('lifestream'); |
|
62 | + if($this->page == 1) { |
|
63 | + return; |
|
64 | + } |
|
65 | + if($this->page == 2) { |
|
66 | + return Loader::getRootUrl('lifestream'); |
|
67 | + } |
|
65 | 68 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/'; |
66 | 69 | } |
67 | 70 | |
68 | 71 | protected function get_list_prev_link() |
69 | 72 | { |
70 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
71 | - return; |
|
73 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) { |
|
74 | + return; |
|
75 | + } |
|
72 | 76 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/'; |
73 | 77 | } |
74 | 78 | |
75 | 79 | private $total_post_count; |
76 | 80 | protected function get_total_post_count() |
77 | 81 | { |
78 | - if(!isset($this->total_post_count)) |
|
79 | - $this->total_post_count = $this->postRepository->getPostsCount(); |
|
82 | + if(!isset($this->total_post_count)) { |
|
83 | + $this->total_post_count = $this->postRepository->getPostsCount(); |
|
84 | + } |
|
80 | 85 | return $this->total_post_count; |
81 | 86 | } |
82 | 87 |