<?php
/**
 * @package n3t Cookie Consent
 * @author Pavel Poles - n3t.cz
 * @copyright (C) 2021 - Pavel Poles - n3t.cz
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 **/

use Joomla\CMS\Form\FormHelper;

defined( '_JEXEC' ) or die( 'Restricted access' );

FormHelper::loadFieldClass('text');

class JFormFieldN3tCookieConsentCookie extends JFormFieldText
{
	protected $type = 'N3tCookieConsentCookie';

	protected function getInput()
	{
		$input = parent::getInput();

		$input = '<div class="input-group flex-nowrap input-append">' . $input .
			// space after blank is because of Joomla 4 default template adding icon to _blank links
			'<a href="#" class="btn btn-info" target="_blank " onclick="this.href=\'https://cookiedatabase.org/?s=\'+this.previousElementSibling.value.replace(/^\^/, \'\');"><i class="icon-help"></i></a>' .
			'</div>';
		return $input;
	}
}
