1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
4 -------------------------------------------------------------------------------
5 This file is part of mlib.
7 mlib is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your option)
12 mlib is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License; if not,
17 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 Boston, MA 02111-1307 USA
19 -------------------------------------------------------------------------------
20 Creado: vie mar 19 14:50:53 ART 2004
21 Autor: Martin Marrese <mmarre@mecon.gov.ar>
22 -------------------------------------------------------------------------------
24 -----------------------------------------------------------------------------*/
26 require_once 'HTML/Page.php';
29 * Clase para crear paginas sin tener que utilizar MLIB_Marco.
30 * Obtiene los css de los objetos que se le agregan
34 class MLIB_HTML_Page extends HTML_Page {
42 function MLIB_HTML_Page()
46 'doctype' => 'HTML 4.01 Transitional',
47 'charset' => 'iso-8859-1',
54 $this->addStyleSheet($this->getCSS());
59 * Devuelve el link del style sheet.
66 return '/MLIB/css/html/page';
70 * Redefinicion de la funcion que permite agregar objetos o html al body de
72 * Si es un objeto debe tener un metodo toHtml y opcionalmente puede tener
75 * @param mixed $content Contenido a agregar en la pagina
80 function addBodyContent($content)
82 if ((is_object($content)) && (method_exists($content, 'getcss'))) {
83 $this->addStyleSheet($content->getCSS());
85 parent::addBodyContent($content);
89 * Muestra un error y termina el programa.
91 function exitError($msg)
93 require_once 'MLIB/HTML/Error.php';
94 if (is_a($msg, 'pear_error')) {
95 $msg = $msg->getMessage();
97 $this->addBodyContent(new MLIB_HTML_Error($msg));
103 * Muestra una variable para debug.
105 function dump($var, $exit = false)
107 if (!isset($this->_dump)) {
108 require_once 'Var_Dump.php';
109 $this->_dump = new Var_Dump(array('display_mode' => 'HTML4_Table'));
111 //$this->addBodyContent('<pre>');
112 $this->addBodyContent($this->_dump->toString($var));
113 //$this->addBodyContent('</pre>');