1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
3 Ministerio de EconomÃa
5 -------------------------------------------------------------------------------
6 This file is part of meconlib.
8 meconlib is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 meconlib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: vie mar 19 14:50:53 ART 2004
22 Autor: Martin Marrese <mmarre@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
27 require_once 'HTML/Page.php';
30 * Clase para crear paginas sin tener que utilizar MECON_Marco.
31 * Obtiene los css de los objetos que se le agregan
35 class MECON_HTML_Page extends HTML_Page {
43 function MECON_HTML_Page()
47 'doctype' => 'HTML 4.01 Transitional',
48 'charset' => 'iso-8859-1',
58 * Redefinicion de la funcion que permite agregar objetos o html al body de
60 * Si es un objeto debe tener un metodo toHtml y opcionalmente puede tener
63 * @param mixed $content Contenido a agregar en la pagina
68 function addBodyContent($content)
70 if ((is_object($content)) && (method_exists($content, 'getcss'))) {
71 $this->addStyleSheet($content->getCSS());
73 parent::addBodyContent($content);
77 * Muestra un error y termina el programa.
79 function exitError($msg)
81 require_once 'MECON/HTML/Error.php';
82 if (is_a($msg, 'pear_error')) {
83 $msg = $msg->getMessage();
85 $this->addBodyContent(new MECON_HTML_Error($msg));
91 * Muestra una variable para debug.
93 function dump($var, $exit = false)
95 if (!isset($this->_dump)) {
96 require_once 'Var_Dump.php';
97 $this->_dump = new Var_Dump(
98 array('displayMode' => VAR_DUMP_DISPLAY_MODE_HTML_TABLE));
100 $this->addBodyContent('<pre>');
101 $this->addBodyContent($this->_dump->r_display($var));
102 $this->addBodyContent('</pre>');