- global $script,$vars,$get,$post,$hr,$WikiName,$BracketName;
- global $include_list; //½èÍýºÑ¥Ú¡¼¥¸Ì¾¤ÎÇÛÎó
-
- if (!isset($include_list))
- {
- $include_list = array($vars['page']=>TRUE);
- }
-
- if (func_num_args() == 0)
- {
- return;
+ global $script, $vars, $get, $post, $menubar, $_msg_include_restrict;
+ static $included = array();
+ static $count = 1;
+
+ if (func_num_args() == 0) return PLUGIN_INCLUDE_USAGE . '<br />' . "\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;
+ }