diff --git a/e107_core/shortcodes/single/menu.php b/e107_core/shortcodes/single/menu.php index 5886e6a20..ce078a710 100644 --- a/e107_core/shortcodes/single/menu.php +++ b/e107_core/shortcodes/single/menu.php @@ -6,22 +6,38 @@ if(!defined('e107_INIT')) function menu_shortcode($parm, $mode='') { - list($path,$echo) = explode(':', $parm); - - if(is_numeric($path)) // eg. {MENU=1} - renders area 1 as found in the e107_menu db table. + if(is_array($parm)) //v2.x format allowing for parms. {MENU: path=y&count=x} { - return e107::getMenu()->renderArea($parm); - } - else // eg. {MENU=contact} for e107_plugins/contact/contact_menu.php OR {MENU=contact/other} for e107_plugins/contact/other_menu.php - { - list($plugin,$menu) = explode("/",$path,2); - + list($plugin,$menu) = explode("/",$parm['path'],2); if($menu == '') { $menu = $plugin; } - return e107::getMenu()->renderMenu($plugin,$menu."_menu"); + unset($parm['path']); + return e107::getMenu()->renderMenu($plugin,$menu."_menu", http_build_query($parm,'&')); + + } + else + { + + list($path,$echo) = explode(':', $parm); + + if(is_numeric($path)) // eg. {MENU=1} - renders area 1 as found in the e107_menu db table. + { + return e107::getMenu()->renderArea($parm); + } + else // eg. {MENU=contact} for e107_plugins/contact/contact_menu.php OR {MENU=contact/other} for e107_plugins/contact/other_menu.php + { + list($plugin,$menu) = explode("/",$path,2); + + if($menu == '') + { + $menu = $plugin; + } + + return e107::getMenu()->renderMenu($plugin,$menu."_menu"); + } } }