Skip to content

Commit

Permalink
Use Lucide icons in the back end (see #7278)
Browse files Browse the repository at this point in the history
Description
-----------

Implements #7091

<img width="298" alt="" src="https://github.com/contao/contao/assets/1192057/ab780c37-a1ee-4f68-9734-a2fc0fb3efba">

<img width="526" alt="" src="https://github.com/contao/contao/assets/1192057/569e85fa-ff94-4ce5-9130-638deb2c5ed0">

<img width="400" alt="" src="https://github.com/contao/contao/assets/1192057/963a3e4e-4df2-4629-8ca5-130a2c52f441">

<img width="348" alt="" src="https://github.com/contao/contao/assets/1192057/6be535f3-dfe9-42e8-8bfd-f51de8334ee7">

<img width="509" alt="" src="https://github.com/contao/contao/assets/1192057/9343ada9-ac84-4b52-845c-83d5f97d7ff8">

Commits
-------

a617d5f Use Lucide icons in the back end
cc28f43 Update all icons except the page icons
1b78878 Update the page tree icons
daccd59 Update the placeholder icon
408a154 Fix the "paste in root" icon position and update the import/export icons
e6b2d68 Update the children.svg icon
840af49 Update the layout and modules icon
9254063 Adjust the template diff icon and the table wizard icon
b43708b Switch the import and export icons
49a2b57 Update the theme store icon
  • Loading branch information
leofeyer committed Jun 19, 2024
1 parent 2ff871d commit aa54c3d
Show file tree
Hide file tree
Showing 304 changed files with 539 additions and 571 deletions.
1 change: 0 additions & 1 deletion calendar-bundle/contao/dca/tl_calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@
),
'source' => array
(
'filter' => true,
'inputType' => 'radio',
'options_callback' => array('tl_calendar_events', 'getSourceOptions'),
'reference' => &$GLOBALS['TL_LANG']['tl_calendar_events'],
Expand Down
2 changes: 1 addition & 1 deletion calendar-bundle/public/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions core-bundle/contao/classes/DataContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,10 @@ protected function generateButtons($arrRow, $strTable, $arrRootIds=array(), $bln
{
$_icon = 'invisible.svg';
}
elseif ($icon == 'featured.svg')
{
$_icon = 'unfeatured.svg';
}

$state = $arrRow[$params['field']] ? 1 : 0;

Expand Down
4 changes: 2 additions & 2 deletions core-bundle/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ public function editForm(DataContainer $dc)
$title = sprintf($GLOBALS['TL_LANG']['tl_content']['editalias'], $dc->value);
$href = System::getContainer()->get('router')->generate('contao_backend', array('do'=>'form', 'table'=>'tl_form_field', 'id'=>$dc->value, 'popup'=>'1', 'nb'=>'1'));

return ' <a href="' . StringUtil::specialcharsUrl($href) . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('alias.svg', $title) . '</a>';
return ' <a href="' . StringUtil::specialcharsUrl($href) . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('edit.svg', $title) . '</a>';
}

/**
Expand Down Expand Up @@ -1414,7 +1414,7 @@ public function editModule(DataContainer $dc)
$title = sprintf($GLOBALS['TL_LANG']['tl_content']['editalias'], $module['id']);
$href = System::getContainer()->get('router')->generate('contao_backend', array('do'=>'themes', 'table'=>'tl_module', 'act'=>'edit', 'id'=>$module['id'], 'popup'=>'1', 'nb'=>'1'));

return ' <a href="' . StringUtil::specialcharsUrl($href) . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('alias.svg', $title) . '</a>';
return ' <a href="' . StringUtil::specialcharsUrl($href) . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('edit.svg', $title) . '</a>';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/dca/tl_theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
(
'edit',
'delete',
'show',
'modules' => array
(
'href' => 'table=tl_module',
Expand All @@ -90,6 +89,7 @@
'href' => 'table=tl_image_size',
'icon' => 'sizes.svg',
),
'show',
'exportTheme' => array
(
'href' => 'key=exportTheme',
Expand Down
1 change: 0 additions & 1 deletion core-bundle/contao/dca/tl_user_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
'themes' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_user']['themes'],
'filter' => true,
'inputType' => 'checkbox',
'options' => array('modules', 'layout', 'image_sizes', 'theme_import', 'theme_export'),
'reference' => &$GLOBALS['TL_LANG']['MOD'],
Expand Down
18 changes: 1 addition & 17 deletions core-bundle/contao/drivers/DC_Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,22 +470,6 @@ public function showAll()
Message::addInfo($GLOBALS['TL_LANG']['MSC']['searchExclude']);
}

if (isset($GLOBALS['TL_DCA'][$this->strTable]['config']['label']))
{
$label = $GLOBALS['TL_DCA'][$this->strTable]['config']['label'];
}
elseif (($do = Input::get('do')) && isset($GLOBALS['TL_LANG']['MOD'][$do]))
{
$label = $GLOBALS['TL_LANG']['MOD'][$do][0];
}
else
{
$label = $GLOBALS['TL_LANG']['MOD']['files'][0];
}

$icon = !empty($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['icon']) ? $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['icon'] : 'filemounts.svg';
$label = Image::getHtml($icon) . ' <label>' . $label . '</label>';

$requestToken = htmlspecialchars(System::getContainer()->get('contao.csrf.token_manager')->getDefaultTokenValue(), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5);
$strRefererId = System::getContainer()->get('request_stack')->getCurrentRequest()->attributes->get('_contao_referer_id');

Expand All @@ -512,7 +496,7 @@ public function showAll()
<label for="tl_select_trigger" class="tl_select_label">' . $GLOBALS['TL_LANG']['MSC']['selectAll'] . '</label> <input type="checkbox" id="tl_select_trigger" onclick="Backend.toggleCheckboxes(this)" class="tl_tree_checkbox">
</div>' : '') . '
<ul class="tl_listing tl_file_manager' . ($this->strPickerFieldType ? ' picker unselectable' : '') . '">
<li class="tl_folder_top cf"><div class="tl_left">' . $label . '</div> <div class="tl_right">' . (($blnClipboard && empty($this->arrFilemounts) && !\is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['root'] ?? null) && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['root'] ?? null) !== false && $security->isGranted(ContaoCorePermissions::DC_PREFIX . $this->strTable, new CreateAction($this->strTable))) ? '<a href="' . $this->addToUrl('&amp;act=' . $arrClipboard['mode'] . '&amp;mode=2&amp;pid=' . $this->strUploadPath . (!\is_array($arrClipboard['id'] ?? null) ? '&amp;id=' . $arrClipboard['id'] : '')) . '" title="' . StringUtil::specialchars($labelPasteInto[0]) . '" data-action="contao--scroll-offset#store">' . $imagePasteInto . '</a>' : '&nbsp;') . '</div></li>' . $return . '
<li class="tl_folder_top cf"><div class="tl_left"></div> <div class="tl_right">' . (($blnClipboard && empty($this->arrFilemounts) && !\is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['root'] ?? null) && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['root'] ?? null) !== false && $security->isGranted(ContaoCorePermissions::DC_PREFIX . $this->strTable, new CreateAction($this->strTable))) ? '<a href="' . $this->addToUrl('&amp;act=' . $arrClipboard['mode'] . '&amp;mode=2&amp;pid=' . $this->strUploadPath . (!\is_array($arrClipboard['id'] ?? null) ? '&amp;id=' . $arrClipboard['id'] : '')) . '" title="' . StringUtil::specialchars($labelPasteInto[0]) . '" data-action="contao--scroll-offset#store">' . $imagePasteInto . '</a>' : '&nbsp;') . '</div></li>' . $return . '
</ul>' . ($this->strPickerFieldType == 'radio' ? '
<div class="tl_radio_reset">
<label for="tl_radio_reset" class="tl_radio_label">' . $GLOBALS['TL_LANG']['MSC']['resetSelected'] . '</label> <input type="radio" name="picker" id="tl_radio_reset" value="" class="tl_tree_radio">
Expand Down
18 changes: 1 addition & 17 deletions core-bundle/contao/drivers/DC_Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -3858,22 +3858,6 @@ protected function treeView()
$arrClipboard = null;
}

if (isset($GLOBALS['TL_DCA'][$table]['config']['label']))
{
$label = $GLOBALS['TL_DCA'][$table]['config']['label'];
}
elseif (($do = Input::get('do')) && isset($GLOBALS['TL_LANG']['MOD'][$do]))
{
$label = $GLOBALS['TL_LANG']['MOD'][$do][0];
}
else
{
$label = $GLOBALS['TL_LANG']['MOD']['page'][0];
}

$icon = !empty($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['icon']) ? $GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['icon'] : 'pagemounts.svg';
$label = Image::getHtml($icon) . ' <label>' . $label . '</label>';

// Check the default labels (see #509)
$labelNew = $GLOBALS['TL_LANG'][$this->strTable]['new'] ?? $GLOBALS['TL_LANG']['DCA']['new'];
$security = System::getContainer()->get('security.helper');
Expand Down Expand Up @@ -3993,7 +3977,7 @@ protected function treeView()
<label for="tl_select_trigger" class="tl_select_label">' . $GLOBALS['TL_LANG']['MSC']['selectAll'] . '</label> <input type="checkbox" id="tl_select_trigger" onclick="Backend.toggleCheckboxes(this)" class="tl_tree_checkbox">
</div>' : '') . '
<ul class="tl_listing ' . $treeClass . ($this->strPickerFieldType ? ' picker unselectable' : '') . '">
<li class="tl_folder_top cf"><div class="tl_left">' . $label . '</div> <div class="tl_right">';
<li class="tl_folder_top cf"><div class="tl_left"></div> <div class="tl_right">';

$_buttons = '&nbsp;';

Expand Down
13 changes: 10 additions & 3 deletions core-bundle/contao/library/Contao/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,19 @@ class Image
{
private static array $deprecated = array
(
'folPlus',
'alias',
'copychilds',
'copychilds_',
'filemanager',
'folMinus',
'folPlus',
'header',
'header_',
'important',
'manager',
'pickfile',
'settings',
'unpublished',
);

private static array $disabled = array
Expand All @@ -32,11 +40,10 @@ class Image
'article_',
'children_',
'copy_',
'copychilds_',
'cut_',
'delete_',
'diffTemplate_',
'diff_',
'diffTemplate_',
'edit_',
'editor_',
'featured_',
Expand Down
2 changes: 0 additions & 2 deletions core-bundle/contao/themes/flexible/backend.b4bca1db.css

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions core-bundle/contao/themes/flexible/backend.f3c2f972.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"entrypoints": {
"backend": {
"css": [
"/system/themes/flexible/backend.b4bca1db.css"
"/system/themes/flexible/backend.f3c2f972.css"
]
},
"confirm": {
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/1cl--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/1cl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/1rw--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/1rw.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2cll--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2cll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2clr--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2clr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2rwf--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2rwf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2rwh--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/2rwh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/3cl--dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion core-bundle/contao/themes/flexible/icons/3cl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit aa54c3d

Please sign in to comment.