blob: 1082f5dddff4eb3eb94b81305480a9304892995d (
plain)
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
|
<?php
ini_set('include_path', '../pearlib');
require 'HTML/Template/Sigma.php';
$tpl =& new HTML_Template_Sigma('../templates/html');
$tpl->loadTemplateFile('index.html');
$groups = json_decode(file_get_contents("../templates/groups.json"), true);
$lists = json_decode(file_get_contents("../templates/lists.json"), true);
ksort($groups);
foreach ($groups as $group) {
/* This is for index.html. We want a title for each group, and
* the lists that are part of it. */
$tpl->parse('listgroup');
$tpl->setCurrentBlock('listgroup');
$tpl->setVariable('groupname', $group["name"]);
foreach ($group["lists"] as $list) {
$tpl->setCurrentBlock('list');
$tpl->setVariable('name', $list);
$tpl->setVariable('description', $lists[$list]["description"]);
$tpl->parseCurrentBlock();
}
/* This is for the menu on top_config.html. On this page we only
* link to the first list on each group. */
$tpl->parse('top_listgroup');
$tpl->setCurrentBlock('top_listgroup');
$tpl->setVariable('top_groupname', $group["name"]);
$tpl->setVariable('top_group_firstlist', $group["lists"][0]);
}
$tpl->parseCurrentBlock();
$tpl->show();
?>
|