CoreFiles by mySites.guru
group.php60 lines, 1,459 bytes, from Joomla_2.5.4-Stable-Full_Package.zip
Raw History Compare with 2.5.3
md5
c80e2693e4ff7e4647fd76786ddb3fc2
sha1
fd876d619755beecb1781ad1d3df040cee4b1205
sha256
0662f91132e1d4087aa45b1151b3043d52bf2ada47abdb0c3da649fe9b3b7df1
<?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((string) $option)));
		}

		$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 5 releases, Joomla 2.5.4 to 2.5.8. See them all, or every version of this file.