<?php
defined('JPATH_PLATFORM') or die;

class JFormFieldListWrapper extends JFormFieldList {
	
	protected $type = 'ListWrapper';
	
	protected function hide_it() 
	{		
		$version = new JVersion();
		$jversion = explode('.', $version->getShortVersion());
		
		$min_version_param = $this->element['versionmin'] ? $this->element['versionmin'] : 2; // versions to show the field in
		$max_version_param = $this->element['versionmax'] ? $this->element['versionmax'] : 3;
				
		if (intval($jversion[0]) >= $min_version_param && intval($jversion[0]) <= $max_version_param) {
			return false;
		}
		
		return true;
	}
	
	public function getLabel() 
	{			
		if (!self::hide_it()) {
			return parent::getLabel();
		}
			
		return '';
	}
	
	public function getInput() 
	{
		if (!self::hide_it()) {
			return parent::getInput();
		}
		
		return '';
	}
	
	public function getControlGroup() 
	{
		if (!self::hide_it()) {
			return parent::getControlGroup();
		}
		
		return '';
	}
	
}
?>
