CoreFiles by mySites.guru
ModulesPositioneditField.php64 lines, 1,419 bytes, from Joomla_4.0.0-alpha8-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha7
md5
df02a638e9b031b97ff233f962d2a8e4
sha1
c55b07625a1cdeaa041a49ed372520506da4662a
sha256
47b06866830098525c5ba6cbfcd3d35d13dc585317cf9d5f11ccab3c45319475
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_modules
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Modules\Administrator\Field;

defined('JPATH_BASE') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\HTML\HTMLHelper;

/**
 * Edit Modules Position field.
 *
 * @since  4.0.0
 */
class ModulesPositioneditField extends FormField
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  4.0.0
	 */
	protected $type = 'ModulesPositionedit';

	/**
	 * Name of the layout being used to render the field
	 *
	 * @var    string
	 * @since  4.0.0
	 */
	protected $layout = 'joomla.form.field.modulespositionedit';

	/**
	 * Method to get the field input markup.
	 *
	 * @return  string  The field input markup.
	 *
	 * @since   4.0.0
	 */
	protected function getInput()
	{
		$data = $this->getLayoutData();

		$clientId  = Factory::getApplication()->getUserState('com_modules.modules.client_id', 0);
		$positions = HTMLHelper::_('modules.positions', $clientId, 1, $this->value);

		$data['client']    = $clientId;
		$data['positions'] = $positions;

		$renderer = $this->getRenderer($this->layout);
		$renderer->setComponent('com_modules');
		$renderer->setClient(1);

		return $renderer->render($data);
	}
}

The same content is in 2 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha8. See them all, or every version of this file.