2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de Econom� |
6 // +--------------------------------------------------------------------+
7 // | This file is part of Intranet. |
9 // | Intranet is free software; you can redistribute it and/or modify |
10 // | it under the terms of the GNU General Public License as published |
11 // | by the Free Software Foundation; either version 2 of the License, |
12 // | or (at your option) any later version. |
14 // | Intranet is distributed in the hope that it will be useful, but |
15 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 // | General Public License for more details. |
19 // | You should have received a copy of the GNU General Public License |
20 // | along with Hooks; if not, write to the Free Software Foundation, |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 // +--------------------------------------------------------------------+
23 // | Creado: Thu Jul 10 15:03:36 2003 |
24 // | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
27 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
30 define('PATH_RAIZ','/sistemas/intranet/');
32 require_once 'HTML_Copete.php';
33 require_once 'HTML/Page.php';
38 class HTML_DietMarco extends HTML_Page {
42 var $_cuerpo = array();
50 function addTitle($title)
52 $this->setTitle($this->getTitle() . ' - ' . $title);
56 * @param string $seccion
57 * @param string $titulo
62 function HTML_DietMarco($seccion, $titulo)
64 parent::HTML_Page(array ('doctype'=>'HTML 4.01 Transitional',
65 'charset' => 'iso-8859-1',
70 $this->setTitle('Intranet');
71 $this->_copete_titulo = $titulo;
72 $this->_copete_seccion = $seccion;
73 $this->addStyleSheet(PATH_RAIZ.'css/dietmarco');
82 function addBodyContent($content)
84 if(method_exists($content, 'getcss'))
85 $this->addStyleSheet($content->getCSS());
86 $this->_cuerpo[] = $content;
91 $table = new HTML_Table(array('border' => 0, 'cellspacing' => 0, 'cellpadding' => 0));
92 $copete =& new HTML_Copete($this->_copete_seccion);
93 $copete->setTitulo($this->_copete_titulo);
94 $this->addStyleSheet($copete->getCSS());
95 $table->addRow(array($copete));
96 $table->addRow(array(' '));
97 $table->addRow(array($this->_arrayToHtml($this->_cuerpo)));
98 parent::addBodyContent($table);
99 return parent::toHtml();
102 function _arrayToHtml(&$array)
104 // Robado de HTML_Page.
105 $lnEnd = $this->_getLineEnd();
106 $tab = $this->_getTab();
108 foreach ($array as $element) {
109 if (is_object($element)) {
110 if (is_subclass_of($element, 'html_common')) {
111 $element->setTabOffset(1);
112 $element->setTab($tab);
113 $element->setLineEnd($lnEnd);
115 if (is_object($element)) {
116 if (method_exists($element, 'toHtml')) {
117 $strHtml .= $element->toHtml() . $lnEnd;
118 } elseif (method_exists($element, 'toString')) {
119 $strHtml .= $element->toString() . $lnEnd;
122 $strHtml .= $tab . $element . $lnEnd;
124 } elseif (is_array($element)) {
125 $strHtml .= $this->_arrayToHtml($element);
127 $strHtml .= $tab . $element . $lnEnd;