<?php
// $Id: content.php,v 1.8 2003/09/20 08:15:48 rcastley Exp $
/**
* Content 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.8 $
**/

// 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/menucontent.php");

switch ($task) {
	case "new":
	case "new_content_typed":
	case "new_content_section":
		menucontent::NEW_MENU();
		break;

	case "edit":
	case "edit_content_typed":
		global $database;

		// TODO: need better error capture here!
		$id = mosGetParam( $_POST, "id", '0' );
		$cid = mosGetParam( $_POST, "cid", array() );
		$comcid = @$cid[0];
		if ($comcid == "") {
			$comcid = $id;
		}

		$database->setQuery( "SELECT state FROM #__content WHERE id='$comcid'" );
		$state = $database->loadResult();

		menucontent::EDIT_MENU( $state );
		break;

	case "showarchive":
		menucontent::ARCHIVE_MENU();
		break;

	case "movesect":
		menucontent::MOVE_MENU();
		break;

	default:
		menucontent::DEFAULT_MENU();
		break;
}
?>