1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

{MENU} now supports the v2.x format: {MENU: path=xxxx&count=x} etc. for embedded menus.

This commit is contained in:
Cameron
2014-02-05 06:15:31 -08:00
parent 5b4dbb83e4
commit 5906897d90

View File

@@ -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");
}
}
}