OSDN Git Service

Just a cleanup
authorhenoheno <henoheno>
Fri, 6 Aug 2004 13:10:39 +0000 (22:10 +0900)
committerhenoheno <henoheno>
Fri, 6 Aug 2004 13:10:39 +0000 (22:10 +0900)
plugin/menu.inc.php

index b443554..c53b140 100644 (file)
@@ -2,46 +2,41 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: menu.inc.php,v 1.3 2004/07/31 03:09:20 henoheno Exp $
+// $Id: menu.inc.php,v 1.4 2004/08/06 13:10:39 henoheno Exp $
 //
 
 // ¥µ¥Ö¥á¥Ë¥å¡¼¤ò»ÈÍѤ¹¤ë
-define('MENU_ENABLE_SUBMENU',FALSE);
+define('MENU_ENABLE_SUBMENU', FALSE);
 
 function plugin_menu_convert()
 {
-       global $script,$vars,$menubar;
+       global $vars, $menubar;
        static $menu = NULL;
 
-       if (func_num_args())
-       {
+       if (func_num_args()) {
                $args = func_get_args();
-               if (is_page($args[0]))
-               {
-                       $menu = $args[0];
-               }
+               if (is_page($args[0])) $menu = $args[0];
                return '';
        }
 
        $page = ($menu === NULL) ? $menubar : $menu;
-       if (MENU_ENABLE_SUBMENU)
-       {
-               $path = explode('/',strip_bracket($vars['page']));
-               while(count($path))
-               {
-                       $_page = join('/',$path).'/MenuBar';
-                       if (is_page($_page))
-                       {
+
+       if (MENU_ENABLE_SUBMENU) {
+               $path = explode('/', strip_bracket($vars['page']));
+               while(count($path)) {
+                       $_page = join('/', $path) . '/MenuBar';
+                       if (is_page($_page)) {
                                $page = $_page;
                                break;
                        }
                        array_pop($path);
                }
        }
-       if (!is_page($page))
-       {
+
+       if (! is_page($page)) {
                return '';
+       } else {
+               return preg_replace('/<ul[^>]*>/', '<ul>', convert_html(get_source($page)));
        }
-       return preg_replace('/<ul[^>]*>/','<ul>',convert_html(get_source($page)));
 }
 ?>