<?php
/**
 * @version $Id$
 * @package    Contact_Enhanced
 * @subpackage Views
 * @author     Douglas Machado {@link http://ideal.fok.com.br}
 * @author     Created on 28-Jul-09
 * @license		GNU/GPL, see license.txt
 * Contact Enhanced  is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

//--No direct access
defined('_JEXEC') or die('Direct Access NOT Allowed. Please try to access the main page');

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

class Contact_EnhancedsViewcustomvalues extends JView
{

	function display($tpl = null)
	{
		global $controller,$option;
		JHTML::stylesheet( 'Contact_Enhanced.css', 'administrator/components/com_contact_enhanced/assets/' );
		JToolBarHelper::title(   '&nbsp;&nbsp;' .JText::_( 'Custom Values' ), 'install');
		JToolBarHelper::unpublishList();
		JToolBarHelper::publishList();
		JToolBarHelper::customX( 'copy', 'copy.png', 'copy_f2.png', 'Copy' );
		JToolBarHelper::editListX();
		JToolBarHelper::addNewX();
		JToolBarHelper::deleteList();
		
		$items	= & $this->get('Data');
		$pagination =& $this->get('Pagination');
		$categories	=& $this->get('Categories');
		$types		=& $this->get('Types');
		
		$lists	= & $this->get('List');
		
		$javascript = ' onchange="document.adminForm.submit();"';
		if( count($categories) > 0){
			$options	= array();
			$options[]	= JHTML::_('select.option',	'',	JText::_('Select a category') );
			foreach($categories as $cat){
				$options[]	= JHTML::_('select.option', $cat->value,	$cat->text );
			} 
			$lists['filter_category']	= JHTML::_('select.genericlist',   $options, $controller.'filter_category', 'class="inputbox" size="1" '.$javascript, 'value', 'text', $lists['filter_category'] );
		}else{
			$lists['filter_category']	= NULL;
		}
		if( count($types) > 0){
			$options	= array();
			$options[]	= JHTML::_('select.option',	'',	JText::_('Select a Type') );
			foreach($types as $type){
				$options[]	= JHTML::_('select.option', $type->value,	$type->text );
			} 
			$lists['filter_type']	= JHTML::_('select.genericlist',   $options, $controller.'filter_type', 'class="inputbox" size="1" '.$javascript, 'value', 'text', $lists['filter_type'] );
		}else{
			$lists['filter_type']	= NULL;
		}
		

		$this->assignRef('items', $items);
		$this->assignRef('pagination', $pagination);
		$this->assignRef('lists', $lists);

		parent::display($tpl);
	}// function

}// class
