-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4: */
-// +----------------------------------------------------------------------+
-// | PHP version 4.0 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2003 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.0 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available at through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Alexey Borzov <borz_off@cs.msu.su> |
-// | Adam Daniel <adaniel1@eesus.jnj.com> |
-// | Bertrand Mansion <bmansion@mamasam.com> |
-// +----------------------------------------------------------------------+
-//
-// $Id$
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ Ministerio de EconomÃa
+ meconlib
+-------------------------------------------------------------------------------
+This file is part of meconlib.
+
+meconlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+meconlib is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License; if not,
+write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Creado: jue jul 17 15:36:26 ART 2003
+Autor: Leandro Lucarella <llucar@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
require_once 'HTML/QuickForm/Renderer.php';
require_once 'MECON/HTML/Tabla.php';
/**
- * A concrete renderer for HTML_QuickForm,
- * based on QuickForm 2.x built-in one
+ * QuickForm renderer que usa Tabla como backend.
+ * Basado en el QuickForm Renderer basico.
*
* @access public
*/
/**
* Constructor.
*
- * @param mixed $style Estilo de la tabla.
+ * @param mixed $param Array o sting con el estilo de la tabla u objeto
+ * tabla alternativo para usar.
*
* @access public
*/
- function MECON_HTML_QuickForm_Renderer_Tabla($style = array())
+ function MECON_HTML_QuickForm_Renderer_Tabla($param = array())
{
$this->HTML_QuickForm_Renderer();
- $this->_tabla =& new Tabla($style);
+ if (is_a($param, 'Tabla')) {
+ $this->setTable($param);
+ }
+ else {
+ $this->_tabla =& new MECON_HTML_Tabla($param);
+ }
} // end constructor
/**
# FIXME - deberia sacarlo del QuickForm
#$this->_prepend = $form->getFormStart();
$attrs = $form->getAttributesString();
- $this->_prepend = "\n<FORM$attrs>\n";
+ $this->_prepend = "\n<form$attrs>\n";
} // end func startForm
/**
$this->_script = strval($form->getValidationScript());
# FIXME - deberia sacarlo del QuickForm
#$this->_append = $form->getFormEnd();
- $this->_append = "\n</FORM>\n";
+ $this->_append = "\n</form>\n";
} // end func finishForm
/**
if (!$this->_inGroup) {
$id = $this->_tabla->addRow(
array(
- $element->getLabel() . ($required ? '<FONT color="red">*</FONT>' : ''),
- $element->toHtml() . ($error ? "<BR><FONT color=\"red\">$error</FONT>" : ''),
+ $element->getLabel() . ($required ? '<font color="red">*</FONT>' : ''),
+ $element->toHtml() . ($error ? "<br><font color=\"red\">$error</FONT>" : ''),
)
);
- $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left', 'nowrap' => true));
+ $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left'));
$this->_tabla->updateCellAttributes($id, 1, array('align' => 'left'));
} else {
$this->_groupElements[] = ($element->getLabel() ? ($element->getLabel().' ') : '') . $element->toHtml();
$id = $this->_tabla->addRow(
array(join('', $this->_groupElements))
);
- $this->_tabla->updateCellAttributes($id, 0, array('align' => 'right', 'colspan' => 2));
+ $this->_tabla->updateCellAttributes($id, 0, array('valign' => 'middle', 'align' => 'center', 'colspan' => 2));
} else {
$id = $this->_tabla->addRow(
array($group->getLabel(), join($sep, $this->_groupElements)),
- array('align' => 'left')
+ array('valign' => 'middle', 'align' => 'left')
);
- $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left', 'nowrap' => true));
+ $this->_tabla->updateCellAttributes($id, 0, array('titulo' => true, 'align' => 'left'));
}
$this->_inGroup = false;
} // end func finishGroup
+
+ /**
+ *
+ *
+ * @param mixed $attrs Html attributes
+ * @access public
+ * @return void
+ */
+ function updateAttributes($attrs) {
+ $this->_tabla->updateAttributes($attrs);
+ }
+ /**
+ *
+ *
+ * @param mixed $attrs Html attributes
+ * @access public
+ * @return void
+ */
+ function setAttributes($attrs) {
+ $this->_tabla->setAttributes($attrs);
+ }
+ /**
+ *
+ *
+ * @access public
+ * @return mixed
+ */
+ function getAttributes() {
+ return $this->_tabla->getAttributes();
+ }
+
+ /**
+ *
+ *
+ * @param Tabla $param Objeto tabla alternativo para utilizar
+ *
+ * @access public
+ */
+ function setTable($param) {
+ $this->_tabla =& $param;
+ }
} // end class HTML_QuickForm_Renderer_Default