Changeset 468 for trunk/lib/PageNumbers.inc.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/lib/PageNumbers.inc.php
r396 r468 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 39 39 class PageNumbers { 40 40 41 var$total_items; // Total quantity of items.42 var$total_pages; // The total number of pages.43 var$current_page = 1; // Current page number.44 var$first_item; // The counter for the first item on this page (zero index).45 var$last_item; // The counter for the last item on this page (zero index).46 var$max_num_links = 9; // The max number of links to show on page (odd numbers look best).47 var$_num_links; // The number of links to show on page.48 var$_per_page = 25; // Items per page.41 public $total_items; // Total quantity of items. 42 public $total_pages; // The total number of pages. 43 public $current_page = 1; // Current page number. 44 public $first_item; // The counter for the first item on this page (zero index). 45 public $last_item; // The counter for the last item on this page (zero index). 46 public $max_num_links = 9; // The max number of links to show on page (odd numbers look best). 47 private $_num_links; // The number of links to show on page. 48 private $_per_page = 25; // Items per page. 49 49 50 50 // Flags to ensure all necessary values have been set before calling calculate(). 51 var$set_per_page_initialized = false;52 var$set_page_number_initialized = false;53 var$set_total_items_initialized = false;51 public $set_per_page_initialized = false; 52 public $set_page_number_initialized = false; 53 public $set_total_items_initialized = false; 54 54 55 55 // These are initialized in the constructor. 56 var$per_page_options;57 var$left_arrow;58 var$left_arrow_disabled;59 var$left_dbl_arrow;60 var$left_dbl_arrow_disabled;61 var$right_arrow;62 var$right_arrow_disabled;63 var$right_dbl_arrow;64 var$right_dbl_arrow_disabled;56 public $per_page_options; 57 public $left_arrow; 58 public $left_arrow_disabled; 59 public $left_dbl_arrow; 60 public $left_dbl_arrow_disabled; 61 public $right_arrow; 62 public $right_arrow_disabled; 63 public $right_dbl_arrow; 64 public $right_dbl_arrow_disabled; 65 65 66 66 /** 67 67 * PageNumbers constructor. All arguments are depreciated. Use set* functions instead. 68 68 */ 69 function PageNumbers()69 public function __construct() 70 70 { 71 71 // Default options for the quantity per page links. … … 85 85 // in special cases like using a /my/page/# scheme. 86 86 $this->url_base = $_SERVER['PHP_SELF'] . '?page_number='; 87 87 88 88 $this->prefs = new Prefs($_SERVER['PHP_SELF']); 89 89 $this->prefs->setParam(array('persistent' => false)); … … 93 93 * Set the number of items per page. 94 94 */ 95 function setPerPage($per_page, $default=25, $save_value=true)95 public function setPerPage($per_page, $default=25, $save_value=true) 96 96 { 97 97 // (1) By provided argument, if valid. … … 115 115 * Set the current page number. 116 116 */ 117 function setPageNumber($page_number, $save_value=true)117 public function setPageNumber($page_number, $save_value=true) 118 118 { 119 119 // (1) By provided argument, if valid. … … 139 139 * Set the total number of items. 140 140 */ 141 function setTotalItems($total_items)141 public function setTotalItems($total_items) 142 142 { 143 143 if (is_numeric($total_items) && $total_items > 0) { … … 158 158 * @access public 159 159 */ 160 function calculate()160 public function calculate() 161 161 { 162 162 $app =& App::getInstance(); … … 212 212 * Returns the SQL code to limit query to items that are on current page. 213 213 */ 214 function getLimitSQL()214 public function getLimitSQL() 215 215 { 216 216 $app =& App::getInstance(); … … 230 230 * @access public 231 231 */ 232 function printPerPageLinks($query_key='per_page')232 public function printPerPageLinks($query_key='per_page') 233 233 { 234 234 $app =& App::getInstance(); … … 260 260 * @access public 261 261 */ 262 function getPageNumURL($page_number, $carry_args=null)262 public function getPageNumURL($page_number, $carry_args=null) 263 263 { 264 264 $app =& App::getInstance(); … … 266 266 return $app->oHREF($this->url_base . $page_number, $carry_args); 267 267 } 268 function printPageNumURL($page_number, $carry_args=null)268 public function printPageNumURL($page_number, $carry_args=null) 269 269 { 270 270 echo $this->getPageNumURL($page_number, $carry_args); … … 276 276 * @access public 277 277 */ 278 function getPageNumbersArray($carry_args=null)278 public function getPageNumbersArray($carry_args=null) 279 279 { 280 280 $page_numbers = array(); … … 296 296 * @access public 297 297 */ 298 function getPageNumbers($carry_args=null)298 public function getPageNumbers($carry_args=null) 299 299 { 300 300 $page_numbers_string = ''; … … 361 361 } 362 362 363 function printPageNumbers($carry_args=null)363 public function printPageNumbers($carry_args=null) 364 364 { 365 365 echo $this->getPageNumbers($carry_args); … … 368 368 } 369 369 370 ?>
Note: See TracChangeset
for help on using the changeset viewer.