<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'libs'.DS.'kh.template.helper.php');
$tmplTools = khTemplateHelper::getInstance($this, array('ui', kh_TOOL_SCREEN, kh_TOOL_MENU, kh_TOOL_COLOR, 'main_layout', 'direction'));
//Calculate the width of template
$tmplWidth = '';
$tmplWrapMin = '100%';
switch ($tmplTools->getParam(kh_TOOL_SCREEN)){
case 'auto':
$tmplWidth = '97%';
break;
case 'fluid':
$tmplWidth = intval($tmplTools->getParam('kh_screen-fluid-fix-kh_screen_width'));
$tmplWidth = $tmplWidth ? $tmplWidth.'%' : '90%';
break;
case 'fix':
$tmplWidth = intval($tmplTools->getParam('kh_screen-fluid-fix-kh_screen_width'));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '771px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '770px';
break;
default:
$tmplWidth = intval($tmplTools->getParam(kh_TOOL_SCREEN));
$tmplWrapMin = $tmplWidth ? ($tmplWidth+1).'px' : '950px';
$tmplWidth = $tmplWidth ? $tmplWidth.'px' : '950px';
break;
}
$tmplTools->setParam ('tmplWidth', $tmplWidth);
$tmplTools->setParam ('tmplWrapMin', $tmplWrapMin);
//Main navigation
$kh_menutype = $tmplTools->getMenuType();
$khmenu = null;
if ($kh_menutype && $kh_menutype != 'none') {
$khparams = new JParameter('');
$khparams->set( 'menutype', $tmplTools->getParam('menutype', 'mainmenu') );
$khparams->set( 'menu_images_align', 'left' );
$khparams->set( 'menupath', $tmplTools->templateurl() .'/kh_menus');
$khparams->set('menu_images', 1); //0: not show image, 1: show image which set in menu item
$khparams->set('menu_background', 1); //0: image, 1: background
$khparams->set('mega-colwidth', 200); //Megamenu only: Default column width
$khparams->set('mega-style', 1); //Megamenu only: Menu style.
$khmenu = $tmplTools->loadMenu($khparams, $kh_menutype);
}
//End for main navigation
$layout = $tmplTools->getLayout ();
if ($layout) {
$tmplTools->display ($layout); [/code]