From 9b41979da1da9303aff3bbdb0496a6e7b0584780 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 12 Oct 2006 05:03:52 +0000 Subject: [PATCH] Updated pagination --- pagination.php | 88 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/pagination.php b/pagination.php index 8189185..099981d 100644 --- a/pagination.php +++ b/pagination.php @@ -109,20 +109,6 @@ class Pagination */ var $defaultperpage = 20; - /** - * ISSO fields - * @var array - * @access private - */ - var $fields = array( - 'total' => array(REQ_YES, null, false), - 'pagelinks' => array(REQ_YES, null, false), - 'pagevar' => array(REQ_YES, null, false), - 'perpagevar' => array(REQ_YES, null, false), - 'maxperpage' => array(REQ_YES, null, true), - 'defaultperpage' => array(REQ_YES, null, true) - ); - // ################################################################### /** * Constructor @@ -143,33 +129,83 @@ class Pagination // ################################################################### /** - * Sets an ISSO field + * Sets total * * @access public * - * @param string Field name - * @param mixed Value of the field + * @param integer Total number */ - function set($name, $value) + function setTotal($total) { - $this->registry->do_set($name, $value, 'pagination'); + $this->total = $total; } // ################################################################### /** - * Gets an ISSO field + * Sets pagelinks * * @access public * - * @param string Field name + * @param integer Number of page links + */ + function setPageLinks($pagelinks) + { + $this->pagelinks = $pagelinks; + } + + // ################################################################### + /** + * Sets pagevar + * + * @access public * - * @return mixed Value of the field + * @param string Page variable */ - function get($fieldname) + function setPageVar($pagevar) { - return $this->registry->do_get($fieldname, 'pagination'); + $this->pagevar = $pagevar; } + // ################################################################### + /** + * Sets perpagevar + * + * @access public + * + * @param string Per-page variable + */ + function setPerPageVar($perpagevar) + { + $this->perpagevar = $perpagevar; + } + + // ################################################################### + /** + * Sets maxperpage + * + * @access public + * + * @param integer Maximum number per page + */ + function setMaxPerPage($maxperpage) + { + $this->maxperpage = $maxperpage; + } + + // ################################################################### + /** + * Sets defaultperpage + * + * @access public + * + * @param integer Total number + */ + function setDefaultPerPage($defaultperpage) + { + $this->defaultperpage = $defaultperpage; + } + + // ################################################################### /** * Takes the variables and splits up the pages * @@ -179,7 +215,7 @@ class Pagination { $this->page = $this->registry->input_clean($this->pagevar, TYPE_INT); $this->perpage = $this->registry->input_clean($this->perpagevar, TYPE_INT); - $this->pagelinks = $this->registry->input_clean($this->pagelinkx, TYPE_INT); + $this->pagelinks = $this->registry->input_clean($this->pagelinks, TYPE_INT); if ($this->page <= 0) { @@ -200,6 +236,7 @@ class Pagination $this->pagecount = ceil($this->total / $this->perpage); } + // ################################################################### /** * Returns the lower limit of the pages * @@ -243,6 +280,7 @@ class Pagination } } + // ################################################################### /** * Constructs the page navigator * -- 2.22.5