1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 tw=80 fdm=marker:
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:32:52 ART 2003
22 Autor: Gonzalo Merayo <gmeray@mecon.gov.ar>
23 -------------------------------------------------------------------------------
24 $Id: Arbol.php 237 2003-07-17 22:41:48Z mmarre $
25 -----------------------------------------------------------------------------*/
27 require_once '../../lib/MECON/HTML/Arbol.php';
29 $dat = array( // Datos {{{
31 'titulo' => 'Nivel0a',
34 'sub' => array(//sub0 {{{
36 'titulo' => 'Nivel1a',
39 'sub' => array(//sub1 {{{
41 'titulo' => 'Nivel3a',
47 'titulo' => 'Nivel3b',
50 'sub' => array(//sub2 {{{
59 'titulo' => 'Nivel3c',
66 'titulo' => 'Nivel1b',
72 'titulo' => 'Nivel1c',
79 'titulo' => 'Nivel0b',
84 'titulo' => 'Nivel0c',
90 $arbol = new MECON_HTML_Arbol($dat, 'MI TITULO', '?raiz=');
91 echo '<link rel="stylesheet" href="'.$arbol->getCSS().'">';
92 echo $arbol->toHTML();
93 echo '<SELECT name="id">';
94 foreach ($arbol->toArray(false) as $id => $val) {
95 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
98 echo '<SELECT name="id">';
99 foreach ($arbol->toArray(true) as $id => $val) {
100 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
103 $arbol->setActivo(16);
104 echo $arbol->toHTML();
105 echo '<SELECT name="id">';
106 foreach ($arbol->toArray() as $id => $val) {
107 echo '<OPTION value="'.$id.'">'.$val.'</OPTION>';
111 echo $arbol->toString();