[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * $Horde: horde/admin/datatree.php,v 1.7.2.4 2006/02/01 09:30:46 selsky Exp $ 4 * 5 * Copyright 2004-2006 Jan Schneider <jan@horde.org> 6 * 7 * See the enclosed file COPYING for license information (LGPL). If you 8 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 9 */ 10 11 function addTree($parent, $parent_id, $indent = 1) 12 { 13 global $datatree, $tree; 14 15 $nodes = $datatree->getById(DATATREE_FORMAT_FLAT, $parent_id, true, $parent, 1); 16 $expanded = $tree->isExpanded($parent); 17 $url = Horde::url('datatree.php'); 18 foreach ($nodes as $id => $node) { 19 if ($id == $parent_id) { 20 continue; 21 } 22 $tree->addNode($parent . ':' . $id, $parent, $datatree->getShortName($node), $indent, false, array('url' => Util::addParameter($url, 'show', $datatree->getParam('group') . ':' . $id) . '#show')); 23 if ($expanded) { 24 addTree($parent . ':' . $id, $id, $indent + 1); 25 } 26 } 27 } 28 29 @define('HORDE_BASE', dirname(__FILE__) . '/..'); 30 require_once HORDE_BASE . '/lib/base.php'; 31 require_once 'Horde/Menu.php'; 32 require_once 'Horde/Help.php'; 33 require_once 'Horde/Tree.php'; 34 require_once 'Horde/DataTree.php'; 35 36 if (!Auth::isAdmin()) { 37 Horde::authenticationFailureRedirect(); 38 } 39 40 $tree = &Horde_Tree::factory('datatree', 'html'); 41 $tree->setOption('alternate', true); 42 43 $driver = $conf['datatree']['driver']; 44 $config = Horde::getDriverConfig('datatree', $conf['datatree']['driver']); 45 $datatree = &DataTree::singleton($conf['datatree']['driver']); 46 $roots = $datatree->getGroups(); 47 48 if (is_a($roots, 'PEAR_Error')) { 49 $notification->push($roots); 50 } else { 51 foreach ($roots as $root) { 52 $tree->addNode($root, null, $root, 0, false); 53 $datatree = &DataTree::singleton($driver, array_merge($config, array('group' => $root))); 54 addTree($root, DATATREE_ROOT); 55 } 56 } 57 58 if ($show = Util::getFormData('show')) { 59 list($root, $id) = explode(':', $show); 60 $datatree = &DataTree::singleton($driver, array_merge($config, array('group' => $root))); 61 $data = $datatree->getData($id); 62 $attributes = $datatree->getAttributes($id); 63 } 64 65 $title = _("DataTree Browser"); 66 require HORDE_TEMPLATES . '/common-header.inc'; 67 require HORDE_TEMPLATES . '/admin/common-header.inc'; 68 $notification->notify(); 69 $tree->renderTree(); 70 if ($show) { 71 echo '<br /><div class="text" style="white-space:pre"><a id="show"></a>'; 72 print_r($data); 73 print_r($attributes); 74 echo '</div>'; 75 } 76 require HORDE_TEMPLATES . '/common-footer.inc';
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |