X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/3160012cdccbdc9fa1743e66da33b699504d5c84..82f84542bdaf5556f4ee7a2928c7759fbd97deae:/sistema/local_lib/HTML_DietMarco.php diff --git a/sistema/local_lib/HTML_DietMarco.php b/sistema/local_lib/HTML_DietMarco.php index a0ec461..56f8810 100644 --- a/sistema/local_lib/HTML_DietMarco.php +++ b/sistema/local_lib/HTML_DietMarco.php @@ -1,7 +1,7 @@ copete->toHTML(); - return $html; + $this->setTitle($this->getTitle() . ' - ' . $title); } - // -X2C - // +X2C Operation 156 /** - * @param int $body + * @param string $seccion + * @param string $titulo * * @return void * @access public */ - function addBody($body) // ~X2C + function HTML_DietMarco($seccion, $titulo) { - $this->body[] = $body + parent::HTML_Page(array ('doctype'=>'HTML 4.01 Transitional', + 'charset' => 'iso-8859-1', + 'lineend' => 'unix', + 'language' => 'es', + 'cache' => 'false', + 'simple' => 'true')); + $this->setTitle('Intranet'); + $this->_copete_titulo = $titulo; + $this->_copete_seccion = $seccion; + $this->addStyleSheet(PATH_RAIZ.'css/dietmarco'); } - // -X2C - // +X2C Operation 157 /** - * @param int $title + * @param int $content * * @return void * @access public */ - function addTitle($title) // ~X2C + function addBodyContent($content) { - trigger_error('Not implemented!', E_USER_WARNING); + if(method_exists($content, 'getcss')) + $this->addStyleSheet($content->getCSS()); + $this->_cuerpo[] = $content; } - // -X2C - // +X2C Operation 158 - /** - * @param string $seccion - * - * @return void - * @access public - */ - function HTML_DietMarco($seccion) // ~X2C + function toHtml() + { + $table = new HTML_Table(array('border' => 0, 'cellspacing' => 0, 'cellpadding' => 0)); + $copete =& new HTML_Copete($this->_copete_seccion); + $copete->setTitulo($this->_copete_titulo); + $this->addStyleSheet($copete->getCSS()); + $table->addRow(array($copete)); + $table->addRow(array(' ')); + $table->addRow(array($this->_arrayToHtml($this->_cuerpo))); + parent::addBodyContent($table); + return parent::toHtml(); + } + + function _arrayToHtml(&$array) { - $this->title = 'Intranet bla bla..'; - $this->copete = new HTML_Copete($seccion); - $this->body = array(); + // Robado de HTML_Page. + $lnEnd = $this->_getLineEnd(); + $tab = $this->_getTab(); + $strHtml = ''; + foreach ($array as $element) { + if (is_object($element)) { + if (is_subclass_of($element, 'html_common')) { + $element->setTabOffset(1); + $element->setTab($tab); + $element->setLineEnd($lnEnd); + } + if (is_object($element)) { + if (method_exists($element, 'toHtml')) { + $strHtml .= $element->toHtml() . $lnEnd; + } elseif (method_exists($element, 'toString')) { + $strHtml .= $element->toString() . $lnEnd; + } + } else { + $strHtml .= $tab . $element . $lnEnd; + } + } elseif (is_array($element)) { + $strHtml .= $this->_arrayToHtml($element); + } else { + $strHtml .= $tab . $element . $lnEnd; + } + } + return $strHtml; } - // -X2C -} // -X2C Class :HTML_DietMarco -?> \ No newline at end of file +} +?>