I am creating new component for Joomla 1.5. Listed here are simple items in my back-finish files:

plugin.X.php:

defined( '_JEXEC' ) or die( 'Restricted access' ); require_once( JApplicationHelper::getPath( 'toolbar_html' ) ); switch ( $task ) { case 'sellers' : TOOLBAR_bioreports::_SELLERS(); break; case 'agents' : TOOLBAR_bioreports::_AGENTS(); break; case 'add_agent' : case 'edit_agent' : TOOLBAR_bioreports::_AGENT_ADD_EDIT(); break; default: TOOLBAR_bioreports::_DEFAULT(); break;

} ?>

This really is plugin.X.html.php:



defined( '_JEXEC' ) or die( 'Restricted access' );

class TOOLBAR_bioreports {

function _NEW() {
    JToolBarHelper::title( JText::_( 'Sales Tracking System' ), 'generic.png' );
    JToolBarHelper::save();
    JToolBarHelper::apply();
    JToolBarHelper::cancel();       
}

function _ADD() {
    JToolBarHelper::title( JText::_( 'Sales Tracking System' ), 'generic.png' );
    JToolBarHelper::save();
    JToolBarHelper::apply();
    JToolBarHelper::cancel();       
}

function _AGENTS() {
    JToolBarHelper::title( JText::_( 'Sales Tracking System [agents]' ), 'generic.png' );
    JToolBarHelper::back();
    JToolBarHelper::addNew("add_agent");
    JToolBarHelper::editList("edit_agent");
}

function _AGENT_ADD_EDIT() {
    JToolBarHelper::title( JText::_( 'Sales Tracking System [agents]' ), 'generic.png' );
    JToolBarHelper::back();
    JToolBarHelper::save('save_agent');
    JToolBarHelper::cancel('cancel_agent');
}

function _SELLERS() {
    JToolBarHelper::title( JText::_( 'Sales Tracking System [sellers]' ), 'generic.png' );
    JToolBarHelper::back();
}

function _DEFAULT() {

    JToolBarHelper::title( JText::_( 'Sales Tracking System' ), 'generic.png' );
    JToolBarHelper::custom('sellers', 'sellers.png', 'sellers.png', "Sellers", true, true);
    JToolBarHelper::custom('agents', 'agents.png', 'agents.png', 'Agents', true, true);


}

?>

Which is admin.X.php



require_once( JApplicationHelper::getPath( 'admin_html' ) );

$task = JRequest::getCmd('task');

// checks the $task variable and // choose an appropiate function switch($task){ case 'sellers': showSellers(); break;

case 'agents':      
    showAgents();
    break;

case 'add_agent':
    addAgent();
    break;

case 'edit_agent':
    break;

default:
    default_task();
    break;

function default_task()

function showSellers()

function addAgent()

function showAgents()

?>

However , after i click custom button 'sellers' or 'agents' on primary page I do not get $task even when documentation claims which should happen.

However, after i by hand include URL

&task=sellers
or
&task=agents
I recieve proper output. What shall we be held doing wrong?