CoreFiles by mySites.guru
skins.php72 lines, 1,581 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
81a67adfba5bb0c21438dd9fd7c9633e
sha1
26a4ca17ac977c15253567889d0dc8883bc4f8ae
sha256
eadd4b04ba265e261295b9715e5c14a077d24f84c234c87e280eb9d2a06554fc
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Editors.tinymce
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;

/**
 * Generates the list of options for available skins.
 *
 * @package     Joomla.Plugin
 * @subpackage  Editors.tinymce
 * @since       3.4
 */
class JFormFieldSkins extends ListField
{
	protected $type = 'skins';

	/**
	 * Method to get the skins options.
	 *
	 * @return  array  The skins option objects.
	 *
	 * @since   3.4
	 */
	public function getOptions()
	{
		$options = array();

		$directories = glob(JPATH_ROOT . '/media/vendor/tinymce/skins' . '/*', GLOB_ONLYDIR);

		for ($i = 0, $iMax = count($directories); $i < $iMax; ++$i)
		{
			$dir = basename($directories[$i]);
			$options[] = HTMLHelper::_('select.option', $i, $dir);
		}

		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}

	/**
	 * Method to get the field input markup for the list of skins.
	 *
	 * @return  string  The field input markup.
	 *
	 * @since   3.4
	 */
	protected function getInput()
	{
		$html = array();

		// Get the field options.
		$options = (array) $this->getOptions();
		$attrbs  = array(
			'class' => 'custom-select'
		);

		// Create a regular list.
		$html[] = HTMLHelper::_('select.genericlist', $options, $this->name, $attrbs, 'value', 'text', $this->value, $this->id);

		return implode($html);
	}
}

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