Ignore:
Timestamp:
Nov 30, 2013 7:30:44 PM (11 years ago)
Author:
anonymous
Message:

added public and private keywords to all properties and methods, changed old classname constructor function to construct, removed more ?> closing tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/lib/PageNumbers.inc.php

    r396 r439  
    3939class PageNumbers {
    4040
    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.
    4949
    5050    // 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;
    5454
    5555    // 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;
    6565
    6666    /**
    6767     * PageNumbers constructor. All arguments are depreciated. Use set* functions instead.
    6868     */
    69     function PageNumbers()
     69    public function __construct()
    7070    {
    7171        // Default options for the quantity per page links.
     
    9393     * Set the number of items per page.
    9494     */
    95     function setPerPage($per_page, $default=25, $save_value=true)
     95    public function setPerPage($per_page, $default=25, $save_value=true)
    9696    {
    9797        // (1) By provided argument, if valid.
     
    115115     * Set the current page number.
    116116     */
    117     function setPageNumber($page_number, $save_value=true)
     117    public function setPageNumber($page_number, $save_value=true)
    118118    {
    119119        // (1) By provided argument, if valid.
     
    139139     * Set the total number of items.
    140140     */
    141     function setTotalItems($total_items)
     141    public function setTotalItems($total_items)
    142142    {
    143143        if (is_numeric($total_items) && $total_items > 0) {
     
    158158     * @access public
    159159     */
    160     function calculate()
     160    public function calculate()
    161161    {
    162162        $app =& App::getInstance();
     
    212212     * Returns the SQL code to limit query to items that are on current page.
    213213     */
    214     function getLimitSQL()
     214    public function getLimitSQL()
    215215    {
    216216        $app =& App::getInstance();
     
    230230     * @access public
    231231     */
    232     function printPerPageLinks($query_key='per_page')
     232    public function printPerPageLinks($query_key='per_page')
    233233    {
    234234        $app =& App::getInstance();
     
    260260     * @access public
    261261     */
    262     function getPageNumURL($page_number, $carry_args=null)
     262    public function getPageNumURL($page_number, $carry_args=null)
    263263    {
    264264        $app =& App::getInstance();
     
    266266        return $app->oHREF($this->url_base . $page_number, $carry_args);
    267267    }
    268     function printPageNumURL($page_number, $carry_args=null)
     268    public function printPageNumURL($page_number, $carry_args=null)
    269269    {
    270270        echo $this->getPageNumURL($page_number, $carry_args);
     
    276276     * @access public
    277277     */
    278     function getPageNumbersArray($carry_args=null)
     278    public function getPageNumbersArray($carry_args=null)
    279279    {
    280280        $page_numbers = array();
     
    296296     * @access public
    297297     */
    298     function getPageNumbers($carry_args=null)
     298    public function getPageNumbers($carry_args=null)
    299299    {
    300300        $page_numbers_string = '';
     
    361361    }
    362362
    363     function printPageNumbers($carry_args=null)
     363    public function printPageNumbers($carry_args=null)
    364364    {
    365365        echo $this->getPageNumbers($carry_args);
     
    368368}
    369369
    370 ?>
Note: See TracChangeset for help on using the changeset viewer.