Skip to content

Commit 32c2d89

Browse files
committed
Add fallback icons
1 parent 3e92191 commit 32c2d89

File tree

8 files changed

+32
-16
lines changed

8 files changed

+32
-16
lines changed

src/Contao/Widgets/MultiColumnWizard.php

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* This file is part of menatwork/contao-multicolumnwizard-bundle.
55
*
6-
* (c) 2012-2025 MEN AT WORK.
6+
* (c) 2012-2026 MEN AT WORK.
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -43,7 +43,7 @@
4343
* @author David Greminger <david.greminger@1up.io>
4444
* @copyright 2011 Andreas Schempp
4545
* @copyright 2011 certo web & design GmbH
46-
* @copyright 2013-2025 MEN AT WORK
46+
* @copyright 2013-2026 MEN AT WORK
4747
* @license https://github.com/menatwork/contao-multicolumnwizard-bundle/blob/master/LICENSE LGPL-3.0-or-later
4848
* @filesource
4949
*/
@@ -159,9 +159,9 @@ class MultiColumnWizard extends Widget
159159
* @var array
160160
*/
161161
protected $arrButtons = [
162-
'new' => 'new.gif',
163-
'delete' => 'delete.gif',
164-
'move' => 'drag.gif'
162+
'new' => 'new.svg',
163+
'delete' => 'delete.svg',
164+
'move' => 'drag.svg'
165165
];
166166
/**
167167
* @var ContaoApiService
@@ -301,9 +301,9 @@ public function __set($strKey, $varValue)
301301
if ($varValue === false) {
302302
unset($this->arrButtons['move']);
303303
unset($this->arrButtons['delete']);
304-
$this->arrButtons['up'] = 'up.gif';
305-
$this->arrButtons['down'] = 'down.gif';
306-
$this->arrButtons['delete'] = 'delete.gif';
304+
$this->arrButtons['up'] = 'up.svg';
305+
$this->arrButtons['down'] = 'down.svg';
306+
$this->arrButtons['delete'] = 'delete.svg';
307307
}
308308
break;
309309

@@ -1084,7 +1084,7 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
10841084
if (($arrField['inputType'] ?? null) === 'textarea' && empty($arrField['eval']['rte'])) {
10851085
$xlabel .= ' '
10861086
. Image::getHtml(
1087-
'wrap.gif',
1087+
'wrap.svg',
10881088
$GLOBALS['TL_LANG']['MSC']['wordWrap'],
10891089
'title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['wordWrap'])
10901090
. '" class="toggleWrap" onclick="Backend.toggleWrap(\'ctrl_'
@@ -1110,7 +1110,7 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
11101110
. StringUtil::specialchars(str_replace("'", "\\'", $label))
11111111
. '\',\'url\':this.href});return false">'
11121112
. Image::getHtml(
1113-
'about.gif',
1113+
'about.svg',
11141114
$GLOBALS['TL_LANG']['MSC']['helpWizard'],
11151115
'style="vertical-align:text-bottom"'
11161116
) . '</a>';
@@ -1129,7 +1129,7 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
11291129
. '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['fileManager'])
11301130
. '" data-lightbox="files 765 80%">'
11311131
. Image::getHtml(
1132-
'filemanager.gif',
1132+
'filemanager.svg',
11331133
$GLOBALS['TL_LANG']['MSC']['fileManager'],
11341134
'style="vertical-align:text-bottom;"'
11351135
)
@@ -1147,23 +1147,23 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
11471147
. StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['tw_import'][1])
11481148
. '" onclick="Backend.getScrollOffset();">'
11491149
. Image::getHtml(
1150-
'tablewizard.gif',
1150+
'tablewizard.svg',
11511151
$GLOBALS['TL_LANG']['MSC']['tw_import'][0],
11521152
'style="vertical-align:text-bottom;"'
11531153
)
11541154
. '</a>';
11551155

11561156
$xlabel .= ' '
11571157
. Image::getHtml(
1158-
'demagnify.gif',
1158+
'demagnify.svg',
11591159
'',
11601160
'title="'
11611161
. StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['tw_shrink'])
11621162
. '" style="vertical-align:text-bottom; cursor:pointer;"'
11631163
. ' onclick="Backend.tableWizardResize(0.9);"'
11641164
)
11651165
. Image::getHtml(
1166-
'magnify.gif',
1166+
'magnify.svg',
11671167
'',
11681168
'title="'
11691169
. StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['tw_expand'])
@@ -1177,7 +1177,7 @@ protected function initializeWidget(&$arrField, $intRow, $strKey, $varValue)
11771177
. '" title="' . StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['lw_import'][1])
11781178
. '" onclick="Backend.getScrollOffset();">'
11791179
. Image::getHtml(
1180-
'tablewizard.gif',
1180+
'tablewizard.svg',
11811181
$GLOBALS['TL_LANG']['MSC']['tw_import'][0],
11821182
'style="vertical-align:text-bottom;"'
11831183
)
@@ -1765,13 +1765,23 @@ protected function generateButtonString($level = 0)
17651765
}
17661766

17671767
$btnName = \sprintf('tw_r%s', StringUtil::specialchars($button));
1768+
// Get a fallback icon if not found in the core.
1769+
if ('' === ($icon
1770+
= Image::getHtml($image, $GLOBALS['TL_LANG']['MSC'][$btnName], 'class="tl_listwizard_img"'))) {
1771+
$icon
1772+
= Image::getHtml(
1773+
'bundles/multicolumnwizard/img/' . $image,
1774+
$GLOBALS['TL_LANG']['MSC'][$btnName],
1775+
'class="tl_listwizard_img"'
1776+
);
1777+
}
17681778
$return .=
17691779
\sprintf(
17701780
'<a data-operations="%s" href="%s" class="widgetImage op-%s" title="%s">%s</a>',
17711781
$button,
17721782
$this->addToUrl(
17731783
\sprintf(
1774-
'&%s=%s&cid=%s&id=',
1784+
'&%s=%s&cid=%s&id=%s',
17751785
$this->strCommand,
17761786
$button,
17771787
$level,
-298 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Loading

src/Resources/public/img/down.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/Resources/public/img/drag.svg

Lines changed: 1 addition & 0 deletions
Loading

src/Resources/public/img/new.svg

Lines changed: 1 addition & 0 deletions
Loading

src/Resources/public/img/up.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)