X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/d45895c22b503bf01e0fa82e54dfe35c6157a231..ab08e58537352a82e34dab0684ae5997ece1899c:/lib/MECON/HTML/TablaDB.php?ds=inline 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(); } }