4 require_once __DIR__
. '/_inc.php';
6 if ((trim(utils
::get('parent')) == '') ||
!is_numeric(utils
::get('parent')))
8 throw new UserException('Numéro de page parent invalide.');
11 $parent = (int) utils
::get('parent');
13 $tpl->assign('parent', $parent);
14 $tpl->assign('list', $wiki->listBackParentTree($parent));
16 function tpl_display_tree($params)
18 if (isset($params['tree']))
19 $tree = $params['tree'];
25 foreach ($tree as $node)
27 $out .= '<li'.(utils
::get('parent') == $node['id'] ?
' class="current"' : '').'><h3><a href="?parent='.(int)$node['id'].'">'.htmlspecialchars($node['titre'], ENT_QUOTES
, 'UTF-8', false).'</a></h3>';
29 if (!empty($node['children']))
31 $out .= tpl_display_tree($node['children']);
42 $tpl->register_function('display_tree', 'Garradin\tpl_display_tree');
44 $tpl->display('admin/wiki/_chercher_parent.tpl');