]> git.llucax.com Git - mecon/intranet.git/blobdiff - sistema/local_lib/HTML_DietMarco.php
- Pase los objetos para obtener la informacion del legajo a meconlib
[mecon/intranet.git] / sistema / local_lib / HTML_DietMarco.php
index 25f16b31754daa6dbeb8e2ff3b46930174b791a5..56f88104cd58089d091afdd0b84f1b44da0f39e2 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
 // +--------------------------------------------------------------------+
 <?php
 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
 // +--------------------------------------------------------------------+
-// |                      Ministerio de Economía                        |
+// |                      Ministerio de Econom                        |
 // |                             Intranet                              |
 // +--------------------------------------------------------------------+
 // | This file is part of Intranet.                                    |
 // |                             Intranet                              |
 // +--------------------------------------------------------------------+
 // | This file is part of Intranet.                                    |
 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
 //
 
 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
 //
 
-require_once 'HTML_Copete.php';
+define('PATH_RAIZ','/sistemas/intranet/');
 
 
-// +X2C includes
+require_once 'HTML_Copete.php';
 require_once 'HTML/Page.php';
 require_once 'HTML/Page.php';
-// ~X2C
 
 
-// +X2C Class 154 :HTML_DietMarco
 /**
  * @access public
  */
 class HTML_DietMarco extends HTML_Page {
 /**
  * @access public
  */
 class HTML_DietMarco extends HTML_Page {
-    // ~X2C
-
 
 
+    var $_copete_seccion;
+    var $_copete_titulo;
+    var $_cuerpo = array();
 
 
-    // +X2C Operation 157
     /**
      * @param  int $title 
      *
      * @return void
      * @access public
      */
     /**
      * @param  int $title 
      *
      * @return void
      * @access public
      */
-    function addTitle($title) // ~X2C
+    function addTitle($title)
     {
     {
-        $this->_title .= ' - '.$title;
+        $this->setTitle($this->getTitle() . ' - ' . $title);
     }
     }
-    // -X2C
 
 
-    // +X2C Operation 158
     /**
      * @param  string $seccion 
     /**
      * @param  string $seccion 
+     * @param  string $titulo 
      *
      * @return void
      * @access public
      */
      *
      * @return void
      * @access public
      */
-    function HTML_DietMarco($seccion) // ~X2C
+    function HTML_DietMarco($seccion, $titulo)
     {
         parent::HTML_Page(array ('doctype'=>'HTML 4.01 Transitional',
                                  'charset'  => 'iso-8859-1',
     {
         parent::HTML_Page(array ('doctype'=>'HTML 4.01 Transitional',
                                  'charset'  => 'iso-8859-1',
@@ -70,10 +67,68 @@ class HTML_DietMarco extends HTML_Page {
                                  'language' => 'es',
                                  'cache'    => 'false',
                                  'simple'   => 'true'));
                                  'language' => 'es',
                                  'cache'    => 'false',
                                  'simple'   => 'true'));
-        $this->_title = 'Intranet bla bla..';
-       $this->addBodyContent(new HTML_Copete($seccion));
+        $this->setTitle('Intranet');
+       $this->_copete_titulo = $titulo;
+        $this->_copete_seccion = $seccion;
+        $this->addStyleSheet(PATH_RAIZ.'css/dietmarco');
+    }
+
+    /**
+     * @param  int $content 
+     *
+     * @return void
+     * @access public
+     */
+    function addBodyContent($content)
+    {
+        if(method_exists($content, 'getcss'))
+           $this->addStyleSheet($content->getCSS());
+       $this->_cuerpo[] = $content;
+    }
+
+    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('&nbsp;'));
+        $table->addRow(array($this->_arrayToHtml($this->_cuerpo)));
+        parent::addBodyContent($table);
+        return parent::toHtml();
+    }
+
+    function _arrayToHtml(&$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
+}
 ?>
 ?>