Ignore:
Timestamp:
May 26, 2006 9:29:19 PM (18 years ago)
Author:
scdev
Message:

finished /lib folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0singleton/lib/PageNumbers.inc.php

    r111 r128  
    137137    function calculate()
    138138    {
     139        $app =& App::getInstance();
     140
    139141        if (!$this->set_per_page_initialized) {
    140             App::logMsg(sprintf('set_per_page not initialized'), LOG_ERR, __FILE__, __LINE__);
     142            $app->logMsg(sprintf('set_per_page not initialized'), LOG_ERR, __FILE__, __LINE__);
    141143        }
    142144        if (!$this->set_page_number_initialized) {
    143             App::logMsg(sprintf('set_page_number not initialized'), LOG_ERR, __FILE__, __LINE__);
     145            $app->logMsg(sprintf('set_page_number not initialized'), LOG_ERR, __FILE__, __LINE__);
    144146        }
    145147        if (!$this->set_total_items_initialized) {
    146             App::logMsg(sprintf('set_total_items not initialized'), LOG_ERR, __FILE__, __LINE__);
     148            $app->logMsg(sprintf('set_total_items not initialized'), LOG_ERR, __FILE__, __LINE__);
    147149        }
    148150
     
    189191    function getLimitSQL()
    190192    {
     193        $app =& App::getInstance();
     194
    191195        if (is_numeric($this->first_item) && is_numeric($this->_per_page)) {
    192196            return ' LIMIT ' . DB::escapeString($this->first_item) . ', ' . DB::escapeString($this->_per_page) . ' ';
    193197        } else {
    194             App::logMsg(sprintf('Could not find SQL to LIMIT by %s %s.', $this->first_item, $this->_per_page), LOG_WARNING, __FILE__, __LINE__);
     198            $app->logMsg(sprintf('Could not find SQL to LIMIT by %s %s.', $this->first_item, $this->_per_page), LOG_WARNING, __FILE__, __LINE__);
    195199            return '';
    196200        }
     
    204208    function printPerPageLinks($query_key='per_page')
    205209    {
     210        $app =& App::getInstance();
     211
    206212        $sp = '';
    207213        for ($i=0; $i<sizeof($this->per_page_options); $i++) {
     
    209215                printf('%s<a href="%s">%s</a>',
    210216                    $sp,
    211                     App::oHREF($_SERVER['PHP_SELF'] . '?' . $query_key . '=' . $this->per_page_options[$i]),
     217                    $app->oHREF($_SERVER['PHP_SELF'] . '?' . $query_key . '=' . $this->per_page_options[$i]),
    212218                    $this->per_page_options[$i]
    213219                );
     
    220226
    221227    /**
    222      * Outputs an App::oHREF compatible url that goes to the page $page_number.
     228     * Outputs an $app->oHREF compatible url that goes to the page $page_number.
    223229     * Depends on $this->base_url to build the url onto. This is used in the
    224230     * page_number.ihtml template.
     
    232238    function getPageNumURL($page_number, $carry_args=null)
    233239    {
    234         return App::oHREF($this->url_base . $page_number, $carry_args);
     240        $app =& App::getInstance();
     241
     242        return $app->oHREF($this->url_base . $page_number, $carry_args);
    235243    }
    236244    function printPageNumURL($page_number, $carry_args=null)
Note: See TracChangeset for help on using the changeset viewer.