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 // +--------------------------------------------------------------------+
30 require_once 'MECON/HTML/Image.php';
31 require_once 'MECON/HTML/Link.php';
32 require_once 'intranetdb.php';
33 require_once 'AI/Servicio.php';
36 require_once 'HTML/Table.php';
39 // +X2C Class 165 :HTML_Servicio
43 class HTML_Servicio extends HTML_Table {
53 function HTML_Servicio($seccion) // ~X2C
55 parent::HTML_Table(array('width' =>'360',
59 'bgcolor' => '#FFFFFF'));
60 $db = IntranetDB::connect();
61 $this->servicio = new AI_Servicio($seccion);
62 $this->servicio->cargar($db);
63 $this->servicio->cargarHijos($db, true, AI_SERVICIO_ORDEN_LONG_NOMBRE);
72 function toHTML() // ~X2C
74 if($this->servicio->link == '')
75 $this->servicio->link = $_SERVER['PHP_SELF'].'?servicios='.$this->servicio->servicio;
76 elseif($this->servicio->necesita_logueo)
77 $this->servicio->link = 'login?redirect='.$this->servicio->servicio;
78 $l = new MECON_HTML_Link($this->servicio->link, $this->servicio->nombre, array(),
79 array('class' => 'servicio_titulo_tabla'));
80 //$this->addRow(array(' '.$l->toHTML()),//Volvera...
81 $this->addRow(array(' '.$this->servicio->nombre),
82 array('align' => 'center',
83 'class' => 'arboltitulo',
84 'background'=>'images/servicio_cabecera.gif',
86 'class' => 'servicio_titulo_tabla'));
87 $img = new MECON_HTML_Image('images/servicio_bullet.gif');
88 $int =& new HTML_Table(array('width' =>'360',
92 'bgcolor' => '#FFFFFF'));
93 $int->addRow(array($img, '',$img,''),
95 $int->updateColAttributes(0, array('width' => '10%',
96 'background' => 'images/servicio_borde_sup_izq.gif',
98 $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%',
106 'background' => 'images/servicio_borde_sup_der.gif'));
108 foreach($this->servicio->getHijos() as $s)
111 $s->link = $_SERVER['PHP_SELF'].'?servicios='.$s->servicio;
112 elseif($s->necesita_logueo)
113 $s->link = 'login?redirect='.$s->servicio;
114 $link = new MECON_HTML_Link($s->link, $s->nombre,
116 array('class' => 'servicio_tabla'));
117 if ($s->ventana_nueva) {
118 $link->updateAttributes(array(
119 // XXX - no lo pongo porque no le veo sentido para links externos sacarles las barras y eso.
120 //'OnClick' => "javascript:window.open('{$s->link}','serv{$s->servicio}',"
121 // . "'width=800,height=600,scrollbars=yes');return false;",
122 'target' => '_blank',
127 $int->setCellContents(0, 3, $link);
128 $this->addRow(array($int));
133 $int->setCellContents(0, 1, $link);
139 $int->setCellContents(0, 1, $link);
140 $int->setCellContents(0, 2, '');
141 $int->setCellContents(0, 3, '');
142 $this->addRow(array($int));
145 $this->addRow(array(new MECON_HTML_Image('images/servicio_borde_inf.gif')));
146 return parent::toHTML();
150 // +X2C Operation 170
155 function getCSS() // ~X2C
157 return 'css/servicio.css';
161 } // -X2C Class :HTML_Servicio