forked from YesWiki/yeswiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
executable file
·141 lines (127 loc) · 5.23 KB
/
header.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
<?php
/* header.php
Copyright (c) 2002, Hendrik Mans <[email protected]>
Copyright 2002, 2003 David DELON
Copyright 2002, 2003, 2004, 2006 Charles NEPOTE
Copyright 2002 Patrick PAUL
Copyright 2003 Eric DELORD
Copyright 2004, 2006, 2007 Didier LOISEAU
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$charset = 'iso-8859-1';
// Page info
$page_name = $this->GetPageTag();
$page_addr = $this->href();
header("Content-Type: text/html; charset=$charset");
// <head> : metas & style
if ($this->GetMethod() != 'show'
|| !empty($_REQUEST['phrase'])
|| !empty($_REQUEST['show_comments'])
|| isset($_REQUEST['time']))
{
$additionnal_metas = "<meta name=\"robots\" content=\"noindex, nofollow\" />\n";
}
else
{
$additionnal_metas = '';
}
$meta_keywords = $this->GetConfigValue("meta_keywords");
$meta_description = $this->GetConfigValue("meta_description");
$imported_style = isset($_COOKIE["sitestyle"]) ? htmlspecialchars($_COOKIE["sitestyle"], ENT_COMPAT, TEMPLATES_DEFAULT_CHARSET) : 'wakka';
// Page contents
$body_attr = ($message = $this->GetMessage()) ? "onLoad=\"alert('".addslashes($message)."');\" " : "";
$wiki_name = $this->GetWakkaName();
$page_search = $this->href('', 'RechercheTexte', 'phrase=' . urlencode($page_name));
$root_page = $this->ComposeLinkToPage($this->config["root_page"]);
$navigation_links = $this->config["navigation_links"] ? $this->Format($this->config["navigation_links"]) : "";
$user_name = $this->Format($this->GetUserName());
$disconnect_link = $this->GetUser() ? '(<a href="' . $this->href('', 'ParametresUtilisateur', 'action=logout') . "\">Déconnexion</a>)\n" : '';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<meta name="keywords" content="<?php echo $meta_keywords ?>" />
<meta name="description" content="<?php echo $meta_description ?>" />
<?php echo $additionnal_metas ?>
<title><?php echo "$wiki_name:$page_name" ?></title>
<link rel="stylesheet" type="text/css" media="screen" href="wakka.basic.css" />
<style type="text/css" media="all">
<!--
@import url(<?php echo $imported_style ?>.css);
-->
</style>
<script type="text/javascript">
<!--
function fKeyDown(e) {
if (e == null) e = event;
if (e.keyCode == 9) {
if (typeof(document["selection"]) != "undefined") { // ie
e.returnValue = false;
document.selection.createRange().text = String.fromCharCode(9);
} else if (typeof(this["setSelectionRange"]) != "undefined") { // other
var start = this.selectionStart;
this.value = this.value.substring(0, start) + String.fromCharCode(9) + this.value.substring(this.selectionEnd);
this.setSelectionRange(start + 1, start + 1);
return false;
}
}
return true;
}
function doubleClickEdit(e)
{
if (e == null) e = event;
source = document.all ? e.srcElement : e.target;
if( source.nodeName == "TEXTAREA" || source.nodeName == "INPUT") return;
document.location = '<?php echo addslashes($this->Href('edit')) ?>';
}
/** invert all checkboxes that are descendant of a given parent */
function invert_selection(parent_id)
{
items = document.getElementById(parent_id).getElementsByTagName('input');
for (i = 0; i < items.length; i++)
{
item = items[i];
if (item && item.type == 'checkbox')
{
item.checked = !item.checked;
}
}
return false;
}
//-->
</script>
</head>
<body <?php echo $body_attr ?> >
<div style="display: none;">
<a href="<?php echo $page_addr ?>/resetstyle" accesskey="7"></a>
</div>
<h1 class="wiki_name"><?php echo $wiki_name ?></h1>
<h1 class="page_name">
<a href="<?php echo $page_search ?>"><?php echo $page_name ?></a>
</h1>
<div class="header">
<?php echo $root_page ?> ::
<?php echo $navigation_links ?> ::
Vous êtes <?php echo $user_name ?> <?php echo $disconnect_link ?>
</div>