<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

class TOOLBAR_gmaccess {
	function _NEW($edit) {
		$cid = JRequest::getVar( 'cid', array(0), '', 'array' );

		$text = ( $edit ? JText::_( 'GMA_TBMOD' ) : JText::_( 'GMA_TBCREER' ) );

		JToolBarHelper::title( JText::_( 'GMA_TBGROUPE' ) .' : <small><small>[ '. $text .' ]</small></small>', 'user.png' );

		//JToolBarHelper::custom( 'save2new', 'new.png', 'new_f2.png', 'Save & New', false,  false );
		//JToolBarHelper::custom( 'save2copy', 'copy.png', 'copy_f2.png', 'Save To Copy', false,  false );
		JToolBarHelper::save();
		if ( $edit ) {
			// for existing items the button is renamed `close`
			JToolBarHelper::cancel( 'canceled',  JText::_( 'GMA_TBFERMER' ) );
		} else {
			JToolBarHelper::cancel( 'canceled', JText::_( 'GMA_TBANNULER' ) );
		}

	}
	function _NEWACCESS($edit) {
		$cid = JRequest::getVar( 'cid', array(0), '', 'array' );

		$text = ( $edit ? JText::_( 'GMA_TBMOD' ) : JText::_( 'GMA_TBCREER' ) );

		JToolBarHelper::title( JText::_( 'GMA_TBDROITS' ) .' : <small><small>[ '. $text .' ]</small></small>', 'config.png' );

		//JToolBarHelper::custom( 'save2new', 'new.png', 'new_f2.png', 'Save & New', false,  false );
		//JToolBarHelper::custom( 'save2copy', 'copy.png', 'copy_f2.png', 'Save To Copy', false,  false );
		JToolBarHelper::save('saveaccess',JText::_( 'GMA_TBSAVE' ));
		if ( $edit ) {
			// for existing items the button is renamed `close`
			JToolBarHelper::cancel( 'cancela', JText::_( 'GMA_TBFERMER' ) );
		} else {
			JToolBarHelper::cancel( 'cancela', JText::_( 'GMA_TBANNULER' ) );
		}

	}
	function _INDIV()
    {
        JToolBarHelper::title( JText::_( 'GMA_TBINDIVTITRE' ), 'user.png' );
        JToolBarHelper::save('saveindiv',JText::_( 'GMA_TBCREER' ));
        JToolBarHelper::cancel( 'canceled', JText::_( 'GMA_TBANNULER' ) );

    }
	function _GROUPES() {
		JToolBarHelper::title( JText::_( 'GMA_TBGROUPETITRE' ), 'user.png' );
		JToolBarHelper::custom( 'add', 'collec.png', 'collec.png', JText::_( 'GMA_TBCOLL' ), false );
		JToolBarHelper::custom( 'individuel', 'indiv.png', 'indiv.png', JText::_( 'GMA_TBINDIV' ), false );
		JToolBarHelper::editList();
		JToolBarHelper::deleteList();
		JToolBarHelper::custom( 'menu', 'cpanel.png', 'cpanel.png', JText::_( 'GMA_TBMENU' ), false );
		$document =& JFactory::getDocument();
		$document->addStyleDeclaration( '.icon-32-collec {background:url(../administrator/components/com_gmaccess/images/icon-32-collec.png) no-repeat;}' );
		$document->addStyleDeclaration( '.icon-32-indiv {background:url(../administrator/components/com_gmaccess/images/icon-32-indiv.png) no-repeat;}' );
		$document->addStyleDeclaration( '.icon-32-cpanel {background:url(../administrator/components/com_gmaccess/images/icon-32-cpanel.png) no-repeat;}' );
	}
	function _ACCESS() {
		JToolBarHelper::title( JText::_( 'GMA_TBREGLESTITRE' ), 'config.png' );
		JToolBarHelper::addNewX('addaccess');
		JToolBarHelper::editList('editaccess');
		JToolBarHelper::deleteList(JText::_( 'GMA_TBCONFIRME' ),'removeaccess');
		JToolBarHelper::custom( 'menu', 'cpanel.png', 'cpanel.png', JText::_( 'GMA_TBMENU' ), false );
		$document =& JFactory::getDocument();

		$document->addStyleDeclaration( '.icon-32-cpanel {background:url(../administrator/components/com_gmaccess/images/icon-32-cpanel.png) no-repeat;}' );
	}
	function _REDIR2()
    {
        JToolBarHelper::title( JText::_( 'GMA_TBREDIRBACK' ), 'config.png' );
        JToolBarHelper::custom( 'redirect2', 'back.png', 'back.png', JText::_( 'GMA_TBRETOUR' ), false );

    }
	function _REDIR()
    {
        JToolBarHelper::title( JText::_( 'GMA_TBREDIRFRONT' ), 'config.png' );
        JToolBarHelper::custom( 'redirect', 'back.png', 'back.png', JText::_( 'GMA_TBRETOUR' ), false );

    }
	function _DEFAULT() {
		JToolBarHelper::title( JText::_( 'GMA_TBDEFAUT' ), 'gmaccess' );
		$document =& JFactory::getDocument();
		$document->addStyleDeclaration( '.icon-48-gmaccess {background:url(../administrator/components/com_gmaccess/images/icon-48-user.png) no-repeat left;}' );

	}
}

?> 
