Skip to content

Commit e2d2aa2

Browse files
committed
Merge pull request #1258 from @zonky2
Add checkbox to enable/disable frontend widgets Frontend filter widgets for simple lookup can now be enabled and disabled via a checkbox.
2 parents 45d8da3 + 0880c3b commit e2d2aa2

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

contao/dca/tl_metamodel_filtersetting.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@
267267
(
268268
'urlparam',
269269
'predef_param',
270+
'fe_widget',
270271
'allow_empty',
271272
'label',
272273
'template',
@@ -424,7 +425,19 @@
424425
'eval' => array
425426
(
426427
'alwaysSave' => true,
427-
'tl_class' => 'clr w50 m12',
428+
'tl_class' => 'w50 m12',
429+
),
430+
'sql' => "char(1) NOT NULL default ''"
431+
),
432+
'fe_widget' => array
433+
(
434+
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fe_widget'],
435+
'exclude' => true,
436+
'inputType' => 'checkbox',
437+
'eval' => array
438+
(
439+
'alwaysSave' => true,
440+
'tl_class' => 'w50 m12',
428441
),
429442
'sql' => "char(1) NOT NULL default ''"
430443
),

contao/languages/en/tl_metamodel_filtersetting.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['predef_param'][1] =
5555
'Check if you want to be able to set the value of this parameter in the parenting list ' .
5656
'(modules, content elements, etc.).';
57+
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fe_widget'][0] = 'Provide Frontend widget';
58+
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fe_widget'][1] =
59+
'Check if you want to display a filter widget in the Frontend.';
5760
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['customsql'][0] = 'Custom SQL Query';
5861
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['customsql'][1] =
5962
'The SQL query that shall be executed, insert tags are supported.';

src/MetaModels/Filter/Setting/SimpleLookup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function getParameterFilterOptions($objAttribute, $arrIds, &$arrCount
123123
*/
124124
public function enableFEFilterWidget()
125125
{
126-
return (bool) $this->get('predef_param');
126+
return (bool) $this->get('fe_widget');
127127
}
128128

129129
/**

0 commit comments

Comments
 (0)