<?php

/**
 * @package         Tassos Code Snippets
 * @version         1.0.1-RC2 Free
 *
 * @author          Tassos Marinos <info@tassos.gr>
 * @link            https://www.tassos.gr
 * @copyright       Copyright © 2026 Tassos Marinos All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
 */

namespace Tassos\CodeSnippets\Administrator\Field;

defined('_JEXEC') or die;

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

/**
 * Insertion Method field for snippets.
 */
class InsertionMethodField extends RadioField
{
    /**
     * The form field type.
     *
     * @var    string
     */
    protected $type = 'InsertionMethod';

    /**
     * Method to get the field options.
     *
     * @return  array  The field option objects.
     */
    protected function getOptions()
    {
        $options = [
            (object) [
                'value' => 'auto',
                'text'  => Text::_('COM_TASSOSCODESNIPPETS_INSERTION_METHOD_AUTO')
            ],
            (object) [
                'value' => 'shortcode',
                'text'  => Text::_('COM_TASSOSCODESNIPPETS_INSERTION_METHOD_SHORTCODE')
            ]
        ];

        return array_merge(parent::getOptions(), $options);
    }
}
