From 479400eda011cc5fab17fcb1fbf5d653b44b8ca3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Tue, 16 Mar 2004 20:13:41 +0000 Subject: [PATCH] Se usa la nueva clase MECON_HTML_Icon. --- lib/MECON/HTML/TablaDB.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/MECON/HTML/TablaDB.php b/lib/MECON/HTML/TablaDB.php index 9130d9b..6852ba9 100644 --- a/lib/MECON/HTML/TablaDB.php +++ b/lib/MECON/HTML/TablaDB.php @@ -29,6 +29,7 @@ require_once 'MECON/DB/Pager.php'; require_once 'MECON/Array/Pager.php'; require_once 'MECON/HTML/Error.php'; require_once 'MECON/HTML/Link.php'; +require_once 'MECON/HTML/Icon.php'; require_once 'MECON/HTML/Tabla.php'; /// Prefijo a usar para las variables GET que genera la tabla. @@ -641,21 +642,20 @@ class MECON_HTML_TablaDB extends MECON_HTML_Tabla { break; } if ($activo === true) { - $img = new MECON_HTML_Image("/MECON/images/general_$id", - '('.strtoupper($id{0}).')'); - $img->updateAttributes(array('title' => ucfirst($id))); - $link->addContents($img); + $img = new MECON_HTML_Icon($id, $link, null, + array('title' => ucfirst($id))); + $l = $img->getLink(); foreach ($campos as $campo) { $format = null; if (is_array($campo)) { list($campo, $format) = $campo; } - $link->setGetVar($this->getGetVarPrefix().$campo, $format); + $l->setGetVar($this->getGetVarPrefix().$campo, $format); } - $this->addRowsData($link, array(), $lugar); + $this->addRowsData($l, array(), $lugar); } elseif ($activo === false) { - $img = new MECON_HTML_Image("/MECON/images/general_{$id}_des", '(-)'); - $img->updateAttributes(array('title' => ucfirst($id))); + $img = new MECON_HTML_Icon($id.'_des', null, '-', + array('title' => ucfirst($id))); $this->addRowsData($img, array(), $lugar); } else { $campos[] = $activo; @@ -682,17 +682,16 @@ class MECON_HTML_TablaDB extends MECON_HTML_Tabla { function MECON_HTML_TablaDB_callback_addRowsIcon($campos, $args) { list($tipo, $link, $activo) = $args; if ($campos[$activo]) { - $img = new MECON_HTML_Image("/MECON/images/general_$tipo", - '('.strtoupper($tipo{0}).')'); - $img->updateAttributes(array('title' => ucfirst($tipo))); - $link->addContents($img); + $img = new MECON_HTML_Icon($tipo, $link, null, + array('title' => ucfirst($tipo))); + $l = $img->getLink(); foreach ($campos as $campo => $valor) { - $link->setGetVar(MECON_HTML_TablaDB::getGetVarPrefix().$campo, $valor); + $l->setGetVar(MECON_HTML_TablaDB::getGetVarPrefix().$campo, $valor); } - return $link->toHtml(); + return $l->toHtml(); } else { - $img = new MECON_HTML_Image("/MECON/images/general_{$tipo}_des", '(-)'); - $img->updateAttributes(array('title' => ucfirst($tipo))); + $img = new MECON_HTML_Icon($tipo.'_des', null, '-', + array('title' => ucfirst($tipo))); return $img->toHtml(); } } -- 2.43.0