<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

class ClubmanagementControllerPositions extends ClubmanagementController
{
	/**
	 * constructor (registers additional tasks to methods)
	 * @return void
	 */
	function __construct()
	{
		parent::__construct();

		// Register Extra tasks
		$this->registerTask( 'add'  , 	'edit' );
		$this->registerTask( 'unpublish', 	'publish');

	}

	function edit()
	{	
		JRequest::setVar( 'view', 'positions' );
		JRequest::setVar( 'layout', 'form'  );
		JRequest::setVar('hidemainmenu', 1);

		parent::display();
	}

	function save()
	{
		$model = $this->getModel('positions');

		if ($model->store($post)) {
			$msg = JText::_( 'positions Saved!' );
		} else {
			$msg = JText::_( 'Error Saving Clubmanagement' );
		}

		// Check the table in so it can be edited.... we are done with it anyway
		$link = 'index.php?option=com_clubmanagement&view=positions';
		$this->setRedirect($link, $msg);
	}
	
	/**
	 * cancel editing a record
	 * @return void
	 */
	function cancel()
	{
		$msg = JText::_( 'Operation Cancelled' );
		$this->setRedirect( 'index.php?option=com_clubmanagement', $msg );
	}


}
?>
