' . "\n";; // $menubar will already be shown via menu plugin if (! isset($included[$menubar])) $included[$menubar] = TRUE; // Loop yourself $root = isset($vars['page']) ? $vars['page'] : ''; $included[$root] = TRUE; // Get arguments $args = func_get_args(); // strip_bracket() is not necessary but compatible $page = isset($args[0]) ? get_fullname(strip_bracket(array_shift($args)), $root) : ''; $with_title = PLUGIN_INCLUDE_WITH_TITLE; if (isset($args[0])) { switch(strtolower(array_shift($args))) { case 'title' : $with_title = TRUE; break; case 'notitle': $with_title = FALSE; break; } } $s_page = htmlspecialchars($page); $r_page = rawurlencode($page); $link = '' . $s_page . ''; // Read link // I'm stuffed if (isset($included[$page])) { return '#include(): Included already: ' . $link . '
' . "\n"; } if (! is_page($page)) { return '#include(): No such page: ' . $s_page . '
' . "\n"; } if ($count > PLUGIN_INCLUDE_MAX) { return '#include(): Limit exceeded: ' . $link . '
' . "\n"; } else { ++$count; } // One page, only one time, at a time $included[$page] = TRUE; // Include A page, that probably includes another pages $get['page'] = $post['page'] = $vars['page'] = $page; if (check_readable($page, false, false)) { $body = convert_html(get_source($page)); } else { $body = str_replace('$1', $page, $_msg_include_restrict); } $get['page'] = $post['page'] = $vars['page'] = $root; // Put a title-with-edit-link, before including document if ($with_title) { $link = '' . $s_page . ''; if ($page == $menubar) { $body = '
' . $link . '
' . $body . ''; } else { $body = '

' . $link . '

' . "\n" . $body . "\n"; } } return $body; } ?>