Skip to content

Commit c9bd3fd

Browse files
committed
Add type factory.
1 parent 2d4eac3 commit c9bd3fd

File tree

3 files changed

+67
-24
lines changed

3 files changed

+67
-24
lines changed

contao/config/config.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

contao/config/event_listeners.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* The MetaModels extension allows the creation of multiple collections of custom items,
4+
* each with its own unique set of selectable attributes, with attribute extendability.
5+
* The Front-End modules allow you to build powerful listing and filtering of the
6+
* data in each collection.
7+
*
8+
* PHP version 5
9+
*
10+
* @package MetaModels
11+
* @subpackage FilterCheckbox
12+
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
13+
* @copyright The MetaModels team.
14+
* @license LGPL.
15+
* @filesource
16+
*/
17+
18+
use MetaModels\Filter\Setting\Events\CreateFilterSettingFactoryEvent;
19+
use MetaModels\Filter\Setting\CheckboxFilterSettingTypeFactory;
20+
use MetaModels\MetaModelsEvents;
21+
22+
return array
23+
(
24+
MetaModelsEvents::FILTER_SETTING_FACTORY_CREATE => array(
25+
function (CreateFilterSettingFactoryEvent $event) {
26+
$event->getFactory()->addTypeFactory(new CheckboxFilterSettingTypeFactory());
27+
}
28+
)
29+
);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* The MetaModels extension allows the creation of multiple collections of custom items,
4+
* each with its own unique set of selectable attributes, with attribute extendability.
5+
* The Front-End modules allow you to build powerful listing and filtering of the
6+
* data in each collection.
7+
*
8+
* PHP version 5
9+
*
10+
* @package MetaModels
11+
* @subpackage FilterCheckbox
12+
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
13+
* @copyright The MetaModels team.
14+
* @license LGPL.
15+
* @filesource
16+
*/
17+
18+
namespace MetaModels\Filter\Setting;
19+
20+
/**
21+
* Attribute type factory for tags filter settings.
22+
*/
23+
class CheckboxFilterSettingTypeFactory extends AbstractFilterSettingTypeFactory
24+
{
25+
/**
26+
* {@inheritDoc}
27+
*/
28+
public function __construct()
29+
{
30+
parent::__construct();
31+
32+
$this
33+
->setTypeName('checkbox')
34+
->setTypeIcon('system/modules/metamodelsfilter_checkbox/html/filter_checkbox.png')
35+
->setTypeClass('MetaModels\Filter\Setting\Checkbox')
36+
->allowAttributeTypes('checkbox');
37+
}
38+
}

0 commit comments

Comments
 (0)