<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );


/**
*
* @package simpleMembership
* @copyright Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Anton Getman(ljanton@mail.ru);
* Homepage: http://www.ordasoft.com
* @version: 1.1 PRO
*
**/


  //defined('_VM_TOOLBAR_LOADED' ) or define('_VM_TOOLBAR_LOADED', 1 );

$mainframe = $GLOBALS['mainframe'] = JFactory::getApplication(); // for 1.6
if( stristr( $_SERVER['PHP_SELF'], 'administrator')) {
	@define( '_VM_IS_BACKEND', '1' );
}


include_once( dirname(__FILE__).'/compat.joomla1.5.php' );

// ensure this file is being included by a parent file
$path = JPATH_SITE."/administrator/components/com_simplemembership/";
$section = mosGetParam( $_REQUEST, 'section', '' );
//require_once( $path . 'toolbar.vehiclemanager.php' );
require_once( $path . 'toolbar_ext.php' );
require_once( $path . 'toolbar.simplemembership.html.php' );

require_once ( JPATH_BASE .DS.'components'.DS.'com_simplemembership'.DS.'functions.php' );

$settingsLittleThings = new settingsLittleThings();
$menusimplemembership = new menusimplemembership();

if (isset($section) && $section=='group') {
switch ($task) {
	case "add":
		menucat::NEW_CATEGORY();
		break;
	case "edit":
		menucat::EDIT_CATEGORY();
		break;

	case "add_acl_group":
		$menusimplemembership->SAVE_NEWACL();
		break;

	case "del_acl_group_form":
		$menusimplemembership->DEL_ACL();
    $settingsLittleThings->addSubmenu("Groups");
		break;

	default:
    menucat::SHOW_CATEGORIES();
    $settingsLittleThings->addSubmenu("Groups");	
    break;
  }
} else {

switch ($task) {

	case "add":
		$menusimplemembership->MENU_SAVE_BACKEND();
     $settingsLittleThings->addSubmenu("Groups");
		break;

	case "add_user":
		$menusimplemembership->MENU_EDITUSER();
     $settingsLittleThings->addSubmenu("Groups ");
		break;

	case "edit_user":
		$menusimplemembership->MENU_EDITUSER();
     $settingsLittleThings->addSubmenu("Groups ");
		break;

	case "config_frontend":
		$menusimplemembership->MENU_CONFIG_FRONTEND();
    $settingsLittleThings->addSubmenu("Settings Frontend");
		break;

	case "config_backend": 
    $menusimplemembership->MENU_CONFIG_BACKEND();
    $settingsLittleThings->addSubmenu("Settings Backend");
		break;

	case "config_save_frontend":
		$menusimplemembership->MENU_CONFIG_FRONTEND();
    $settingsLittleThings->addSubmenu("Settings Frontend");
		break;

	case "config_save_backend":
		$menusimplemembership->MENU_CONFIG_BACKEND();
    $settingsLittleThings->addSubmenu("Settings Backend");
		break;

	case "about":
		$menusimplemembership->MENU_ABOUT();
         $settingsLittleThings->addSubmenu("About");
		break;

	default:

		$menusimplemembership->MENU_DEFAULT();
        $settingsLittleThings->addSubmenu("Users");
        break;
}
} //else
?>
