Skip to content

Commit c066860

Browse files
committed
Merge tag '2.0.7'
Maintenance release. Fixes: - #1256 - Fix warning of undefined constants TL_ASSETS_URL and TL_FILES_URL. - #1257 - Hide sorting hint in popup widgets. - #1258, #1234 Frontend filter widgets for simple lookup can now be enabled and disabled via a checkbox. - #1259 - Changed the default behavior of the `getFilterOptions` to `usedOnly` if no id list is given.
2 parents 5f58d79 + f894319 commit c066860

File tree

10 files changed

+57
-14
lines changed

10 files changed

+57
-14
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
dist: xenial
2+
3+
addons:
4+
apt:
5+
packages:
6+
- ant-optional
7+
18
language: php
29

310
php:
11+
- "7.3"
412
- "7.2"
513
- "7.1"
614
- "7.0"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"require": {
3333
"php": "^5.6 || ^7.0",
3434
"contao-community-alliance/composer-plugin": "^2.4",
35-
"contao-community-alliance/dc-general": "^2.0.0-beta49@beta",
35+
"contao-community-alliance/dc-general": "^2.0.0",
3636
"contao-community-alliance/dependency-container": "^1.8",
3737
"contao-community-alliance/event-dispatcher": "~1.3",
3838
"contao-community-alliance/events-contao-bindings": "^3.5",

contao/assets/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
background-color: #ebebe4;
129129
}
130130

131+
form[id^=mm_] .sort_hint{
132+
display:none;
133+
}
134+
131135
/* Wildcard */
132136
.wc_info {
133137
margin: 0;

contao/assets/css/style_src.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ textarea[readonly]:focus {
128128
background-color: #ebebe4;
129129
}
130130

131+
form[id^=mm_] .sort_hint{
132+
display:none;
133+
}
134+
131135
/* Wildcard */
132136
.wc_info {
133137
margin: 0;

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/de/tl_metamodel_filtersetting.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
<?php
22
/**
3-
* Translations are managed using Transifex. To create a new translation
4-
* or to help to maintain an existing one, please register at transifex.com.
3+
* This file is part of MetaModels/core.
4+
*
5+
* (c) 2012-2018 The MetaModels team.
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
59
*
6-
* @link http://help.transifex.com/intro/translating.html
7-
* @link https://www.transifex.com/projects/p/metamodels/language/de/
10+
* This project is provided in good faith and hope to be usable by anyone.
811
*
9-
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
12+
* Translations are managed automatically using Transifex. To create a new translation
13+
* or to help to maintain an existing one, please register at transifex.com.
14+
*
15+
* Last-updated: 2018-12-18T21:45:41+01:00
1016
*
11-
* last-updated: 2018-07-13T10:50:35+02:00
17+
* @copyright 2012-2018 The MetaModels team.
18+
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
19+
* @link https://www.transifex.com/metamodels/public/
20+
* @link https://www.transifex.com/signup/?join_project=metamodels
1221
*/
1322

23+
1424
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['all_langs']['0'] = 'Alle Sprachen durchsuchen';
1525
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['all_langs']['1'] = 'Auswählen, falls Sie sprachunabhängige Suche ermöglichen möchten. Wenn nicht angewählt wird nur die aktive Sprache für die Suche benutzt.';
1626
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['allow_empty']['0'] = 'Leeren Wert erlauben';
@@ -36,6 +46,8 @@
3646
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['edit']['1'] = 'Die Filtereinstellung ID %s bearbeiten.';
3747
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['enabled']['0'] = 'Aktiviert';
3848
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['enabled']['1'] = 'Aktivieren Sie diese Filtereinstellung.';
49+
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fe_widget']['0'] = 'Frontend Widget bereitstellen';
50+
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fe_widget']['1'] = 'Auswählen, wenn Sie den Filter als Filter-Widget im Frontend anzeigen möchten.';
3951
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fefilter_legend'] = 'Frontendfilter';
4052
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fid']['0'] = 'Aus übergeordnetem Element';
4153
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['fid']['1'] = 'Filtereinstellung(en), zu denen diese Einstellungen gehören.';
@@ -56,7 +68,7 @@
5668
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['pastenew']['1'] = 'Neue Einstellung nach dem Element ID %s erstellen';
5769
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['predef_param']['0'] = 'Statischer Parameter';
5870
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['predef_param']['1'] = 'Auswählen, wenn Sie Werte für diesen Parameter aus einer übergordneten Liste (wie zum Beispiel Module, Inhaltselemente, etc.) beziehen möchten.';
59-
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['show']['0'] = 'Details';
71+
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['show']['0'] = 'Details der Filtereinstellungen';
6072
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['show']['1'] = 'Die Details der Filtereinstellung ID %s anzeigen.';
6173
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['skipfilteroptions']['0'] = 'Diesen Filter für verbleibende Werte ignorieren';
6274
$GLOBALS['TL_LANG']['tl_metamodel_filtersetting']['skipfilteroptions']['1'] = 'Falls aktiviert wird dieser Filter alle Werte außer seine eigenen zurück liefern.';

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/Attribute/BaseSimple.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,13 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
102102
ORDER BY FIELD(id,' . $this->parameterMask($idList). ')'
103103
)
104104
->execute(array_merge($idList, $idList));
105-
} elseif ($usedOnly) {
105+
} else {
106106
$objRow = $this->getMetaModel()->getServiceContainer()->getDatabase()->execute(
107107
'SELECT ' . $strCol . ', COUNT(' . $strCol . ') as mm_count
108108
FROM ' . $this->getMetaModel()->getTableName() . '
109109
GROUP BY ' . $strCol . '
110110
ORDER BY ' . $strCol
111111
);
112-
} else {
113-
// We can not do anything here, must be handled by the derived attribute class.
114-
return array();
115112
}
116113

117114
$arrResult = array();

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
/**

src/MetaModels/Widgets/PickerWidget.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @author Ingolf Steinhardt <[email protected]>
1919
* @author David Maack <[email protected]>
2020
* @author Stefan Heimes <[email protected]>
21+
* @author David Molineus <[email protected]>
2122
* @copyright 2012-2018 The MetaModels team.
2223
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
2324
* @filesource
@@ -51,6 +52,7 @@ class PickerWidget
5152
public function __construct()
5253
{
5354
BackendUser::getInstance()->authenticate();
55+
Controller::setStaticUrls();
5456
Controller::loadLanguageFile('default');
5557
Controller::loadLanguageFile('modules');
5658
}

0 commit comments

Comments
 (0)