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
43 * @package sistema_local_lib
46 class HTML_Servicio extends HTML_Table {
56 function HTML_Servicio($seccion) // ~X2C
58 parent::HTML_Table(array('width' =>'360',
62 'bgcolor' => '#FFFFFF',
63 'class' => 'servicio_tabla'));
64 $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME
65 $this->servicio = new AI_Servicio($seccion);
66 $this->servicio->cargar($bd);
67 $this->servicio->cargarHijos($bd, true, AI_SERVICIO_ORDEN_LONG_NOMBRE);
76 function toHTML() // ~X2C
78 if($this->servicio->link == '')
79 $this->servicio->link = 'servicios.php?servicios='.$this->servicio->servicio;
80 elseif($this->servicio->necesita_logueo)
81 $this->servicio->link = 'login.php?redirect='.$this->servicio->servicio;
82 $l = new MECON_HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
83 array('class' => 'servicio_titulo_tabla'));
84 //$this->addRow(array(' '.$l->toHTML()),//Volvera...
85 $this->addRow(array(' '.$this->servicio->nombre),
86 array('align' => 'center',
87 'class' => 'arboltitulo',
88 'background'=>'images/servicio_cabecera.gif',
90 'class' => 'servicio_titulo_tabla'));
91 $img = new MECON_HTML_Image('images/servicio_bullet.gif');
92 $int =& new HTML_Table(array('width' =>'360',
96 'bgcolor' => '#FFFFFF'));
97 $int->addRow(array($img, '',$img,''),
99 $int->updateColAttributes(0, array('width' => '10%',
100 'background' => 'images/servicio_borde_sup_izq.gif',
102 $int->updateColAttributes(1, array('width' => '40%',
104 'background' => 'images/servicio_borde_sup_cen.gif'));
105 $int->updateColAttributes(2, array('width' => '10%',
106 'background' => 'images/servicio_borde_sup_cen.gif',
108 $int->updateColAttributes(3, array('width' => '40%',
110 'background' => 'images/servicio_borde_sup_der.gif'));
112 foreach($this->servicio->getHijos() as $s)
115 $s->link = 'servicios.php?servicios='.$s->servicio;
116 elseif($s->necesita_logueo)
117 $s->link = 'login.php?redirect='.$s->servicio;
120 $int->setCellContents(0, 3, new MECON_HTML_Link($s->link, $s->nombre,
122 array('class' => 'servicio_tabla')));
123 $this->addRow(array($int));
128 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
130 array('class' => 'servicio_tabla')));
136 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
138 array('class' => 'servicio_tabla')));
139 $int->setCellContents(0, 2, '');
140 $int->setCellContents(0, 3, '');
141 $this->addRow(array($int));
144 $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif')));
145 return parent::toHTML();
149 // +X2C Operation 170
154 function getCSS() // ~X2C
156 return "css/servicio.css";
160 } // -X2C Class :HTML_Servicio