summaryrefslogtreecommitdiff
path: root/smartyplugins/function.nexus.php
blob: f85eb1beaa4c86aa97dc5bdc190a00aef6392426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace Bitweaver\Plugins;

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty {nexus} function plugin
 *
 * Type:	function
 * Name:	nexus
 * Input:	- id	(required) - id of the menu that should be displayed
 */
function smarty_function_nexus( $params, &$gBitSmarty ) {
	extract($params);

	if( empty( $id ) ) {
		$gBitSmarty->trigger_error("assign: missing id");
		return;
	}

	$tmpNexus = new \Bitweaver\Nexus\Nexus( $id );
	$nexusMenu = $tmpNexus->mInfo;

	$gBitSmarty->assign( 'nexusMenu', $nexusMenu );
	$gBitSmarty->assign( 'nexusId', $id );
	$gBitSmarty->display('bitpackage:nexus/nexus_module.tpl');
}