+<?php
+// vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+// +--------------------------------------------------------------------+
+// | Ministerio de Economía |
+// | AI (Administrador de Intranet) |
+// +--------------------------------------------------------------------+
+// | This file is part of AI. |
+// | |
+// | AI is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published |
+// | by the Free Software Foundation; either version 2 of the License, |
+// | or (at your option) any later version. |
+// | |
+// | AI is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with Hooks; if not, write to the Free Software Foundation, |
+// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
+// +--------------------------------------------------------------------+
+// | Creado: Mon Jul 28 13:52:40 2003 |
+// | Autor: Leandro Lucarella <llucar@mecon.gov.ar> |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'MECON/HTML/Arbol/ArbolDB.php';
+// ~X2C
+
+// +X2C Class 535 :AI_Arbol
+/**
+ * Arbol para generar los menes.
+ *
+ * @package AI_Local
+ * @access public
+ */
+class AI_Arbol extends HTML_ArbolDB {
+ // ~X2C
+
+ // +X2C Operation 536
+ /**
+ * Constructor.
+ *
+ * @param mixed $objeto Objeto del cual generar el ?bol. Puede ser AI_GrupoSecciones, AI_Servicio o AI_Sistema.
+ * @param DB &$db Base de datos de donde sacar los datos para el ?bol.
+ *
+ * @return void
+ * @access public
+ */
+ function AI_Arbol($objeto, &$db) // ~X2C
+ {
+ switch (get_class($objeto)) {
+ case 'ai_gruposecciones':
+ $tipo = 'grupo';
+ $titulo = 'NOTICIAS';
+ $tabla = 'grupo_secciones';
+ break;
+ case 'ai_servicio':
+ $tipo = 'servicio';
+ $titulo = 'SERVICIOS';
+ $tabla = $tipo;
+ break;
+ case 'ai_sistema':
+ $tipo = 'sistema';
+ $titulo = 'SISTEMAS';
+ $tabla = $tipo;
+ break;
+ }
+ $dbdata = array(
+ 'db' => &$db,
+ 'tabla' => $tabla,
+ 'id' => $tipo,
+ 'nombre' => 'nombre',
+ 'order' => 'asc',
+ 'id_activo' => $objeto->$tipo,
+ );
+ if ($tipo == 'grupo' or $tipo == 'servicio') {
+ $dbdata['id_padre'] = $tipo . '_padre';
+ } elseif ($tipo == 'sistema') { // FIXME - horrible!!!
+ $dbdata =
+ array(
+ 'tabla' => "intranet.$tabla as A, samurai.sistema as S",
+ 'id' => "A.$tipo",
+ 'nombre' => 'S.nombre_sistema',
+ 'where' => 'S.id_sistema = A.sistema AND S.estado = 1',
+ )
+ + $dbdata;
+ }
+ parent::HTML_ArbolDB($dbdata, $titulo, $tipo.'?accion='.AI_MODIF.'&id=');
+ }
+ // -X2C
+
+} // -X2C Class :AI_Arbol
+
+?>
\ No newline at end of file