mod_finder.php
1.77 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
<?php
/**
* @package Joomla.Site
* @subpackage mod_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('FinderHelperRoute', JPATH_SITE . '/components/com_finder/helpers/route.php');
JLoader::register('FinderHelperLanguage', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/language.php');
// Include the helper.
JLoader::register('ModFinderHelper', __DIR__ . '/helper.php');
if (!defined('FINDER_PATH_INDEXER'))
{
define('FINDER_PATH_INDEXER', JPATH_ADMINISTRATOR . '/components/com_finder/helpers/indexer');
}
JLoader::register('FinderIndexerQuery', FINDER_PATH_INDEXER . '/query.php');
// Check for OpenSearch
if ($params->get('opensearch', 1))
{
/*
This code intentionally commented
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$ostitle = $params->get('opensearch_title', JText::_('MOD_FINDER_SEARCHBUTTON_TEXT') . ' ' . $app->get('sitename'));
$doc->addHeadLink(
JUri::getInstance()->toString(array('scheme', 'host', 'port')) . JRoute::_('&option=com_finder&format=opensearch'),
'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml')
);
*/
}
// Initialize module parameters.
$params->def('field_size', 20);
// Get the route.
$route = FinderHelperRoute::getSearchRoute($params->get('searchfilter', null));
// Load component language file.
FinderHelperLanguage::loadComponentLanguage();
// Load plugin language files.
FinderHelperLanguage::loadPluginLanguage();
// Get Smart Search query object.
$query = ModFinderHelper::getQuery($params);
require JModuleHelper::getLayoutPath('mod_finder', $params->get('layout', 'default'));