/
mod_minicck_filter.php
49 lines (37 loc) · 1.28 KB
/
mod_minicck_filter.php
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
<?php
/**
* @package Joomla.Site
* @subpackage mod_finder
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the helper.
require_once __DIR__ . '/helper.php';
require_once JPATH_ROOT. '/components/com_content/helpers/route.php';
$app = JFactory::getApplication();
$input = $app->input;
$option = $input->getString('option', '');
$view = $input->getString('view', '');
$catid = $input->getInt('catid', 0);
$id = $input->getInt('id', 0);
$minicckfilter = $input->get('minicckfilter', array(), 'array');
$allowedCats = $params->get('categories', array());
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
if($view == 'category')
{
$catid = $id;
}
if($option != 'com_content' || (!in_array($catid, $allowedCats) && $allowedCats[0] != -1) || $catid == 0)
{
return;
}
JHtml::_('behavior.framework');
$action = JRoute::_(ContentHelperRoute::getCategoryRoute($catid));
if(count($minicckfilter))
{
$app->setUserState('cat_'.$catid.'.minicckfilter', $minicckfilter);
}
$fields = ModMinicckFilterHelper::getFields($params, $catid);
require JModuleHelper::getLayoutPath('mod_minicck_filter', $params->get('layout', 'default'));