CoreFiles by mySites.guru
TemplatenameField.php52 lines, 1,250 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
c64d76cef7e6101ffbb66ce95b935e48
sha1
940c389f0536bdcf2e3ef61a2b6c482f620eef4f
sha256
0b19a6c6a2116e7ea9eac13f3b7f24952b6933882ec59458807e65d180d7d646
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_templates
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
namespace Joomla\Component\Templates\Administrator\Field;

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\Component\Templates\Administrator\Helper\TemplatesHelper;

FormHelper::loadFieldClass('list');

/**
 * Template Name field.
 *
 * @since  3.5
 */
class TemplatenameField extends \JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var	   string
	 * @since  3.5
	 */
	protected $type = 'TemplateName';

	/**
	 * Method to get the field options.
	 *
	 * @return  array  The field option objects.
	 *
	 * @since   1.6
	 */
	public function getOptions()
	{
		// Get the client_id filter from the user state.
		$clientId = Factory::getApplication()->getUserStateFromRequest('com_templates.styles.client_id', 'client_id', '0', 'string');

		// Get the templates for the selected client_id.
		$options = TemplatesHelper::getTemplateOptions($clientId);

		// Merge into the parent options.
		return array_merge(parent::getOptions(), $options);
	}
}

No other release has this exact content. See every version of this file.