<?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 BilletsViewBillets extends JView {
	/** 
	 * Billets view display method
	 * @return void
	 **/
	function display($tpl = null) {
        jimport('joomla.utilities.date');

		global $mainframe, $Itemid;
		if ($Itemid == 0) { $Itemid = billetsGetItemid(); }
		$document	= &JFactory::getDocument();
		$menus		= &JSite::getMenu();
				       	
        // Get data from the model
        $items =& $this->get( 'Data');
		$pagination = $this->get( 'Pagination' );
		$pagetitle = $this->get( 'PageTitle' );		
		$statuses = $this->get( 'Statuses' );
		$gridhelpers = $this->get( 'GridHelpers' );
		
		// Set the document page title
		$menu   = $menus->getActive();
		$document->setTitle($menu->name." - ".$pagetitle);

        $this->assignRef( 'Itemid', $Itemid );
        $this->assignRef( 'items', $items );	 		
		$this->assignRef( 'pagination' , $pagination);
		$this->assignRef( 'search' , $gridhelpers["_search"] );
		$this->assignRef( 'limit' , $gridhelpers["_limit"] );
		$this->assignRef( 'limitstart' , $gridhelpers["_limitstart"] );
		$this->assignRef( 'order' , $gridhelpers["_order"] );
		$this->assignRef( 'order_dir' , $gridhelpers["_order_dir"] );		
		$this->assignRef( 'pagetitle' , $pagetitle);		
		$this->assignRef( 'statuses', $statuses );

        parent::display($tpl);
    }
}
