CoreFiles by mySites.guru
view.opensearch.php44 lines, 1,240 bytes, from Joomla_3.0.0-Stable-Full_Package.zip
Raw History Compare with 2.5.28
md5
79cd41f3067256f407d704d4ad800fdd
sha1
82a2b8897e5ec3f1122d14b3a72833dd152d2e85
sha256
fb08e6c42c4c0c0a50a60b042a88c13471e4f357e011f37dd9a0cd431f2be105
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_search
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * OpenSearch View class for the Search component
 *
 * @package     Joomla.Site
 * @subpackage  Search
 * @since       1.7
 */
class SearchViewSearch extends JViewLegacy
{
	public 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);
	}
}

The same content is in 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.