use svg icon

This commit is contained in:
Jean-Christian Denis 2022-11-26 15:12:54 +01:00
parent 80dd2610f5
commit 9014735339
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
4 changed files with 32 additions and 5 deletions

View file

@ -16,12 +16,12 @@ if (!defined('DC_CONTEXT_ADMIN')) {
dcCore::app()->addBehavior('adminModulesListGetActions', ['translaterAdminBehaviors', 'adminModulesGetActions']); dcCore::app()->addBehavior('adminModulesListGetActions', ['translaterAdminBehaviors', 'adminModulesGetActions']);
dcCore::app()->addBehavior('adminModulesListDoActions', ['translaterAdminBehaviors', 'adminModulesDoActions']); dcCore::app()->addBehavior('adminModulesListDoActions', ['translaterAdminBehaviors', 'adminModulesDoActions']);
dcCore::app()->addBehavior('adminDashboardFavoritesV2', ['translaterAdminBehaviors', 'adminDashboardFavorites']); dcCore::app()->addBehavior('adminDashboardFavoritesV2', ['translaterAdminBehaviors', 'adminDashboardFavoritesV2']);
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
__('Translater'), __('Translater'),
dcCore::app()->adminurl->get('translater'), dcCore::app()->adminurl->get('translater'),
dcPage::getPF('translater/icon.png'), dcPage::getPF('translater/icon.svg'),
preg_match( preg_match(
'/' . preg_quote(dcCore::app()->adminurl->get('translater')) . '(&.*)?$/', '/' . preg_quote(dcCore::app()->adminurl->get('translater')) . '(&.*)?$/',
$_SERVER['REQUEST_URI'] $_SERVER['REQUEST_URI']
@ -102,13 +102,13 @@ class translaterAdminBehaviors
* *
* @param dcFavorites $favs dcFavorites instance * @param dcFavorites $favs dcFavorites instance
*/ */
public static function adminDashboardFavorites(dcFavorites$favs): void public static function adminDashboardFavoritesV2(dcFavorites $favs): void
{ {
$favs->register('translater', [ $favs->register('translater', [
'title' => __('Translater'), 'title' => __('Translater'),
'url' => dcCore::app()->adminurl->get('translater'), 'url' => dcCore::app()->adminurl->get('translater'),
'small-icon' => urldecode(dcPage::getPF('translater/icon.png')), 'small-icon' => urldecode(dcPage::getPF('translater/icon.svg')),
'large-icon' => urldecode(dcPage::getPF('translater/icon-big.png')), 'large-icon' => urldecode(dcPage::getPF('translater/icon.svg')),
'permissions' => dcCore::app()->auth->isSuperAdmin(), 'permissions' => dcCore::app()->auth->isSuperAdmin(),
]); ]);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

27
icon.svg Normal file
View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve"> <image id="image0" width="64" height="64" x="0" y="0"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAAK/INwWK6QAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABC1BMVEX///8Te7sTe7sTe7sT
e7sTe7sTe7sTe7sTe7sTe7sTe7sTe7sTe7sTe7sTe7sTe7vETVgaebe8T1yfV23ETVhLbJyRWnUx
c6rBTlrETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjE
TVjETVjETVjETVjETVjETVjETVjETVjETVjETVirU2bETVicV2/ETVjETVjETVjETVixUmLETVjE
TVjETVjETVjETVjETVjETVjETVjETVjETVjETVgTe7sodq/ETVi4UF9JbZ11YoQXerlgZ5DATlqf
V202cqetU2UdeLWKXHm6UF4Vero0cqj///9DY0AeAAAAR3RSTlMAAIi73USZdzPMEVWqZiLuCZug
+1cv+sT0TpAGbPnMIScz2/B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