forked from reidab/osbp_dokuwiki_theme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tpl_functions.php
141 lines (122 loc) · 3.34 KB
/
tpl_functions.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/**
* functions for mmClean Template
*
* License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
* @author: Marcin Mierzejewski <[email protected]>
* @homepage: http://www.mierzejewski.net
*/
require_once('conf.php');
/**
* Displays the menu1
*
*/
function tpl_menu1()
{
global $conf, $ID, $REV, $INFO;
print p_wiki_xhtml("menu1", '', false);
if ( $INFO['perm'] > AUTH_READ )
{
print '<ul><li><a href="?id=menu1&do=edit" class="wikilink1" title="Edit">Edit</a></li></ul>';
}
}
/**
* Displays the bottombar
*
*/
function tpl_bottombar()
{
global $INFO,$ID,$lang;
$perm = $INFO['perm'];
echo '<ul>';
echo '<li class="pre-bulletted"><a href="?do=recent" class="interwiki" title="'.$lang['btn_rec'].'">'.$lang['btn_recent'].'</a></li>';
if($perm > AUTH_READ) {
echo '<li class="pre-bulletted"><a href="?do=revisions" class="interwiki" title="'.$lang['btn_revs'].'">'.$lang['btn_revs'].'</a></li>';
if(file_exists(wikiFN($ID))) {
echo '<li class="pre-bulletted"><a href="?id='.$ID.'&do=edit" class="interwiki" title="'.$lang['btn_edit'].'">'.$lang['btn_edit'].'</a></li>';
} else {
echo '<li class="pre-bulletted"><a href="?id='.$ID.'&do=edit" class="interwiki" title="'.$lang['btn_create'].'">'.$lang['btn_create'].'</a></li>';
}
} else {
echo '<li class="pre-bulletted"><a href="?id='.$ID.'&do=edit" class="interwiki" title="'.$lang['btn_source'].'">'.$lang['btn_source'].'</a></li>';
}
if($perm > AUTH_WRITE) {
echo '<li class="pre-bulletted"><a href="?do=admin" class="interwiki" title="'.$lang['btn_admin'].'">'.$lang['btn_admin'].'</a></li>';
}
if(isset($INFO['userinfo']['name'])) {
echo '<li class="pre-bulletted"><a href="?do=profile" class="interwiki" title="'.$lang['btn_profile'].'">'.$lang['btn_profile'].'</a></li>';
echo '<li class="pre-bulletted"><a href="?do=logout" class="interwiki" title="'.$lang['btn_logout'].'">'.$lang['btn_logout'].'</a></li>';
} else {
echo '<li class="pre-bulletted"><a href="?do=login" class="interwiki" title="'.$lang['btn_login'].'">'.$lang['btn_login'].'</a></li>';
}
echo '</ul>';
}
/**
* Displays the menu2
*
*/
function tpl_menu2()
{
global $conf, $ID, $REV, $INFO, $lang;
$currID = false;
if ( $conf['tpl_mmClean']['menu2Permanent'] )
{
$path = "";
}
else
{
if ( false != strpos($ID, ":") )
{
$path = substr($ID, 0, strpos($ID, ":"));
}
else
{
$path = $ID;
}
$path .= ":";
}
print "<h1>";
print tpl_pagetitle();
print "</h1>";
print p_wiki_xhtml($path."menu2", '', false);
if ( $INFO['perm'] > AUTH_READ )
{
print '<ul><li><a href="?id='.$path.'menu2&do=edit" class="wikilink1" title="Edit"><b>Edit</b></a></li></ul>';
}
}
/**
* Check if menu2 is present for this page
*
*/
function tpl_isMenu2()
{
global $conf, $ID, $REV, $INFO, $ACT;
if ( $ACT == 'edit' || $ACT == 'preview' )
{
return false;
}
// Permanent Sidebar
if ( true == $conf['tpl_mmClean']['menu2Permanent'] && true == file_exists( (wikiFN("menu2") ) ) )
{
return true;
}
if ( false != strpos($ID, ":") )
{
$path = substr($ID, 0, strpos($ID, ":"));
}
else
{
$path = $ID;
}
$path .= ":";
if ( file_exists(wikiFN($path."menu2")) )
{
return true;
}
else
{
return false;
}
}
?>