+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ Ministerio de Economía
+ meconlib
+-------------------------------------------------------------------------------
+This file is part of meconlib.
+
+meconlib 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.
+
+meconlib 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; if not,
+write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Creado: jue jul 17 15:33:41 ART 2003
+Autor: Gonzalo Merayo <gmeray@mecon.gov.ar>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+require_once '../../lib/MECON/HTML/Arbol/ArbolDB.php';
+require_once 'DB.php';
+
+PEAR::setErrorHandling(PEAR_ERROR_TRIGGER);
+
+$dsn = 'mysql://intranet:intranet@bal747f.mecon.ar/intranet';
+$db =& DB::connect($dsn,true);
+
+$dbdata = array(
+ 'db' => &$db,
+ 'tabla' => 'grupo_secciones',
+ 'id' => 'grupo',
+ 'nombre' => 'nombre',
+ 'id_padre' => 'grupo_padre',
+);
+
+$arbol = new HTML_ArbolDB($dbdata, 'TITULO', 'noticias.php?grupo=');
+echo '<link rel="stylesheet" href="'.$arbol->getCSS().'">';
+echo $arbol->toHTML();
+echo '<SELECT name="id">';
+foreach ($arbol->toArray(false) as $id => $val) {
+ echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
+}
+echo '</SELECT>';
+echo '<SELECT name="id">';
+foreach ($arbol->toArray(true) as $id => $val) {
+ echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
+}
+echo '</SELECT>';
+var_dump($arbol->setActivado(34));
+echo $arbol->toHTML();
+echo '<SELECT name="id">';
+foreach ($arbol->toArray() as $id => $val) {
+ echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
+}
+echo '</SELECT>';
+
+?>