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

Issue #2819 - New Navigation Shortcode Param options: {NAVIGATION: type=footer&layout=main}

This commit is contained in:
Cameron
2017-10-15 13:14:14 -07:00
parent 0c10295588
commit 9b899004c5

View File

@@ -1,6 +1,13 @@
<?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(
'main' => 1,
@@ -10,11 +17,32 @@ function navigation_shortcode($parm='')
'alt5' => 5,
'alt6' => 6,
);
$category = varset($types[$parm], 1);
$tmpl = vartrue($parm, 'main');
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);
$tmpl = vartrue($parm, 'main');
}
$nav = e107::getNav();
$template = e107::getCoreTemplate('navigation', $tmpl);
$data = $nav->initData($category);
// $data = $nav->collection($category);