<?php
/**
 * @package     CMGiftCard
 * @subpackage  com_cmgiftcard
 * @copyright   Copyright (C) 2016-2024 CMExension
 * @license     GNU General Public License version 2 or later
 */

defined('JPATH_BASE') or die();

require_once JPATH_ROOT . '/administrator/components/com_cmgiftcard/models/base_fields/editor.php';

use Joomla\CMS\Form\Field\EditorField;
use Joomla\CMS\Language\Text;

/**
 * Form field for PDF gift card editor.
 *
 * @package     CMGiftCard
 * @subpackage  com_cmgiftcard
 * @since       1.2.0
 */
class JFormFieldCMGCPDFEditor extends CMGiftCardEditorField
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  1.2.0
	 */
	public $type = 'CMGCPDFEditor';

	/**
	 * Method to get the field input markup for amount input.
	 *
	 * @return  string  The field input markup.
	 *
	 * @since   1.2.0
	 */
	protected function getInput()
	{
		$input = parent::getInput();

		$tags = array(
			'{sender_name}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_SENDER_NAME'),
			'{recipient_name}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_RECIPIENT_NAME'),
			'{gift_card_image}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_GIFT_CARD_IMAGE'),
			'{gift_card_amount}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_GIFT_CARD_AMOUNT'),
			'{gift_card_code}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_GIFT_CARD_CODE'),
			'{gift_card_qr_code}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_GIFT_CARD_QR_CODE'),
			'{gift_card_message}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_GIFT_CARD_MESSAGE'),
			'{order_date}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_ORDER_DATE'),
			'{completed_date}' => Text::_('COM_CMGIFTCARD_TEMPLATE_TAG_COMPLETED_DATE'),
		);

		$input .= '<p>' . Text::_('COM_CMGIFTCARD_CONFIG_ELECTRONIC_PDF_TEMPLATE_INSTRUCTION') . '</p>';
		$input .= '<ul>';

		foreach ($tags as $k => $v)
		{
			$input .= '<li>' . $k . ': ' . $v . '</li>';
		}

		$input .= '</ul>';

		return $input;
	}
}
