Skip to content

Commit d40a600

Browse files
committed
Add style for wrapper element
e.g. `` 'col_caption' => [ 'label' => 'Bildunterschrift', 'exclude' => true, 'inputType' => 'text', 'eval' => [ 'style' => 'width:100%', 'maxlength' => 100, 'wrapper_style' => 'width:200px', ] ], ``
1 parent 20319c9 commit d40a600

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

.github/workflows/diagnostics.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040
with:
4141
fetch-depth: 0
4242

@@ -48,15 +48,15 @@ jobs:
4848
coverage: none
4949

5050
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory
51-
uses: actions/cache@v3
51+
uses: actions/cache@v4
5252
env:
5353
cache-name: composer-cache-dir-${{ matrix.php }}-${{ matrix.contao }}
5454
with:
5555
path: ~/.cache/composer
5656
key: ${{ runner.os }}-build-${{ env.cache-name }}
5757

5858
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
env:
6161
cache-name: composer-vendor-${{ matrix.php }}-${{ matrix.contao }}
6262
with:
@@ -78,7 +78,7 @@ jobs:
7878
run: ./vendor/bin/phpcq run -v -o github-action -o default ${{ matrix.phpcq_flags }}
7979

8080
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Upload build directory to artifact
81-
uses: actions/upload-artifact@v3
81+
uses: actions/upload-artifact@v4
8282
if: ${{ success() }} || ${{ failure() }}
8383
with:
8484
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }}

src/Contao/Widgets/MultiColumnWizard.php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -983,19 +983,20 @@ function ($value) {
983983

984984
// Build array of items
985985
if (!empty($arrField['eval']['columnPos'])) {
986-
$arrItems[$i][$objWidget->columnPos]['entry'] =
986+
$arrItems[$i][$objWidget->columnPos]['entry'] =
987987
($arrItems[$i][$objWidget->columnPos]['entry'] ?? '') . $strWidget;
988-
$arrItems[$i][$objWidget->columnPos]['valign'] = ($arrField['eval']['valign'] ?? '');
989-
$arrItems[$i][$objWidget->columnPos]['tl_class'] = ($arrField['eval']['tl_class'] ?? '');
990-
$arrItems[$i][$objWidget->columnPos]['hide'] = $blnHiddenBody;
988+
$arrItems[$i][$objWidget->columnPos]['valign'] = ($arrField['eval']['valign'] ?? '');
989+
$arrItems[$i][$objWidget->columnPos]['tl_class'] = ($arrField['eval']['tl_class'] ?? '');
990+
$arrItems[$i][$objWidget->columnPos]['wrapper_style'] = ($arrField['eval']['wrapper_style'] ?? '');
991+
$arrItems[$i][$objWidget->columnPos]['hide'] = $blnHiddenBody;
991992
} else {
992-
$arrItems[$i][$strKey] = array
993-
(
994-
'entry' => $strWidget,
995-
'valign' => $arrField['eval']['valign'] ?? null,
996-
'tl_class' => $arrField['eval']['tl_class'] ?? null,
997-
'hide' => $blnHiddenBody
998-
);
993+
$arrItems[$i][$strKey] = [
994+
'entry' => $strWidget,
995+
'valign' => $arrField['eval']['valign'] ?? null,
996+
'tl_class' => $arrField['eval']['tl_class'] ?? null,
997+
'wrapper_style' => $arrField['eval']['wrapper_style'] ?? null,
998+
'hide' => $blnHiddenBody
999+
];
9991000
}
10001001
}
10011002
}
@@ -1545,8 +1546,9 @@ protected function generateTable(
15451546
}
15461547

15471548
$return .= '<td'
1548-
. ($itemValue['valign'] != '' ? ' valign="' . $itemValue['valign'] . '"' : '')
1549-
. ($itemValue['tl_class'] != '' ? ' class="' . $itemValue['tl_class'] . '"' : '')
1549+
. ($itemValue['valign'] !== '' ? ' valign="' . $itemValue['valign'] . '"' : '')
1550+
. ($itemValue['tl_class'] !== '' ? ' class="' . $itemValue['tl_class'] . '"' : '')
1551+
. ($itemValue['wrapper_style'] !== '' ? ' style="' . $itemValue['wrapper_style'] . '"' : '')
15501552
. '>'
15511553
. $itemValue['entry']
15521554
. '</td>';
@@ -1665,7 +1667,7 @@ protected function generateDiv(
16651667
$arrColorpicker,
16661668
$strHidden,
16671669
$arrItems,
1668-
$arrHiddenHeader = array()
1670+
$arrHiddenHeader = []
16691671
) {
16701672
// generate header fields
16711673
foreach ($this->columnFields as $strKey => $arrField) {
@@ -1708,17 +1710,20 @@ protected function generateDiv(
17081710

17091711

17101712
// new array for items so we get rid of the ['entry'] and ['valign']
1711-
$arrReturnItems = array();
1713+
$arrReturnItems = [];
17121714

17131715
foreach ($arrItems as $itemKey => $itemValue) {
17141716
if ($itemValue['hide']) {
17151717
$itemValue['tl_class'] .= ' hidden';
17161718
}
17171719

17181720
$arrReturnItems[$itemKey] = '<div'
1719-
. ($itemValue['tl_class'] != ''
1721+
. ($itemValue['tl_class'] !== ''
17201722
? ' class="' . $itemValue['tl_class'] . '"'
17211723
: '')
1724+
. ($itemValue['wrapper_style'] !== ''
1725+
? ' style="' . $itemValue['wrapper_style'] . '"'
1726+
: '')
17221727
. '>'
17231728
. $itemValue['entry']
17241729
. '</div>';

0 commit comments

Comments
 (0)