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 '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 '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 if($this->servicio->link == '')
78 $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio;
79 elseif($this->servicio->necesita_logueo)
80 $this->servicio->link = 'login.php?redirect='.$this->servicio->servicio;
81 $l = new MECON_HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
82 array('class' => 'servicio_titulo_tabla'));
83 $this->addRow(array(' '.$l->toHTML()),
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%',
101 'background' => 'images/servicio_borde_sup_cen.gif'));
102 $int->updateColAttributes(2, array('width' => '10%',
103 'background' => 'images/servicio_borde_sup_cen.gif',
105 $int->updateColAttributes(3, array('width' => '40%',
106 'background' => 'images/servicio_borde_sup_der.gif'));
108 foreach($this->servicio->getHijos() as $s)
111 $s->link = 'servicios.php?servicios='.$s->servicio;
112 elseif($s->necesita_logueo)
113 $s->link = 'login.php?redirect='.$s->servicio;
116 $int->setCellContents(0, 3, new MECON_HTML_Link($s->link, $s->nombre,
118 array('class' => 'servicio_tabla')));
119 $this->addRow(array($int));
124 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
126 array('class' => 'servicio_tabla')));
132 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
134 array('class' => 'servicio_tabla')));
135 $int->setCellContents(0, 2, '');
136 $int->setCellContents(0, 3, '');
137 $this->addRow(array($int));
140 $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif')));
141 return parent::toHTML();
145 // +X2C Operation 170
150 function getCSS() // ~X2C
152 return "css/servicio.css";
156 } // -X2C Class :HTML_Servicio