controller.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php');
/**
* Finder Component Controller.
*
* @since 2.5
*/
class FinderController extends JControllerLegacy
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached. [optional]
* @param array $urlparams An array of safe URL parameters and their variable types,
* for valid values see {@link JFilterInput::clean()}. [optional]
*
* @return JControllerLegacy This object is to support chaining.
*
* @since 2.5
*/
public function display($cachable = false, $urlparams = array())
{
$input = JFactory::getApplication()->input;
$cachable = true;
// Load plugin language files.
FinderHelperLanguage::loadPluginLanguage();
// Set the default view name and format from the Request.
$viewName = $input->get('view', 'search', 'word');
$input->set('view', $viewName);
// Don't cache view for search queries
if ($input->get('q', null, 'string') || $input->get('f', null, 'int') || $input->get('t', null, 'array'))
{
$cachable = false;
}
$safeurlparams = array(
'f' => 'INT',
'lang' => 'CMD'
);
return parent::display($cachable, $safeurlparams);
}
}