OSDN Git Service

Just a little cleanup
[pukiwiki/pukiwiki.git] / plugin / source.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone
3 // $Id: source.inc.php,v 1.13 2004/11/28 08:52:29 henoheno Exp $
4 //
5 // Source plugin
6
7 // Output source text of the page
8 function plugin_source_action()
9 {
10         global $vars, $_source_messages;
11
12         $page = isset($vars['page']) ? $vars['page'] : '';
13         $vars['refer'] = $page;
14
15         if (! is_page($page) || ! check_readable($page, false, false))
16                 return array('msg' => $_source_messages['msg_notfound'],
17                         'body' => $_source_messages['err_notfound']);
18
19         return array('msg' => $_source_messages['msg_title'],
20                 'body' => '<pre id="source">' .
21                 htmlspecialchars(join('', get_source($page))) . '</pre>');
22 }
23 ?>