CoreFiles by mySites.guru
ModulesModuleField.php49 lines, 1,056 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
edcc082cb7d2c24778a68ca76fbcb5d8
sha1
c7a6f7a2973b47f6777d2900b1d91bcc7bc17d34
sha256
1b000dddd404923af5813f8d74f68fda52bf233c34e4fc97ada6eaae605a6a55
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_modules
 *
 * @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\Modules\Administrator\Field;

defined('JPATH_BASE') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\Component\Modules\Administrator\Helper\ModulesHelper;

FormHelper::loadFieldClass('list');

/**
 * Modules Module field.
 *
 * @since  3.4.2
 */
class ModulesModuleField extends \JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  3.4.2
	 */
	protected $type = 'ModulesModule';

	/**
	 * Method to get the field options.
	 *
	 * @return  array  The field option objects.
	 *
	 * @since   3.4.2
	 */
	public function getOptions()
	{
		$clientId = Factory::getApplication()->input->get('client_id', 0, 'int');
		$options  = ModulesHelper::getModules($clientId);

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

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