CoreFiles by mySites.guru
helpsite.php66 lines, 1,561 bytes, from Joomla_3.2.0-Stable-Full_Package.zip
Raw History Compare with 3.1.6
md5
3775165b87817ae74ee1746184543735
sha1
450b761db0ecda675f2e4a087e58e5240572abcd
sha256
46fd14c3ed5ea819b6dcf9b7db986c6c860a0ba2a8f409bc7d451b6d4b92e85a
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  Form
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

JFormHelper::loadFieldClass('list');

/**
 * Form Field class for the Joomla Platform.
 * Provides a select list of help sites.
 *
 * @package     Joomla.Libraries
 * @subpackage  Form
 * @since       1.6
 */
class JFormFieldHelpsite extends JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var    string
	 * @since  1.6
	 */
	public $type = 'Helpsite';

	/**
	 * Method to get the help site field options.
	 *
	 * @return  array  The field option objects.
	 *
	 * @since   1.6
	 */
	protected function getOptions()
	{
		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), JHelp::createSiteList(JPATH_ADMINISTRATOR . '/help/helpsites.xml', $this->value));

		return $options;
	}

	/**
	 * Override to add refresh button
	 *
	 * @return  string  The field input markup.
	 *
	 * @since   3.2
	 */
	protected function getInput()
	{
		JHtml::script('system/helpsite.js', false, true);
		JFactory::getDocument()->addScriptDeclaration(
			'var helpsite_base = "' . addslashes(JUri::root()) . '";'
		);

		$html = parent::getInput();
		$button = '<button type="button" class="btn btn-small" id="helpsite-refresh" rel="' . $this->id . '"><span>' . JText::_('JGLOBAL_HELPREFRESH_BUTTON') . '</span></button>';

		return $html . $button;
	}
}

The same content is in 2 releases, Joomla 3.2.0 to 3.2.1. See them all, or every version of this file.