Changeset 345 for pro-violet-viettel/sourcecode/system
- Timestamp:
- Oct 30, 2014 3:49:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/system/libraries/Pagination.php
r289 r345 35 35 var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page 36 36 var $cur_page = 0; // The current page being viewed 37 var $current_page = 0; 37 38 var $use_page_numbers = FALSE; // Use page number for segment instead of offset 38 39 var $first_link = '‹ First'; … … 59 60 var $query_string_segment = 'per_page'; 60 61 var $display_pages = TRUE; 62 var $ajax_class = ''; 61 63 var $anchor_class = ''; 62 64 … … 100 102 { 101 103 $this->$key = $val; 104 102 105 } 103 106 } … … 162 165 $this->cur_page = (int) $this->cur_page; 163 166 } 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 } 164 174 } 165 175 … … 229 239 { 230 240 $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; 232 242 } 233 243 … … 246 256 if ($i == 0 && $this->first_url != '') 247 257 { 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; 249 259 } 250 260 else 251 261 { 252 262 $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; 254 264 } 255 265 … … 283 293 if ($n == '' && $this->first_url != '') 284 294 { 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; 286 296 } 287 297 else … … 289 299 $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; 290 300 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; 292 302 } 293 303 } … … 296 306 } 297 307 298 // Render the "next" link308 299 309 if ($this->next_link !== FALSE AND $this->cur_page < $num_pages) 300 310 { … … 307 317 $i = ($this->cur_page * $this->per_page); 308 318 } 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; 311 321 } 312 322 … … 322 332 $i = (($num_pages * $this->per_page) - $this->per_page); 323 333 } 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; 325 335 } 326 336 … … 331 341 // Add the wrapper HTML if exists 332 342 $output = $this->full_tag_open.$output.$this->full_tag_close; 333 334 343 return $output; 335 344 }
Note: See TracChangeset
for help on using the changeset viewer.