<?php
/**
 * @package FoldingMenu
 * @copyright Copyright (c) 2008 Herberto Graça
 * @license GNU General Public License version 2, or later
 */
 

// no direct access
defined('_JEXEC') or die('Restricted access');

// Include the syndicate functions only once
require_once (dirname(__FILE__).DS.'helper.php');

$params->def('menutype', 			'foldingmenu');
$params->def('class_sfx', 			'');
$params->def('menu_images', 		0);
$params->def('menu_images_align', 	0);
$params->def('expand_menu', 		0);
$params->def('activate_parent', 	0);
$params->def('indent_image', 		0);
$params->def('indent_image1', 		'indent1.png');
$params->def('indent_image2', 		'indent2.png');
$params->def('indent_image3', 		'indent3.png');
$params->def('indent_image4', 		'indent4.png');
$params->def('indent_image5', 		'indent5.png');
$params->def('indent_image6', 		'indent.png');
$params->def('spacer', 				'');
$params->def('end_spacer', 			'');
$params->def('full_active_id', 		0);

// Added in 1.5
$params->def('startLevel', 			0);
$params->def('endLevel', 			0);
$params->def('showAllChildren', 	0);

//require(JModuleHelper::getLayoutPath('mod_foldingmenu'));

//===============================================================
//==== ADDED STUFF

//LOADING THE JAVASCRIPT
$document = & JFactory::getDocument();
$document->addScript($mainframe->getCfg('live_site').'modules/mod_foldingmenu/js/menu.js');

//OVERRIDE STDOUT
// Start output buffering
ob_start();

// Run the function echoing the output
require(JModuleHelper::getLayoutPath('mod_foldingmenu'));

// Assign a variable to the contents of the buffer
$menu = ob_get_contents();
//dump($menu,'$menu');

// Close the buffer and clean it
ob_end_clean();
//ob_end_flush();

echo modFoldingMenuHelper::make_menu($menu);



