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',
55 $this->addStyleSheet($this->getCSS());
60 * Devuelve el link del style sheet.
67 return '/MECON/css/html/page';
71 * Redefinicion de la funcion que permite agregar objetos o html al body de
73 * Si es un objeto debe tener un metodo toHtml y opcionalmente puede tener
76 * @param mixed $content Contenido a agregar en la pagina
81 function addBodyContent($content)
83 if ((is_object($content)) && (method_exists($content, 'getcss'))) {
84 $this->addStyleSheet($content->getCSS());
86 parent::addBodyContent($content);
90 * Muestra un error y termina el programa.
92 function exitError($msg)
94 require_once 'MECON/HTML/Error.php';
95 if (is_a($msg, 'pear_error')) {
96 $msg = $msg->getMessage();
98 $this->addBodyContent(new MECON_HTML_Error($msg));
104 * Muestra una variable para debug.
106 function dump($var, $exit = false)
108 if (!isset($this->_dump)) {
109 require_once 'Var_Dump.php';
110 $this->_dump = new Var_Dump(array('display_mode' => 'HTML4_Table'));
112 //$this->addBodyContent('<pre>');
113 $this->addBodyContent($this->_dump->toString($var));
114 //$this->addBodyContent('</pre>');