CoreFiles by mySites.guru
group.php60 lines, 1,458 bytes, from Joomla_2.5.3-Stable-Full_Package.zip
Raw History Compare with 2.5.2
md5
486fdf5c8bdd3d954f64c8ce949af861
sha1
7fdfad1e9280082cc66448100a84a2872249175a
sha256
50b850a4500592398a6eea3d951b2335a537154fb44e4e520492825e7c5a4eb8
<?php
/**
 * @package		Joomla.Administrator
 * @subpackage	com_installer
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License, see LICENSE.php
 */

// No direct access.
defined('_JEXEC') or die;

/**
 * Form Field Place class.
 *
 * @package		Joomla.Administrator
 * @subpackage	com_installer
 * @since		1.6
 */
class JFormFieldGroup extends JFormField
{
	/**
	 * The field type.
	 *
	 * @var		string
	 */
	protected $type = 'Group';

	/**
	 * Method to get the field input.
	 *
	 * @return	string		The field input.
	 * @since	1.6
	 */
	protected function getInput()
	{
		$onchange	= $this->element['onchange'] ? ' onchange="'.(string) $this->element['onchange'].'"' : '';
		$options = array();

		foreach ($this->element->children() as $option) {
			$options[] = JHtml::_('select.option', (string)$option->attributes()->value, JText::_(trim($option->data())));
		}

		$dbo = JFactory::getDbo();
		$query = $dbo->getQuery(true);
		$query->select('DISTINCT folder');
		$query->from('#__extensions');
		$query->where('folder != '.$dbo->quote(''));
		$query->order('folder');
		$dbo->setQuery((string)$query);
		$folders = $dbo->loadColumn();

		foreach($folders as $folder) {
			$options[] = JHtml::_('select.option', $folder, $folder);
		}

		$return = JHtml::_('select.genericlist', $options, $this->name, $onchange, 'value', 'text', $this->value, $this->id);

		return $return;
	}
}

The same content is in 4 releases, Joomla 2.5.0 to 2.5.3. See them all, or every version of this file.