<?php

/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author				Germinal Camps
# copyright 			Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights Reserved.
# @license				http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: 			http://www.joomlathat.com
# Technical Support:	Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/

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

jimport( 'joomla.application.component.view' );
require_once(JPATH_SITE.DS.'components'.DS.'com_invoices'.DS.'helpers'.DS.'helpers.php');

class TemplatesViewTemplates extends JViewLegacy
{

	protected $input;

	function __construct()
	{
		parent::__construct();

		$mainframe = JFactory::getApplication();
		$this->input = $mainframe->input;

	}

	function display($tpl = null)
	{
		JToolbarHelper::title(   JText::_( 'TEMPLATE_MANAGER' ), 'templates' );

		JToolbarHelper::addNew();
		JToolbarHelper::deleteList(JText::_( 'SURE_TEMPLATES' ));
		JToolbarHelper::custom( 'duplicate', 'copy', 'publish_f2.png', 'DUPLICATE_TEMPLATES' );

		InvoicesHelper::addSubmenu('templates');
		$this->sidebar = JHtmlSidebar::render();

		$document	= JFactory::getDocument();

		// Get data from the model
		$this->pagination = $this->get('Pagination');
		$this->keywords = $this->get('keywords');

		$this->items = $this->get('Data');

		//cridem els JavaScript
		JHtmlBehavior::framework();

		$lists['order_Dir'] = $this->get('FilterOrderDir') ;
		$lists['order']     = $this->get('FilterOrder') ;

		$this->lists = $lists;

		parent::display($tpl);
	}

}
