2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
5 // $Id: include.inc.php,v 1.12 2004/08/06 16:06:31 henoheno Exp $
8 // ¥Ú¡¼¥¸¤ò¥¤¥ó¥¯¥ë¡¼¥É¤¹¤ë
9 function plugin_include_convert()
11 global $script, $vars, $get, $post, $menubar, $_msg_include_restrict;
12 static $included = array();
15 if (func_num_args() == 0) return;
16 list($page) = func_get_args();
17 $page = strip_bracket($page);
20 $self = isset($vars['page']) ? $vars['page'] : '';
21 $included[$self] = TRUE;
24 if (isset($included[$page]) || ! is_page($page)) return '';
26 // One page, only one time, at a time
27 $included[$page] = TRUE;
29 // Include a $page, that probably includes more pages
30 $get['page'] = $post['page'] = $vars['page'] = $page;
31 if (check_readable($page, false, false)) {
32 $body = convert_html(get_source($page));
34 $body = str_replace('$1', $page, $_msg_include_restrict);
36 $get['page'] = $post['page'] = $vars['page'] = $self;
38 // Add a title with edit link, before included document
39 $s_page = htmlspecialchars($page);
40 $r_page = rawurlencode($page);
41 $link = "<a href=\"$script?cmd=edit&page=$r_page\">$s_page</a>";
43 if ($page == $menubar) {
44 $body = "<span align=\"center\"><h5 class=\"side_label\">$link</h5></span>" .
45 "<small>$body</small>";
47 $body = "<h1>$link</h1>\n" .