construct_custom_fields() now uses the new template system
[bugdar.git] / includes / pagination.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2005-2008 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 require_once ISSO . '/Pagination.php';
23
24 /**
25 * Pagination
26 *
27 * Subclass of BSPagination
28 *
29 * @author rsesek
30 * @copyright Copyright (c)2005 - 2008, Blue Static
31 * @package Bugdar
32 *
33 */
34 class Pagination extends BSPagination
35 {
36 /**
37 * Sets the variables used by the system
38 */
39 protected function _setVariables()
40 {
41 $this->page = BSApp::$input->inputClean('p', TYPE_UINT);
42 $this->defaultperpage = bugdar::$options['defaultpp'];
43 $this->perpage = BSApp::$input->inputClean('pp', TYPE_UINT);
44 $this->pagelinks = bugdar::$options['pagelinks'];
45 $this->maxperpage = bugdar::$options['maxpp'];
46 }
47
48 /**
49 * Processes an individual page link
50 */
51 protected function _bitProcessor($baselink, $isCurrent, $pagenumber)
52 {
53 $template = new BSTemplate('pagenav_bit');
54 $template->vars = array(
55 'baselink' => $baselink,
56 'nolink' => $isCurrent,
57 'number' => $pagenumber
58 );
59 return $template->evaluate()->getTemplate();
60 }
61
62 /**
63 * Generates the entire page navigation HTML
64 */
65 protected function _navigationProcessor($baselink, $next, $prev, $show, $bits)
66 {
67 $template = new BSTemplate('pagenav');
68 $template->vars = array(
69 'baselink' => $baselink,
70 'nextpage' => $next,
71 'prevpage' => $prev,
72 'show' => $show,
73 'pagebits' => $bits,
74 'paginator' => $this
75 );
76 return $template->evaluate()->getTemplate();
77 }
78 }
79
80 ?>