CoreFiles by mySites.guru
extension.php65 lines, 1,453 bytes, from Joomla_3.9.0-alpha-Alpha-Full_Package.zip
Raw History Compare with 3.7.0-alpha2
md5
ff7e4c8d5b278772838c1b1ee3c7b2ac
sha1
4f320c30fa17f77b678d50a58e44d1aaca55eea4
sha256
9c55a011be6e737bcb004d78fd6b75fc9c5bebef90f2f67ebfd42fd554112168
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_actionlogs
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('list');
JLoader::register('ActionlogsHelper', JPATH_COMPONENT . '/helpers/actionlogs.php');

/**
 * Field to load a list of all users that have logged actions
 *
 * @since  3.9.0
 */
class JFormFieldExtension extends JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  3.9.0
	 */
	protected $type = 'extension';

	/**
	 * Method to get the options to populate list
	 *
	 * @return  array  The field option objects.
	 *
	 * @since   3.9.0
	 */
	public function getOptions()
	{
		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select('DISTINCT ' . $db->quoteName('extension'))
			->from($db->quoteName('#__action_logs'))
			->order($db->quoteName('extension'));

		$db->setQuery($query);
		$context = $db->loadColumn();

		$options = array();

		foreach ($context as $item)
		{
			$extensions[] = strtok($item, '.');
		}

		$extensions = array_unique($extensions);

		foreach ($extensions as $extension)
		{
			ActionlogsHelper::loadTranslationFiles($extension);
			$options[] = JHtml::_('select.option', $extension, JText::_($extension));
		}

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

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