CoreFiles by mySites.guru
suggestions.json.php53 lines, 1,083 bytes, from Joomla_2.5.13-Stable-Full_Package.zip
Raw History Compare with 2.5.11
md5
25659d53e2a9a0d4538e4dc5daa470f9
sha1
35216b37965e81e00c03529ebe8734fe35deedc4
sha256
a39eb32725daab770a1fa133e13f91a18cd9e0d37d4d91d9f95aecc8555e8342
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die;

/**
 * Suggestions JSON controller for Finder.
 *
 * @package     Joomla.Site
 * @subpackage  com_finder
 * @since       2.5
 */
class FinderControllerSuggestions extends JControllerLegacy
{
	/**
	 * Method to find search query suggestions.
	 *
	 * @return  void
	 *
	 * @since   2.5
	 */
	public function display()
	{
		$return = array();

		$params = JComponentHelper::getParams('com_finder');
		if ($params->get('show_autosuggest', 1))
		{
			// Get the suggestions.
			$model = $this->getModel('Suggestions', 'FinderModel');
			$return = $model->getItems();
		}

		// Check the data.
		if (empty($return))
		{
			$return = array();
		}

		// Use the correct json mime-type
		header('Content-Type: application/json');

		// Send the response.
		echo json_encode($return);
		JFactory::getApplication()->close();
	}
}

The same content is in 8 releases, Joomla 2.5.9 to 2.5.17. See them all, or every version of this file.