<?php
/**
 * @package BILLETS
 * @link 	http://www.dioscouri.com
 * @license GNU/GPLv2
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport( 'joomla.application.component.view' );

/**
 * Billets View
 *
 * @package BILLETS
 */
class BilletsViewAddon extends JView {
	/**
	 * Billets view display method
	 * @return void
	 **/
	 // **********************************************
	function display($tpl = null) {
		global $mainframe;
        jimport('joomla.utilities.date');
        
        JToolBarHelper::title( JText::_( _BILLETS_ ), 'billets' );
		// JHTML::_('stylesheet', 'billets.css', 'administrator/components/com_billets/css/');
 
		//get the data
		$row		= &$this->get('Data');
		$filename	= &$this->get('Filename');
		$content	= &$this->get('Content');
		$isNew		= ($row->id < 1);

		$text = $isNew ? JText::_( _BILLETS_NEW ) : JText::_( _BILLETS_EDIT );
		JToolBarHelper::title(   JText::_( _BILLETS_ADDONSOURCE ).': <small><small>[ ' . $text.' ]</small></small>', 'billets' );
		JToolBarHelper::save();
		if ($isNew)  {
			JToolBarHelper::cancel();
		} else {
			// for existing items the button is renamed `close`
			JToolBarHelper::cancel( 'cancel', _BILLETS_CLOSE );
		}

		$this->assignRef('row', $row);
		$this->assignRef('content', $content);
		$this->assignRef('filename', $filename);		


		parent::display($tpl);

    }
}
// ************************************************************************