mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Issue #2819 - New Navigation Shortcode Param options: {NAVIGATION: type=footer&layout=main}
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function navigation_shortcode($parm='')
|
|
||||||
|
/**
|
||||||
|
* @param null $parm
|
||||||
|
* @param string ['type'] main|side|footer|alt|alt5|alt6 (the data)
|
||||||
|
* @param string ['layout'] main|side|footer|alt|alt5|alt6| or custom template key. (the template)
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function navigation_shortcode($parm=null)
|
||||||
{
|
{
|
||||||
$types = array(
|
$types = array(
|
||||||
'main' => 1,
|
'main' => 1,
|
||||||
@@ -11,8 +18,29 @@ function navigation_shortcode($parm='')
|
|||||||
'alt6' => 6,
|
'alt6' => 6,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
if(is_array($parm) && !empty($parm))
|
||||||
|
{
|
||||||
|
$category = 1;
|
||||||
|
$tmpl = 'main';
|
||||||
|
|
||||||
|
if(!empty($parm['type']))
|
||||||
|
{
|
||||||
|
$cat = $parm['type'];
|
||||||
|
$category = varset($types[$cat], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($parm['layout']))
|
||||||
|
{
|
||||||
|
$tmpl= $parm['layout'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$category = varset($types[$parm], 1);
|
$category = varset($types[$parm], 1);
|
||||||
$tmpl = vartrue($parm, 'main');
|
$tmpl = vartrue($parm, 'main');
|
||||||
|
}
|
||||||
|
|
||||||
$nav = e107::getNav();
|
$nav = e107::getNav();
|
||||||
|
|
||||||
$template = e107::getCoreTemplate('navigation', $tmpl);
|
$template = e107::getCoreTemplate('navigation', $tmpl);
|
||||||
|
Reference in New Issue
Block a user