Re: request: pear list-all sorted
| From: | Lorenzo Alberton | Date: | Wed, 22 Oct 2003 13:42:32 +0000 |
| Subject: | Re: request: pear list-all sorted | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22906@lists.php.net to get a copy of this message | ||
On Wed, 22 Oct 2003 12:34:18 +0100 (BST), David Grant wrote:
> While we're at it, is it possible to having the paging links (e.g.
> Next) at the botttom as well as the top?
I had proposed a patch ages ago for this precise thing,
I think usability would gain a lot from this simple addon.
I attach the patch again, updated to latest CVS version,
hoping this time it gets some more consideration :-)
Best regards,
Lorenzo
NB:
Apply to
pearweb/public_html/packages.php
and
pearweb/templates/packages.html
--- packages.php 2003-10-20 12:30:59.000000000 +0200 +++ new_packages.php 2003-10-22 15:28:19.000000000 +0200 @@ -205,7 +205,8 @@ $pager = new Pager(array('totalItems' => $total, 'perPage' => 15)); list($first, $last) = $pager->getOffsetByPageId(); list($prev, $pages, $next) = $pager->getLinks('<nobr><img src="gifs/prev.gif" width="10" height="10" border="0" alt="<<" />Back</nobr>', '<nobr>Next<img src="gifs/next.gif" width="10" height="10" border="0" alt=">>" /></nobr>'); - + $currentPage = $pager->getCurrentPageID(); + $numPages = $pager->numPages(); $packages = array_slice($packages, $first - 1, 15); foreach ($packages as $key => $pkg) { --- packages.html 2003-09-01 11:54:04.000000000 +0200 +++ new_packages.html 2003-10-22 15:21:23.000000000 +0200 @@ -30,6 +30,7 @@ <tr> <th valign="top" align="left"> Contents of :: <?html_category_urhere($catpid, false)?> + (Page <?=$currentPage?> of <?=$numPages?>) </th> <td valign="top" align="right"> <?=$showempty_link?> @@ -61,6 +62,12 @@ font-weight: bold; } + td.tableFooter { + background-color: #cccccc; + border-top: 1px solid black; + font-weight: bold; + } + td.moreInfo { background-color: #f0f0f0; border: 1px dashed #c0c0c0; @@ -110,7 +117,7 @@ <th class="pkgListHeader">#</td> <th class="pkgListHeader"><nobr>Package name</nobr></td> <th class="pkgListHeader">Description</td> - <td> </td> + <th class="pkgListHeader"> </td> </tr> <?foreach($packages as $p):?> @@ -166,6 +173,17 @@ </table> </td> </tr> + <tr> + <td> + <table border="0" width="100%" cellspacing="0"> + <tr> + <td class="tableFooter" width="50" align="left"> <?=$prev?></td> + <td class="tableFooter" align="center">Packages (<?=$first?> - <?=$last?> of <?=$total?>)</td> + <td class="tableFooter" width="50" align="right"><?=$next?> </td> + </tr> + </table> + </td> + </tr> </table> <?elseif($catpid):?>
--- packages.php 2003-10-20 12:30:59.000000000 +0200 +++ new_packages.php 2003-10-22 15:28:19.000000000 +0200 @@ -205,7 +205,8 @@ $pager = new Pager(array('totalItems' => $total, 'perPage' => 15)); list($first, $last) = $pager->getOffsetByPageId(); list($prev, $pages, $next) = $pager->getLinks('<nobr><img src="gifs/prev.gif" width="10" height="10" border="0" alt="<<" />Back</nobr>', '<nobr>Next<img src="gifs/next.gif" width="10" height="10" border="0" alt=">>" /></nobr>'); - + $currentPage = $pager->getCurrentPageID(); + $numPages = $pager->numPages(); $packages = array_slice($packages, $first - 1, 15); foreach ($packages as $key => $pkg) { --- packages.html 2003-09-01 11:54:04.000000000 +0200 +++ new_packages.html 2003-10-22 15:21:23.000000000 +0200 @@ -30,6 +30,7 @@ <tr> <th valign="top" align="left"> Contents of :: <?html_category_urhere($catpid, false)?> + (Page <?=$currentPage?> of <?=$numPages?>) </th> <td valign="top" align="right"> <?=$showempty_link?> @@ -61,6 +62,12 @@ font-weight: bold; } + td.tableFooter { + background-color: #cccccc; + border-top: 1px solid black; + font-weight: bold; + } + td.moreInfo { background-color: #f0f0f0; border: 1px dashed #c0c0c0; @@ -110,7 +117,7 @@ <th class="pkgListHeader">#</td> <th class="pkgListHeader"><nobr>Package name</nobr></td> <th class="pkgListHeader">Description</td> - <td> </td> + <th class="pkgListHeader"> </td> </tr> <?foreach($packages as $p):?> @@ -166,6 +173,17 @@ </table> </td> </tr> + <tr> + <td> + <table border="0" width="100%" cellspacing="0"> + <tr> + <td class="tableFooter" width="50" align="left"> <?=$prev?></td> + <td class="tableFooter" align="center">Packages (<?=$first?> - <?=$last?> of <?=$total?>)</td> + <td class="tableFooter" width="50" align="right"><?=$next?> </td> + </tr> + </table> + </td> + </tr> </table> <?elseif($catpid):?>