2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de EconomÃa |
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 'HTML/Image.php';
32 require_once '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 'class' => 'servicio_tabla'));
63 $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME
64 $this->servicio = new AI_Servicio($seccion);
65 $this->servicio->cargar($bd);
66 $this->servicio->cargarHijos($bd);
75 function toHTML() // ~X2C
77 echo '<link rel="stylesheet" href="css/servicio.css">';
78 if($this->servicio->link == '')
79 $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio;
80 $l = new HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
81 array('class' => 'servicio_titulo_tabla'));
82 $this->addRow(array(' '.$l->toHTML()),
83 array('align' => 'center',
84 'class' => 'arboltitulo',
85 'background'=>'images/servicio_cabecera.gif',
87 'class' => 'servicio_titulo_tabla'));
88 $img = new HTML_Image('images/servicio_bullet.gif');
89 $int =& new HTML_Table(array('width' =>'360',
93 'bgcolor' => '#FFFFFF'));
94 $int->addRow(array($img, '',$img,''),
96 $int->updateColAttributes(0, array('width' => '10%',
97 'background' => 'images/servicio_borde_sup_izq.gif',
99 $int->updateColAttributes(1, array('width' => '40%',
100 'background' => 'images/servicio_borde_sup_cen.gif'));
101 $int->updateColAttributes(2, array('width' => '10%',
102 'background' => 'images/servicio_borde_sup_cen.gif',
104 $int->updateColAttributes(3, array('width' => '40%',
105 'background' => 'images/servicio_borde_sup_der.gif'));
107 foreach($this->servicio->getHijos() as $s)
110 $s->link = 'servicios.php?servicios='.$s->servicio;
113 $int->setCellContents(0, 3, new HTML_Link($s->link, $s->nombre,
115 array('class' => 'servicio_tabla')));
116 $this->addRow(array($int));
121 $int->setCellContents(0, 1, new HTML_Link($s->link, $s->nombre,
123 array('class' => 'servicio_tabla')));
129 $int->setCellContents(0, 1, new HTML_Link($s->link, $s->nombre,
131 array('class' => 'servicio_tabla')));
132 $int->setCellContents(0, 2, '');
133 $int->setCellContents(0, 3, '');
134 $this->addRow(array($int));
137 $this->addRow(array(new HTML_Image('images/servicio_borde_inf.gif')));
138 return parent::toHTML();
142 } // -X2C Class :HTML_Servicio