<?php
// $Id: modules.php,v 1.7 2003/12/22 16:51:58 rcastley Exp $
/**
* Modules toolbar handler
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.7 $
**/

// ensure this file is being included by a parent file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

require_once( "menubar/html/menumodules.php" );
switch ($task) {

	case "edit":
		$cid = mosGetParam( $_POST, "cid", array() );

		$published = 0;
		if (@$cid[0]){
			$database->setQuery( "SELECT published FROM #__modules WHERE id='$cid[0]'" );
			$published = $database->loadResult();
		}
		
		$sql = "SELECT cur_template FROM #__templates";
		$database->setQuery( $sql );
		$cur_template = $database->loadResult();

		menumodules::EDIT_MENU( $cur_template, $published );
		break;

	case "new":
		menumodules::NEW_MENU();
		break;

	default:
		menumodules::MENU_Default();
		break;
}
?>
