-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpage.php
72 lines (62 loc) · 2.06 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* This file is part of Kumva.
*
* Kumva is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Kumva is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kumva. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright Rowan Seymour 2010
*
* Purpose: Generic page holder
*/
include_once 'inc/kumva.php';
$name = Request::getGetParam('name');
/**
* Displays a link to the given query
* @param string query the query
* @param string text the text of the link (optional)
*/
function ku_query($query, $text = NULL) {
$text = $text != NULL ? $text : $query;
$query = str_replace(' ', '+', $query);
echo '<a class="query link" href="index.php?q='.$query.'">'.$text.'</a>';
}
/**
* Displays a link to the given page
* @param string name the name of the page
* @param string text the text of the link (optional)
* @param string section the name of an section anchor
*/
function ku_page($name, $text = NULL, $section = NULL) {
$text = $text != NULL ? $text : $name;
$name = str_replace(' ', '_', $name);
echo '<a class="link" href="page.php?name='.$name.($section != NULL ? ('#'.$section) : '').'">'.$text.'</a>';
}
Theme::header();
$page = Theme::getPage($name);
// Output page title and content
if ($page != NULL) {
echo '<div id="info">';
// Output breadcrumb trail for page hierarchy
if ($page->getParent() != NULL)
Templates::pageHierarchy($page);
echo '<h2>'.$page->getTitle().'</h2>';
echo '</div>';
echo '<div id="page">';
$page->doInclude();
echo '</div>';
}
else
echo '<div id="info">No such page!</div>';
Theme::footer();
?>