-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree-node-list.xml.php
47 lines (43 loc) · 938 Bytes
/
tree-node-list.xml.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
include_once 'flesh/__starter.php';
header("Content-Type: text/xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
$items = array();
$parentId = @$_REQUEST['pid'] ?: null;
if (!$parentId)
{
$items = Config::get("dict-tree");
}
else
{
if ($map = Config::get("dict-tree-map/{$parentId}"))
{
}
else
{
$items = Config::get("dict-tree/{$parentId}/childs");
}
}
echo '<tree>';
foreach ($items AS $id => $item)
{
$icon = @$item['icon'] ?: Config::get('tree-default-icon/'. (!empty($item['childs']) ? 'dir' : 'node'));
echo '
<tree
text="'. $item['title'] .'"
id="'. $id .'"
icon="'. $icon .'"
openIcon="'. $icon .'"';
if (!empty($item['childs']))
{
echo ' src="/tree-node-list.xml.php?pid='. $id .'"';
}
if (@$item['type'] == 'dict')
{
echo ' action="#'. $item['dict'] .'"';
}
echo '
/>';
}
echo '
</tree>';