From 5d5ac6da6b132b697f7f564c5d9762e2fc97bb79 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 5 May 2005 02:14:58 +0000 Subject: [PATCH] =?utf8?q?Se=20hace=20que=20si=20no=20hay=20=C3=ADtems=20m?= =?utf8?q?uestre=20un=20mensaje.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/lib/listador.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lib/listador.php b/src/lib/listador.php index 6993d45..be69153 100644 --- a/src/lib/listador.php +++ b/src/lib/listador.php @@ -20,7 +20,18 @@ function printfl() */ function listar($item, $link = '', $caption = null, $summary = null, $cant = 15) { - if (!$summary) $summary = 'Listado de ' . get_class($item) . 's'; + // Calculo posiciones + $total = $item->getTotal(); + if (!$total) + { + echo error('No se encontraron ' . $item->getObjNamePl()); + return; + } + $from = intval(@$_GET["lista_from"]); + $c = min($total - $from, $cant); + $item->seek($from); + if (is_null($summary)) $summary = 'Listado de ' . $item->getObjNamePl(); + if (is_null($caption)) $caption = $summary; printfl('', $summary); if ($caption) printfl(' ', $caption); printfl(' '); @@ -30,10 +41,6 @@ function listar($item, $link = '', $caption = null, $summary = null, $cant = 15) printfl(' '); printfl(' '); printfl(' '); - $total = $item->getTotal(); - $from = intval(@$_GET["lista_from"]); - $c = min($total - $from, $cant); - $item->seek($from); while ($item->next() and $c--) { printfl(' '); -- 2.43.0
%s