<?php
/**
 * @package     Reporter for VirtueMart
 * 
 * @copyright   Copyright (C) 2012-2021 VirtuePlanet Services LLP. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Abhishek Das <info@virtueplanet.com> - http://www.virtueplanet.com
 */

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('text');

class JFormFieldVppath extends JFormFieldText
{
	protected $type = 'Vppath';

	function getInput()
	{
		if (strpos($this->value, '{{root}}') !== false)
		{
			$this->value = str_replace('{{root}}', JPATH_ROOT, $this->value);
			$this->value = JPath::clean($this->value);
		}
		
		return parent::getInput();
	}
}