-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage.php~
35 lines (28 loc) · 1.18 KB
/
page.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
<?php
require_once('snaf/all.php');
snaf_load_components(array('itemlist','list','layout'));
$page = isset($_REQUEST['id'])?$_REQUEST['id']:false;
$status = isset($_REQUEST['status'])?$_REQUEST['status']:false;
$tag = isset($_REQUEST['tag'])?$_REQUEST['tag']:false;
$status_match = isset($_REQUEST['status_match'])?$_REQUEST['status_match']:false;
if ($page || $status || $tag || $status_match) {
$list = get_itemlist_data(array('page'=>$page,'status'=>$status,'tag'=>$tag,'sort'=>$_REQUEST['sort'],'status_match' => $status_match));
$statuses = items::get_statuses();
if ($page) $title = 'Page '.$page.' | ';
if ($status) $title .= $statuses[$status].' Items';
if ($status_match) $title .= "Items needing " . $status_match;
else $title .= 'All Items';
if ($tag) $title.= ' tagged "'.$tag.'"';
} else {
$list = get_list_data($_REQUEST);
$title = 'The List';
if ($_REQUEST['points']) $title.=' <a href="?">by Items</a> | by Points';
else $title.=' by Items | <a href="?points=1">by Points</a>';
}
$layout = array();
$layout['TITLE'] = $title;
$itemlist['TITLE'] = $layout['TITLE'];
$layout['BODY'] = array($list);
$top_layout = array('BODY'=>array($layout));
echo build_layout_html($layout);
?>