CoreFiles by mySites.guru
suggestions.json.php52 lines, 1,049 bytes, from Joomla_2.5.3-Stable-Full_Package.zip
Raw History Compare with 2.5.2
md5
4ecaf66487eb16a404d07558afac5dbd
sha1
6fd800cdc8fc268a8feece5bd08d1945d1c9f154
sha256
3b4e103c75a8efaee8a2d248ba186d4bf386671140efab20d847b37a50bd571c
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

/**
 * Suggestions JSON controller for Finder.
 *
 * @package     Joomla.Site
 * @subpackage  com_finder
 * @since       2.5
 */
class FinderControllerSuggestions extends JController
{
	/**
	 * 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();
		}

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

The same content is in 6 releases, Joomla 2.5.0 to 2.5.5. See them all, or every version of this file.