1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
5 -------------------------------------------------------------------------------
6 This file is part of meconlib.
8 meconlib is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 meconlib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: jue jul 17 15:33:41 ART 2003
22 Autor: Gonzalo Merayo <gmeray@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
27 require_once '../../lib/MECON/HTML/ArbolDB.php';
28 require_once 'DB.php';
30 PEAR::setErrorHandling(PEAR_ERROR_TRIGGER);
32 $dsn = 'mysql://intranet:intranet@bal747f.mecon.ar/intranet';
33 $db =& DB::connect($dsn,true);
37 'tabla' => 'grupo_secciones',
41 'id_padre' => 'grupo_padre',
44 $arbol = new MECON_HTML_ArbolDB($dbdata, 'TITULO', 'noticias.php?grupo=');
45 echo '<link rel="stylesheet" href="'.$arbol->getCSS().'">';
46 echo $arbol->toHTML();
47 echo '<SELECT name="id">';
48 foreach ($arbol->toArray(false) as $id => $val) {
49 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
52 echo '<SELECT name="id">';
53 foreach ($arbol->toArray(true) as $id => $val) {
54 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
57 var_dump($arbol->setActivo(34));
58 echo $arbol->toHTML();
59 echo '<SELECT name="id">';
60 foreach ($arbol->toArray() as $id => $val) {
61 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';