Add page selection control at the bottom of pages, without the items per-page selector. Fix

objectMananger::handleMultiPageControls() to not display the items per-page selector if
the $bItemsPerPageSelector input parameter is false.
This commit is contained in:
Chris Morgan
2007-08-24 02:10:23 +00:00
committed by WineHQ
parent 2dcfdc24f6
commit 6b5305d1bf

View File

@@ -95,8 +95,8 @@ class ObjectManager
$oObject = new $this->sClass();
/* Display selectors for items per page and current page, if applicable. The function
returns FALSE or an array of arguments to be passed to objectGetEntries() */
// Display top of the page selectors for items per page and
// current page, if applicable.
$this->handleMultiPageControls($aClean, TRUE);
/* query the class for its entries */
@@ -192,6 +192,11 @@ class ObjectManager
echo "<br /><br /><a href=\"".$this->makeUrl("add", false,
"Add $this->sClass")."\">Add entry</a>\n";
}
// Display bottom of page selectors current page, if applicable
// NOTE: second parameter is false because we don't want the
// items per page selector appearing for the second set of page controls
$this->handleMultiPageControls($aClean, FALSE);
}
/* display the entry for editing */
@@ -704,9 +709,16 @@ class ObjectManager
$iItemsPerPage = $iDefaultPerPage;
if ( isset($aClean['iItemsPerPage']) && in_array($aClean['iItemsPerPage'], $aItemsPerPage) )
if ( isset($aClean['iItemsPerPage']) &&
in_array($aClean['iItemsPerPage'], $aItemsPerPage) )
{
$iItemsPerPage = $aClean['iItemsPerPage'];
}
// if $bItemsPerPageSelector is true, display the items
// per-page dropdown and update button
if($bItemsPerPageSelector)
{
$sControls = "<form action=\"".$this->makeUrl()."\" method=\"get\">";
/* Fill in form data for the objectManager URL */
@@ -722,6 +734,7 @@ class ObjectManager
$sControls .= "</select>";
$sControls .= " &nbsp; <input type=\"submit\" value=\"Update\" />";
$sControls .= "</form></p>";
}
$iTotalEntries = $oObject->objectGetEntriesCount($this->bIsQueue, $this->bIsRejected);
$iNumPages = ceil($iTotalEntries / $iItemsPerPage);