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 24 15:27:04 2003 |
24 // | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
27 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
31 require_once 'MECON/HTML/Image.php';
32 require_once 'MECON/HTML/Link.php';
33 require_once 'DB.php';
34 require_once 'AI/Servicio.php';
35 // require_once 'AI/DB.php';
38 require_once 'HTML/Table.php';
41 // +X2C Class 165 :HTML_Servicio
45 class HTML_Servicio extends HTML_Table {
55 function HTML_Servicio($seccion) // ~X2C
57 parent::HTML_Table(array('width' =>'360',
61 'bgcolor' => '#FFFFFF'));
62 $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME
63 $this->servicio = new AI_Servicio($seccion);
64 $this->servicio->cargar($bd);
65 $this->servicio->cargarHijos($bd, true, AI_SERVICIO_ORDEN_LONG_NOMBRE);
74 function toHTML() // ~X2C
76 if($this->servicio->link == '')
77 $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio;
78 elseif($this->servicio->necesita_logueo)
79 $this->servicio->link = 'login.php?redirect='.$this->servicio->servicio;
80 $l = new MECON_HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
81 array('class' => 'servicio_titulo_tabla'));
82 //$this->addRow(array(' '.$l->toHTML()),//Volvera...
83 $this->addRow(array(' '.$this->servicio->nombre),
84 array('align' => 'center',
85 'class' => 'arboltitulo',
86 'background'=>'images/servicio_cabecera.gif',
88 'class' => 'servicio_titulo_tabla'));
89 $img = new MECON_HTML_Image('images/servicio_bullet.gif');
90 $int =& new HTML_Table(array('width' =>'360',
94 'bgcolor' => '#FFFFFF'));
95 $int->addRow(array($img, '',$img,''),
97 $int->updateColAttributes(0, array('width' => '10%',
98 'background' => 'images/servicio_borde_sup_izq.gif',
100 $int->updateColAttributes(1, array('width' => '40%',
102 'background' => 'images/servicio_borde_sup_cen.gif'));
103 $int->updateColAttributes(2, array('width' => '10%',
104 'background' => 'images/servicio_borde_sup_cen.gif',
106 $int->updateColAttributes(3, array('width' => '40%',
108 'background' => 'images/servicio_borde_sup_der.gif'));
110 foreach($this->servicio->getHijos() as $s)
113 $s->link = 'servicios.php?servicios='.$s->servicio;
114 elseif($s->necesita_logueo)
115 $s->link = 'login.php?redirect='.$s->servicio;
118 $int->setCellContents(0, 3, new MECON_HTML_Link($s->link, $s->nombre,
120 array('class' => 'servicio_tabla')));
121 $this->addRow(array($int));
126 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
128 array('class' => 'servicio_tabla')));
134 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
136 array('class' => 'servicio_tabla')));
137 $int->setCellContents(0, 2, '');
138 $int->setCellContents(0, 3, '');
139 $this->addRow(array($int));
142 $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif')));
143 return parent::toHTML();
147 // +X2C Operation 170
152 function getCSS() // ~X2C
154 return "css/servicio.css";
158 } // -X2C Class :HTML_Servicio