<?php
// $Id: toolbar.poll.php,v 1.5 2003/09/27 12:25:32 eddieajau Exp $
/**
* Poll Toolbar Menu
* @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.5 $
**/

// 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( $mainframe->getPath( 'toolbar_html' ) );
require_once( $mainframe->getPath( 'toolbar_default' ) );

switch ($task) {

	case "new":
		TOOLBAR_poll::_NEW();
		break;

	case "edit":
		$cid = mosGetParam( $_REQUEST, 'cid', array(0) );
		if (!is_array( $cid )) {
			$cid = array(0);
		}

		$database->setQuery( "SELECT published FROM #__polls WHERE id='$cid[0]'" );
		$published = $database->loadResult();

		$database->setQuery( "SELECT cur_template FROM #__templates" );
		$cur_template = $database->loadResult();

		TOOLBAR_poll::_EDIT( $cid[0], $cur_template );
		break;

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