root/events/phpframework/wikiskin/skin/pukiwiki.skin.php @ 20880

Revision 20880, 9.1 kB (checked in by sotarok, 6 years ago)
  • charset
Line 
1<?php
2// PukiWiki - Yet another WikiWikiWeb clone.
3// $Id: pukiwiki.skin.php,v 1.48 2006/03/07 14:03:02 henoheno Exp $
4// Copyright (C)
5//   2002-2006 PukiWiki Developers Team
6//   2001-2002 Originally written by yu-ji
7// License: GPL v2 or (at your option) any later version
8//
9// PukiWiki default skin
10
11// ------------------------------------------------------------
12// Settings (define before here, if you want)
13
14// Set site identities
15$_IMAGE['skin']['logo']     = 'pukiwiki.png';
16$_IMAGE['skin']['favicon']  = ''; // Sample: 'image/favicon.ico';
17
18// SKIN_DEFAULT_DISABLE_TOPICPATH
19//   1 = Show reload URL
20//   0 = Show topicpath
21if (! defined('SKIN_DEFAULT_DISABLE_TOPICPATH'))
22    define('SKIN_DEFAULT_DISABLE_TOPICPATH', 1); // 1, 0
23
24// Show / Hide navigation bar UI at your choice
25// NOTE: This is not stop their functionalities!
26if (! defined('PKWK_SKIN_SHOW_NAVBAR'))
27    define('PKWK_SKIN_SHOW_NAVBAR', 1); // 1, 0
28
29// Show / Hide toolbar UI at your choice
30// NOTE: This is not stop their functionalities!
31if (! defined('PKWK_SKIN_SHOW_TOOLBAR'))
32    define('PKWK_SKIN_SHOW_TOOLBAR', 1); // 1, 0
33
34// ------------------------------------------------------------
35// Code start
36
37// Prohibit direct access
38if (! defined('UI_LANG')) die('UI_LANG is not set');
39if (! isset($_LANG)) die('$_LANG is not set');
40if (! defined('PKWK_READONLY')) die('PKWK_READONLY is not set');
41
42$lang  = & $_LANG['skin'];
43$link  = & $_LINK;
44$image = & $_IMAGE['skin'];
45$rw    = ! PKWK_READONLY;
46
47// Decide charset for CSS
48$css_charset = 'iso-8859-1';
49switch(UI_LANG){
50    case 'ja': $css_charset = 'utf-8'; break;
51}
52
53// ------------------------------------------------------------
54// Output
55
56// HTTP headers
57pkwk_common_headers();
58header('Cache-control: no-cache');
59header('Pragma: no-cache');
60header('Content-Type: text/html; charset=' . CONTENT_CHARSET);
61
62// HTML DTD, <html>, and receive content-type
63if (isset($pkwk_dtd)) {
64    $meta_content_type = pkwk_output_dtd($pkwk_dtd);
65} else {
66    $meta_content_type = pkwk_output_dtd();
67}
68
69?>
70<head>
71 <?php echo $meta_content_type ?>
72 <meta http-equiv="content-style-type" content="text/css" />
73<?php if ($nofollow || ! $is_read)  { ?> <meta name="robots" content="NOINDEX,NOFOLLOW" /><?php } ?>
74<?php if (PKWK_ALLOW_JAVASCRIPT && isset($javascript)) { ?> <meta http-equiv="Content-Script-Type" content="text/javascript" /><?php } ?>
75
76 <title><?php echo $title ?> - <?php echo $page_title ?></title>
77
78 <link rel="SHORTCUT ICON" href="<?php echo $image['favicon'] ?>" />
79 <link rel="stylesheet" type="text/css" media="screen" href="skin/pukiwiki.css.php?charset=<?php echo $css_charset ?>" charset="<?php echo $css_charset ?>" />
80 <link rel="stylesheet" type="text/css" media="print"  href="skin/pukiwiki.css.php?charset=<?php echo $css_charset ?>&amp;media=print" charset="<?php echo $css_charset ?>" />
81 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $link['rss'] ?>" /><?php // RSS auto-discovery ?>
82
83<?php if (PKWK_ALLOW_JAVASCRIPT && $trackback_javascript) { ?> <script type="text/javascript" src="skin/trackback.js"></script><?php } ?>
84
85<?php echo $head_tag ?>
86</head>
87<body>
88
89<div id="header">
90 <a href="<?php echo $link['top'] ?>">
91 <img id="logo" src="<?php echo IMAGE_DIR . $image['logo'] ?>" alt="PHP Framework Fight! Wiki" title="PHP Framework Fight! Wiki" class="fleft" /></a>
92
93 <h1 class="title"><?php echo $page ?></h1>
94
95<?php if ($is_page) { ?>
96 <?php if(SKIN_DEFAULT_DISABLE_TOPICPATH) { ?>
97   <a href="<?php echo $link['reload'] ?>" id="header-link"><span class="small"><?php echo $link['reload'] ?></span></a>
98 <?php } else { ?>
99   <span class="small">
100   <?php require_once(PLUGIN_DIR . 'topicpath.inc.php'); echo plugin_topicpath_inline(); ?>
101   </span>
102 <?php } ?>
103<?php } ?>
104
105</div>
106
107<div id="navigator">
108<?php if(PKWK_SKIN_SHOW_NAVBAR) { ?>
109<?php
110function _navigator($key, $value = '', $javascript = ''){
111    $lang = & $GLOBALS['_LANG']['skin'];
112    $link = & $GLOBALS['_LINK'];
113    if (! isset($lang[$key])) { echo 'LANG NOT FOUND'; return FALSE; }
114    if (! isset($link[$key])) { echo 'LINK NOT FOUND'; return FALSE; }
115    if (! PKWK_ALLOW_JAVASCRIPT) $javascript = '';
116
117    echo '<a href="' . $link[$key] . '" ' . $javascript . '>' .
118        (($value === '') ? $lang[$key] : $value) .
119        '</a>';
120
121    return TRUE;
122}
123?>
124 [ <?php _navigator('top') ?> ] &nbsp;
125
126<?php if ($is_page) { ?>
127 [
128 <?php if ($rw) { ?>
129    <?php _navigator('edit') ?> |
130    <?php if ($is_read && $function_freeze) { ?>
131        <?php (! $is_freeze) ? _navigator('freeze') : _navigator('unfreeze') ?> |
132    <?php } ?>
133 <?php } ?>
134 <?php _navigator('diff') ?>
135 <?php if ($do_backup) { ?>
136    | <?php _navigator('backup') ?>
137 <?php } ?>
138 <?php if ($rw && (bool)ini_get('file_uploads')) { ?>
139    | <?php _navigator('upload') ?>
140 <?php } ?>
141 | <?php _navigator('reload') ?>
142 ] &nbsp;
143<?php } ?>
144
145 [
146 <?php if ($rw) { ?>
147    <?php _navigator('new') ?> |
148 <?php } ?>
149   <?php _navigator('list') ?>
150 <?php if (arg_check('list')) { ?>
151    | <?php _navigator('filelist') ?>
152 <?php } ?>
153 | <?php _navigator('search') ?>
154 | <?php _navigator('recent') ?>
155 | <?php _navigator('help')   ?>
156 ]
157
158<?php if ($trackback) { ?> &nbsp;
159 [ <?php _navigator('trackback', $lang['trackback'] . '(' . tb_count($_page) . ')',
160     ($trackback_javascript == 1) ? 'onclick="OpenTrackback(this.href); return false"' : '') ?> ]
161<?php } ?>
162<?php if ($referer)   { ?> &nbsp;
163 [ <?php _navigator('refer') ?> ]
164<?php } ?>
165<?php } // PKWK_SKIN_SHOW_NAVBAR ?>
166</div>
167
168
169<?php if (arg_check('read') && exist_plugin_convert('menu')) { ?>
170<table border="0" style="width:100%">
171 <tr>
172  <td class="menubar" valign="top">
173   <div id="menubar"><?php echo do_plugin_convert('menu') ?></div>
174  </td>
175  <td valign="top">
176   <div id="body"><?php echo $body ?></div>
177  </td>
178 </tr>
179</table>
180<?php } else { ?>
181<div id="body"><?php echo $body ?></div>
182<?php } ?>
183
184<?php if ($notes != '') { ?>
185<div id="note"><?php echo $notes ?></div>
186<?php } ?>
187
188<?php if ($attaches != '') { ?>
189<div id="attach">
190<?php echo $hr ?>
191<?php echo $attaches ?>
192</div>
193<?php } ?>
194
195<?php if (PKWK_SKIN_SHOW_TOOLBAR) { ?>
196<!-- Toolbar -->
197<div id="toolbar">
198<?php
199
200// Set toolbar-specific images
201$_IMAGE['skin']['reload']   = 'reload.png';
202$_IMAGE['skin']['new']      = 'new.png';
203$_IMAGE['skin']['edit']     = 'edit.png';
204$_IMAGE['skin']['freeze']   = 'freeze.png';
205$_IMAGE['skin']['unfreeze'] = 'unfreeze.png';
206$_IMAGE['skin']['diff']     = 'diff.png';
207$_IMAGE['skin']['upload']   = 'file.png';
208$_IMAGE['skin']['copy']     = 'copy.png';
209$_IMAGE['skin']['rename']   = 'rename.png';
210$_IMAGE['skin']['top']      = 'top.png';
211$_IMAGE['skin']['list']     = 'list.png';
212$_IMAGE['skin']['search']   = 'search.png';
213$_IMAGE['skin']['recent']   = 'recentchanges.png';
214$_IMAGE['skin']['backup']   = 'backup.png';
215$_IMAGE['skin']['help']     = 'help.png';
216$_IMAGE['skin']['rss']      = 'rss.png';
217$_IMAGE['skin']['rss10']    = & $_IMAGE['skin']['rss'];
218$_IMAGE['skin']['rss20']    = 'rss20.png';
219$_IMAGE['skin']['rdf']      = 'rdf.png';
220
221function _toolbar($key, $x = 20, $y = 20){
222    $lang  = & $GLOBALS['_LANG']['skin'];
223    $link  = & $GLOBALS['_LINK'];
224    $image = & $GLOBALS['_IMAGE']['skin'];
225    if (! isset($lang[$key]) ) { echo 'LANG NOT FOUND';  return FALSE; }
226    if (! isset($link[$key]) ) { echo 'LINK NOT FOUND';  return FALSE; }
227    if (! isset($image[$key])) { echo 'IMAGE NOT FOUND'; return FALSE; }
228
229    echo '<a href="' . $link[$key] . '">' .
230        '<img src="' . IMAGE_DIR . $image[$key] . '" width="' . $x . '" height="' . $y . '" ' .
231            'alt="' . $lang[$key] . '" title="' . $lang[$key] . '" />' .
232        '</a>';
233    return TRUE;
234}
235?>
236 <?php _toolbar('top') ?>
237
238<?php if ($is_page) { ?>
239 &nbsp;
240 <?php if ($rw) { ?>
241    <?php _toolbar('edit') ?>
242    <?php if ($is_read && $function_freeze) { ?>
243        <?php if (! $is_freeze) { _toolbar('freeze'); } else { _toolbar('unfreeze'); } ?>
244    <?php } ?>
245 <?php } ?>
246 <?php _toolbar('diff') ?>
247<?php if ($do_backup) { ?>
248    <?php _toolbar('backup') ?>
249<?php } ?>
250<?php if ($rw) { ?>
251    <?php if ((bool)ini_get('file_uploads')) { ?>
252        <?php _toolbar('upload') ?>
253    <?php } ?>
254    <?php _toolbar('copy') ?>
255    <?php _toolbar('rename') ?>
256<?php } ?>
257 <?php _toolbar('reload') ?>
258<?php } ?>
259 &nbsp;
260<?php if ($rw) { ?>
261    <?php _toolbar('new') ?>
262<?php } ?>
263 <?php _toolbar('list')   ?>
264 <?php _toolbar('search') ?>
265 <?php _toolbar('recent') ?>
266 &nbsp; <?php _toolbar('help') ?>
267 &nbsp; <?php _toolbar('rss10', 36, 14) ?>
268</div>
269<?php } // PKWK_SKIN_SHOW_TOOLBAR ?>
270
271<?php if ($lastmodified != '') { ?>
272<div id="lastmodified">Last-modified: <?php echo $lastmodified ?></div>
273<?php } ?>
274
275<?php if ($related != '') { ?>
276<div id="related">Link: <?php echo $related ?></div>
277<?php } ?>
278
279<div id="footer">
280 Site admin: <a href="<?php echo $modifierlink ?>"><?php echo $modifier ?></a><p />
281 Produced by <a href="http://d.hatena.ne.jp/sotarok/">sotarok</a> with <a href="http://nequal.jp/">nequal</a><p />
282 <?php echo S_COPYRIGHT ?>.
283 Powered by PHP <?php echo PHP_VERSION ?>. HTML convert time: <?php echo $taketime ?> sec.
284</div>
285
286<script type="text/javascript">
287var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
288document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
289</script>
290<script type="text/javascript">
291var pageTracker = _gat._getTracker("UA-1166518-16");
292pageTracker._initData();
293pageTracker._trackPageview();
294</script>
295
296</body>
297</html>
Note: See TracBrowser for help on using the browser.