Ignore:
Timestamp:
Oct 30, 2014 3:49:51 PM (11 years ago)
Author:
quyenla
Message:

collaborator page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/system/libraries/Pagination.php

    r289 r345  
    3535        var $num_links                  =  2; // Number of "digit" links to show before/after the currently viewed page
    3636        var $cur_page                   =  0; // The current page being viewed
     37        var $current_page               =  0;
    3738        var $use_page_numbers   = FALSE; // Use page number for segment instead of offset
    3839        var $first_link                 = '‹ First';
     
    5960        var $query_string_segment = 'per_page';
    6061        var $display_pages              = TRUE;
     62        var $ajax_class         = '';
    6163        var $anchor_class               = '';
    6264
     
    100102                                {
    101103                                        $this->$key = $val;
     104                                       
    102105                                }
    103106                        }
     
    162165                                $this->cur_page = (int) $this->cur_page;
    163166                        }
     167                       
     168                       
     169                        if ($this->current_page)
     170                        {
     171                                // Prep the current page - no funny business!
     172                                $this->cur_page = (int) $this->current_page;
     173                        }
    164174                }
    165175               
     
    229239                {
    230240                        $first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;
    231                         $output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
     241                        $output .= $this->first_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;
    232242                }
    233243
     
    246256                        if ($i == 0 && $this->first_url != '')
    247257                        {
    248                                 $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
     258                                $output .= $this->prev_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
    249259                        }
    250260                        else
    251261                        {
    252262                                $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;
    253                                 $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
     263                                $output .= $this->prev_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close;
    254264                        }
    255265
     
    283293                                                if ($n == '' && $this->first_url != '')
    284294                                                {
    285                                                         $output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
     295                                                        $output .= $this->num_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;
    286296                                                }
    287297                                                else
     
    289299                                                        $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;
    290300
    291                                                         $output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
     301                                                        $output .= $this->num_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
    292302                                                }
    293303                                        }
     
    296306                }
    297307
    298                 // Render the "next" link
     308                       
    299309                if ($this->next_link !== FALSE AND $this->cur_page < $num_pages)
    300310                {
     
    307317                                $i = ($this->cur_page * $this->per_page);
    308318                        }
    309 
    310                         $output .= $this->next_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
     319                       
     320                        $output .= $this->next_tag_open.'<a  class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->next_link.'</a>'.$this->next_tag_close;
    311321                }
    312322
     
    322332                                $i = (($num_pages * $this->per_page) - $this->per_page);
    323333                        }
    324                         $output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
     334                        $output .= $this->last_tag_open.'<a class ="'.$this->ajax_class.'"'.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close;
    325335                }
    326336
     
    331341                // Add the wrapper HTML if exists
    332342                $output = $this->full_tag_open.$output.$this->full_tag_close;
    333 
    334343                return $output;
    335344        }
Note: See TracChangeset for help on using the changeset viewer.