@@ -260,8 +260,8 @@ |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
263 | - * @param $url |
|
264 | - * @param $requestName |
|
263 | + * @param string $url |
|
264 | + * @param string $requestName |
|
265 | 265 | * @param $params |
266 | 266 | * @return array|string |
267 | 267 | */ |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('MODX_BASE_PATH')) { |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | 3 | die('HACK???'); |
4 | 4 | } |
5 | 5 | |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | $requestName = $this->getRequestName('page'); |
60 | 60 | if ( |
61 | 61 | isset($_GET[$requestName]) |
62 | - && !$this->DocLister->getCFGDef('noRedirect', 0) |
|
62 | + && ! $this->DocLister->getCFGDef('noRedirect', 0) |
|
63 | 63 | ) { |
64 | - if ((!$this->reverse && (intval($_GET[$requestName]) <= 1 || intval($_GET[$requestName]) > $pages)) || ($this->reverse && (intval($_GET[$requestName]) >= $pages || intval($_GET[$requestName]) < 1))) { |
|
64 | + if (( ! $this->reverse && (intval($_GET[$requestName]) <= 1 || intval($_GET[$requestName]) > $pages)) || ($this->reverse && (intval($_GET[$requestName]) >= $pages || intval($_GET[$requestName]) < 1))) { |
|
65 | 65 | $this->modx->sendRedirect($this->getUrl()); |
66 | 66 | } |
67 | 67 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $this->DocLister->toPlaceholders($pages, 1, "totalPages"); // [+totalPages+] - total page. |
96 | 96 | |
97 | 97 | $limit = $this->DocLister->getCFGDef('maxDocs', 0); |
98 | - if ($limit > 0 && !$this->reverse) { |
|
98 | + if ($limit > 0 && ! $this->reverse) { |
|
99 | 99 | switch ($paginate) { |
100 | 100 | case 'offset': |
101 | 101 | $offset = $start; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | switch (true) { |
214 | 214 | case ($mode == 'offset' && $this->totalPage() > 1): |
215 | 215 | $display = $this->DocLister->getCFGDef('display', 0); |
216 | - $offset = $this->reverse && $this->currentPage() > 1? $this->totalPage() * $display - $this->count : 0; |
|
216 | + $offset = $this->reverse && $this->currentPage() > 1 ? $this->totalPage() * $display - $this->count : 0; |
|
217 | 217 | $p->setMode('offset', array( |
218 | 218 | 'display' => $display, |
219 | 219 | 'offset' => $offset |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $q = http_build_query(array_merge($params, array($this->getRequestName($requestName) => null))); |
272 | 272 | $url = explode("?", $url, 2); |
273 | 273 | $url = $url[0]; |
274 | - if (!empty($q)) { |
|
274 | + if ( ! empty($q)) { |
|
275 | 275 | $url .= "?" . $q; |
276 | 276 | } |
277 | 277 | } |
@@ -3,15 +3,15 @@ discard block |
||
3 | 3 | /** |
4 | 4 | * Class DLpaginate |
5 | 5 | */ |
6 | -class DLpaginateReversed extends DLpaginate |
|
7 | -{ |
|
6 | +class DLpaginateReversed extends DLpaginate |
|
7 | +{ |
|
8 | 8 | /** |
9 | 9 | * @param $page |
10 | 10 | * @return int|mixed |
11 | 11 | */ |
12 | - protected function getPageQuery($page) |
|
13 | - { |
|
14 | - switch ($this->mode) { |
|
12 | + protected function getPageQuery($page) |
|
13 | + { |
|
14 | + switch ($this->mode) { |
|
15 | 15 | case 'offset': |
16 | 16 | $display = isset($this->modeConfig['display']) ? $this->modeConfig['display'] : 0; |
17 | 17 | $out = $display * ($this->total_pages - $page) - $this->modeConfig['offset']; |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | * @param $num |
32 | 32 | * @return mixed |
33 | 33 | */ |
34 | - protected function renderItemTPL($tpl, $num) |
|
35 | - { |
|
34 | + protected function renderItemTPL($tpl, $num) |
|
35 | + { |
|
36 | 36 | $_num = $this->total_pages + 1 - $num; |
37 | 37 | return str_replace(array('[+num+]', '[+link+]'), array($_num, $this->get_pagenum_link($_num)), $tpl); |
38 | 38 | } |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | * @param $id |
42 | 42 | * @return mixed|string |
43 | 43 | */ |
44 | - public function get_pagenum_link($id) |
|
45 | - { |
|
44 | + public function get_pagenum_link($id) |
|
45 | + { |
|
46 | 46 | $flag = (strpos($this->target, '?') === false); |
47 | 47 | $value = $this->getPageQuery($id); |
48 | - if ($flag && !empty($this->urlF)) { |
|
48 | + if ($flag && !empty($this->urlF)) { |
|
49 | 49 | $out = str_replace($this->urlF, $value, $this->target); |
50 | - } else { |
|
50 | + } else { |
|
51 | 51 | $out = $this->target; |
52 | - if ($id > 0 && $id < $this->total_pages) { |
|
52 | + if ($id > 0 && $id < $this->total_pages) { |
|
53 | 53 | $out .= ($flag ? "?" : "&") . $this->parameterName . "=" . $value; |
54 | 54 | } |
55 | 55 | } |