mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
{MENU} now supports the v2.x format: {MENU: path=xxxx&count=x} etc. for embedded menus.
This commit is contained in:
@@ -6,22 +6,38 @@ if(!defined('e107_INIT'))
|
|||||||
|
|
||||||
function menu_shortcode($parm, $mode='')
|
function menu_shortcode($parm, $mode='')
|
||||||
{
|
{
|
||||||
list($path,$echo) = explode(':', $parm);
|
if(is_array($parm)) //v2.x format allowing for parms. {MENU: path=y&count=x}
|
||||||
|
|
||||||
if(is_numeric($path)) // eg. {MENU=1} - renders area 1 as found in the e107_menu db table.
|
|
||||||
{
|
{
|
||||||
return e107::getMenu()->renderArea($parm);
|
list($plugin,$menu) = explode("/",$parm['path'],2);
|
||||||
}
|
|
||||||
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 == '')
|
if($menu == '')
|
||||||
{
|
{
|
||||||
$menu = $plugin;
|
$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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user