Changeset 1650

Show
Ignore:
Timestamp:
01/02/07 18:07:39 (22 months ago)
Author:
mbonetti
Message:

fix for #422, improved PaginatedItemList?

Location:
trunk/gregarius
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/items.php

    r1648 r1650  
    516516    var $itemsPerPage = 0; 
    517517    var $numItems = 0; 
    518     function PaginatedItemList() {  
     518    function PaginatedItemList($itemsPerPage=null) {  
    519519        parent::ItemList();  
    520520        if (isset($_REQUEST['page'])) { 
     
    523523            $this -> page = 0; 
    524524        } 
    525          
    526         $this ->  itemsPerPage = getConfig('rss.output.frontpage.numitems'); 
     525        if ($itemsPerPage === null) { 
     526            $this ->  itemsPerPage = getConfig('rss.output.frontpage.numitems'); 
     527        } else { 
     528            $this ->  itemsPerPage = $itemsPerPage; 
     529        } 
    527530    } 
    528531    function populate($sqlWhere, $sqlOrder="", $startItem = 0, $itemCount = -1, $hint = ITEM_SORT_HINT_MIXED, $includeDeprecated = false) { 
     
    537540            . $this -> _sqlActualWhere; 
    538541        list($this -> numItems) = rss_fetch_row(rss_query($sql)); 
    539         $this -> navigation = new ItemListNavigation($this); 
     542         
     543        if ($this -> numItems >= $this -> itemsPerPage) { 
     544            $this -> navigation = new ItemListNavigation($this);             
     545        } 
    540546    } 
    541547} 
  • trunk/gregarius/state.php

    r1561 r1650  
    2929require_once('init.php'); 
    3030 
    31 $items = new PaginatedItemList(); 
     31$items = new PaginatedItemList(20); 
    3232$items -> setRenderOptions(IL_NO_COLLAPSE); 
    3333