CoreFiles by mySites.guru
view.opensearch.php48 lines, 1,318 bytes, from Joomla_2.5.5-Stable-Full_Package.zip
Raw History Compare with 2.5.4
md5
cd700f9d107936603fd735d8949b2375
sha1
e4a9f65f797478a7ed94fa102fcf8c78fbee7fec
sha256
2dfa7c7a4989f437e4f6439d4fab5f70fe2956f94105ef08eddb09b4559cdff9
<?php
/**
 * @package		Joomla.Site
 * @subpackage	Weblinks
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

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

jimport('joomla.application.component.view');
jimport('joomla.environment.uri');

/**
 * OpenSearch View class for the Search component
 *
 * @static
 * @package		Joomla.Site
 * @subpackage	Search
 * @since 1.7
 */
class SearchViewSearch extends JView
{
	function display($tpl = null)
	{
		$doc = JFactory::getDocument();
		$app = JFactory::getApplication();

		$params = JComponentHelper::getParams('com_search');
		$doc->setShortName($params->get('opensearch_name', $app->getCfg('sitename')));
		$doc->setDescription($params->get('opensearch_description', $app->getCfg('MetaDesc')));

		// Add the URL for the search
		$searchUri = JURI::base().'index.php?option=com_search&searchword={searchTerms}';

		// Find the menu item for the search
		$menu	= $app->getMenu();
		$items	= $menu->getItems('link', 'index.php?option=com_search&view=search');
		if (isset($items[0])) {
			$searchUri .= '&Itemid='.$items[0]->id;
		}

		$htmlSearch = new JOpenSearchUrl();
		$htmlSearch->template = JRoute::_($searchUri);
		$doc->addUrl($htmlSearch);
	}
}

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