-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (24 loc) · 834 Bytes
/
Copy pathindex.php
File metadata and controls
29 lines (24 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once './src/examples_utils.inc.php';
/**
* Tree structure implemented with an array
* for best performances.
*/
$tree = array('name' => 'examples',
'path' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR,
'group' => '');
$group = (empty($_GET['group']) ? '' : $_GET['group']);
if (!empty($group))
{
$groups = explode('/', $_GET['group']);
array_pop($groups);
$tree['name'] = array_pop($groups);
$tree['group'] = $_GET['group'];
$tree['path'] = $tree['path'].$_GET['group'];
}
createTree($tree, 3); // one level deep tree. Change the 2nd parameter ad libitum.
$page = new lmbMacroTemplate('index.html');
$page->set('crumbs', get_breadcrumbs($group));
$page->set('tree', treeToHtml($tree));
echo $page->render();
?>