1 | <?php |
||
4 | class Pagination { |
||
5 | public static $current; |
||
6 | protected $queryString = array(); |
||
7 | |||
8 | protected static $page; |
||
9 | protected static $pageURL; |
||
10 | protected static $lastpage; |
||
11 | |||
12 | /** |
||
13 | * Returns paging buttons for the number of records |
||
14 | * @param int $records The total number of records |
||
15 | * @param string $pageURL The URL of the page you are creating the paging for |
||
16 | * @param int $start The start number for the results |
||
17 | * @param array $additional Any additional get values to include in the URL |
||
18 | * @param int $maxshown The number of records that are shown on each page |
||
19 | * @param int $numpagesshown The number of pagination buttons to display |
||
20 | * @param boolean $arrows If you want arrows to display before and after for next and previous set to true (default) else set to false |
||
21 | * @return string Returns the pagination menu |
||
22 | */ |
||
23 | public static function paging($records, $pageURL, $start = 0, $additional = array(), $maxshown = 50, $numpagesshown = 11, $arrows = true) { |
||
41 | |||
42 | /** |
||
43 | * Build a link item with the given values |
||
44 | * @param string $link This should be any additional items to be included as part of the link |
||
45 | * @param mixed $page This should be the link test on the link normally set as numbers but may be anything like arrows or dots etc |
||
46 | * @param boolean $current If this is the current link item set this as true so the class is added to the link item |
||
47 | * @return string This will return the paging item as a string |
||
48 | */ |
||
49 | protected function buildLink($link, $page, $current = false){ |
||
52 | |||
53 | /** |
||
54 | * Builds the query string to add to the URL |
||
55 | * @param mixed $page If the page variable is set to a number will add the page number to the query string else will not add any additional items |
||
56 | * @return string The complete string will be returned to add to the link item |
||
57 | */ |
||
58 | protected function buildQueryString($page){ |
||
64 | |||
65 | /** |
||
66 | * Gets the current page |
||
67 | * @param int $records The total number of records |
||
68 | * @param int $maxshown The number of records that are shown on each page |
||
69 | * @param int $numpages The number of pagination buttons to display |
||
70 | * return void Nothing is returned |
||
71 | */ |
||
72 | protected static function getPage($records, $maxshown, $numpages) { |
||
83 | |||
84 | /** |
||
85 | * Returns the previous arrows as long as arrows is set to true and the page is not the first page |
||
86 | * @param boolean $arrows If you want to display previous arrows set to true else set to false |
||
87 | * @return string Any previous link arrows will be returned as a string |
||
88 | */ |
||
89 | protected function preLinks($arrows = true){ |
||
97 | |||
98 | /** |
||
99 | * Returns the next arrows as long as arrows is set to true and the page is not the last page |
||
100 | * @param boolean $arrows If you want to display next arrows set to true else set to false |
||
101 | * @return string Any next link arrows will be returned as a string |
||
102 | */ |
||
103 | protected function postLinks($arrows = true){ |
||
111 | } |
||
112 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.