OSDN Git Service

BugTrack/2367 CSS reformat
[pukiwiki/pukiwiki.git] / plugin / read.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // read.inc.php
4 // Copyright 2003-2017 PukiWiki Development Team
5 // License: GPL v2 or (at your option) any later version
6 //
7 // Read plugin: Show a page and InterWiki
8
9 function plugin_read_action()
10 {
11         global $vars, $_title_invalidwn, $_msg_invalidiwn;
12
13         $page = isset($vars['page']) ? $vars['page'] : '';
14         if (is_page($page)) {
15                 // Show this page
16                 check_readable($page, true, true);
17                 header_lastmod($page);
18                 is_pagelist_cache_enabled(true); // Enable get_existpage() cache
19                 return array('msg'=>'', 'body'=>'');
20
21         } else if (! PKWK_SAFE_MODE && is_interwiki($page)) {
22                 return do_plugin_action('interwiki'); // Process InterWikiName
23
24         } else if (is_pagename($page)) {
25                 $vars['cmd'] = 'edit';
26                 return do_plugin_action('edit'); // Page not found, then show edit form
27
28         } else {
29                 // Invalid page name
30                 return array(
31                         'msg'=>$_title_invalidwn,
32                         'body'=>str_replace('$1', htmlsc($page),
33                                 str_replace('$2', 'WikiName', $_msg_invalidiwn))
34                 );
35         }
36 }