-
Notifications
You must be signed in to change notification settings - Fork 42
/
ModuleMetaModelFrontendFilter.php
75 lines (64 loc) · 1.73 KB
/
ModuleMetaModelFrontendFilter.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* The MetaModels extension allows the creation of multiple collections of custom items,
* each with its own unique set of selectable attributes, with attribute extendability.
* The Front-End modules allow you to build powerful listing and filtering of the
* data in each collection.
*
* PHP version 5
* @package MetaModels
* @subpackage FrontendFilter
* @author Christian de la Haye <service@delahaye.de>
* @copyright The MetaModels team.
* @license LGPL.
* @filesource
*/
/**
* FE-module for FE-filtering
*
* @package MetaModels
* @subpackage FrontendFilter
* @author Christian de la Haye <service@delahaye.de>
*/
class ModuleMetaModelFrontendFilter extends Module
{
/**
* Template
* @var string
*/
protected $strTemplate = 'mm_filter_default';
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE')
{
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### METAMODELS FE-FILTERBLOCK ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->title;
$objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id;
return $objTemplate->parse();
}
return parent::generate();
}
/**
* Generate module
*/
protected function compile()
{
// get filter data
$objFilter = new MetaModelFrontendFilter();
$arrFilter = $objFilter->getMetaModelFrontendFilter($this);
// get template
if ($this->metamodel_fef_template)
{
$this->Template = new FrontendTemplate($this->metamodel_fef_template);
}
$this->Template->setData($arrFilter);
$this->Template->submit = $arrFilter['submit'];
}
}