Development

Changeset 968

You must first sign up to be able to contribute.

Changeset 968

Show
Ignore:
Timestamp:
03/13/06 20:15:12 (2 years ago)
Author:
fabien
Message:

fixed sfPropelPager returns negative result in getLinks (closes #287 - patch from seehiong)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/addon/sfPager/sfPropelPager.class.php

    r891 r968  
    106106  { 
    107107    $links = array(); 
    108     $tmp = $this->page - floor($nb_links / 2); 
    109     $begin = ($tmp > 0) ? (($tmp > $this->lastPage - $nb_links + 1) ? $this->lastPage - $nb_links + 1 : $tmp) : 1; 
     108    $tmp   = $this->page - floor($nb_links / 2); 
     109    $check = $this->lastPage - $nb_links + 1; 
     110    $limit = ($check > 0) ? $check : 1; 
     111    $begin = ($tmp > 0) ? (($tmp > $limit) ? $limit : $tmp) : 1; 
    110112 
    111113    $i = $begin;