<?php
/**
 * Main Module File
 * Does all the magic!
 *
 * @package     Add to Menu
 * @version     1.2.4
 *
 * @author      Peter van Westen <peter@nonumber.nl>
 * @link        http://www.nonumber.nl
 * @copyright   Copyright (C) 2010 NoNumber! All Rights Reserved
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

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

$user = JFactory::getUser();
if( $user->usertype != 'Super Administrator' ) {
	return;
}

$option = JRequest::getCmd( 'option' );
$folder = dirname(__FILE__).DS.'addtomenu'.DS.'components'.DS.$option;
if ( !JFolder::exists( $folder ) ) {
	return;
}

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

require JModuleHelper::getLayoutPath( 'mod_addtomenu'.DS.'addtomenu' );