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, true, 'LENGTH(nombre)');
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()),//Volvera...
84 $this->addRow(array(' '.$this->servicio->nombre),
85 array('align' => 'center',
86 'class' => 'arboltitulo',
87 'background'=>'images/servicio_cabecera.gif',
89 'class' => 'servicio_titulo_tabla'));
90 $img = new MECON_HTML_Image('images/servicio_bullet.gif');
91 $int =& new HTML_Table(array('width' =>'360',
95 'bgcolor' => '#FFFFFF'));
96 $int->addRow(array($img, '',$img,''),
98 $int->updateColAttributes(0, array('width' => '10%',
99 'background' => 'images/servicio_borde_sup_izq.gif',
101 $int->updateColAttributes(1, array('width' => '40%',
103 'background' => 'images/servicio_borde_sup_cen.gif'));
104 $int->updateColAttributes(2, array('width' => '10%',
105 'background' => 'images/servicio_borde_sup_cen.gif',
107 $int->updateColAttributes(3, array('width' => '40%',
109 'background' => 'images/servicio_borde_sup_der.gif'));
111 foreach($this->servicio->getHijos() as $s)
114 $s->link = 'servicios.php?servicios='.$s->servicio;
115 elseif($s->necesita_logueo)
116 $s->link = 'login.php?redirect='.$s->servicio;
119 $int->setCellContents(0, 3, new MECON_HTML_Link($s->link, $s->nombre,
121 array('class' => 'servicio_tabla')));
122 $this->addRow(array($int));
127 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
129 array('class' => 'servicio_tabla')));
135 $int->setCellContents(0, 1, new MECON_HTML_Link($s->link, $s->nombre,
137 array('class' => 'servicio_tabla')));
138 $int->setCellContents(0, 2, '');
139 $int->setCellContents(0, 3, '');
140 $this->addRow(array($int));
143 $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif')));
144 return parent::toHTML();
148 // +X2C Operation 170
153 function getCSS() // ~X2C
155 return "css/servicio.css";
159 } // -X2C Class :HTML_Servicio