2 // vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de Economía |
5 // | AI (Administrador de Intranet) |
6 // +--------------------------------------------------------------------+
7 // | This file is part of AI. |
9 // | AI 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 // | AI 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: Mon Jul 28 13:52:40 2003 |
24 // | Autor: Leandro Lucarella <llucar@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
31 require_once 'MECON/HTML/ArbolDB.php';
34 // +X2C Class 535 :AI_Arbol
36 * Arbol para generar los menúes.
41 class AI_Arbol extends MECON_HTML_ArbolDB {
48 * @param mixed $objeto Objeto del cual generar el árbol. Puede ser AI_GrupoSecciones, AI_Servicio o AI_Sistema.
49 * @param DB &$db Base de datos de donde sacar los datos para el árbol.
50 * @param bool $expandir Indica si debe expandirse el árbol.
55 function AI_Arbol($objeto, &$db, $expandir = true) // ~X2C
57 switch (get_class($objeto)) {
58 case 'ai_gruposecciones':
61 $tabla = 'grupo_secciones';
65 $titulo = 'SERVICIOS';
81 'id_activo' => $objeto->$tipo,
83 if ($tipo == 'grupo' or $tipo == 'servicio') {
84 $dbdata['id_padre'] = $tipo . '_padre';
85 } elseif ($tipo == 'sistema') { // FIXME - es bastante poco ortodoxo esto.
88 'tabla' => "intranet.$tabla as A, samurai.sistema as S",
90 'nombre' => 'S.nombre_sistema',
91 'where' => 'S.id_sistema = A.sistema AND S.estado = 1',
95 parent::MECON_HTML_ArbolDB($dbdata, $titulo, $tipo.'?accion='.AI_MODIF.'&id=', $expandir);
99 } // -X2C Class :AI_Arbol