use svg icon

master
Jean-Christian Paul Denis 2022-11-26 15:04:22 +01:00
parent bbda2b142f
commit 84bf5d08a0
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951
5 changed files with 22 additions and 17 deletions

View File

@ -21,7 +21,7 @@ if (dcCore::app()->blog->settings->postwidgettext->postwidgettext_active) {
dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem(
__('Post widget text'),
dcCore::app()->adminurl->get('admin.plugin.postWidgetText'),
dcPage::getPF('postWidgetText/icon.png'),
dcPage::getPF('postWidgetText/icon.svg'),
preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.postWidgetText')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
dcCore::app()->auth->check(dcAuth::PERMISSION_CONTENT_ADMIN, dcCore::app()->blog->id)
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

19
icon.svg 100644
View File

@ -0,0 +1,19 @@
<?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,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAilBMVEUAAABnbnhnbniawSOa
wSOawSOawSOawSOawSOawSPETViawSOawSOawSOawSOawSOawSOawSNnbnhnbnhnbnhnbngTe7tn
bnhnbnhnbnhnbnhnbnjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVjETVhnbnia
wSPETVgTe7v///9kF9VQAAAAKXRSTlMA31Agr++An2C/n89A3xBQcDBAMGDvnxC/gK8gMIBwIGCP
UN8Q769Az1XOQMkAAAABYktHRC3N2kE9AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH5gsa
EAAKuE6euwAAASxJREFUWMPt12kPgjAMBuBuKCoeeIC34q2A///3Oc+5IdIyY4zh/YjpE9ZBhxAi
wziIWKXoKWVbXMICYSgEqxypqVAABlCK9FQBGyEAJOqjWgEUwB1w4pdx0ECcku8B+CXUE4BNa2JD
r2+2aAC46kCoW+j6GwAt136k3cGXP4D8+RzQlenlADxfGZME4gp42qD1L0L/+DZ9CQx8fVQPz78d
MyIBnhz2NGD0GsAvIQXAN/F/AeMmGm+j8YNk8iiPTV+mCREAzpRXCV8vB8pEDpQBvvz9SMM3MSX4
bRSZzmTmAR3QjsEFdQlL/QBd0ZoYJE7gNQ1YZHwDZAKzAvhRIESHmQLcDLj87cvRA/XwKQCAVa5d
YBLYbPX6HQLgkH4L2yATYFxZ0v7wXO9s4ARgukreO1JMPAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAy
Mi0xMS0yNlQxNTowMDoxMCswMTowMOPS2NEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMTEtMjZU
MTU6MDA6MTArMDE6MDCSj2BtAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMUfzQjcA
AAAASUVORK5CYII=" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -70,29 +70,15 @@ class adminPostWidgetText
$favs->register('postWidgetText', [
'title' => __('Post widget text'),
'url' => dcCore::app()->adminurl->get('admin.plugin.postWidgetText'),
'small-icon' => dcPage::getPF('postWidgetText/icon.png'),
'large-icon' => dcPage::getPF('postWidgetText/icon-big.png'),
'small-icon' => dcPage::getPF('postWidgetText/icon.svg'),
'large-icon' => dcPage::getPF('postWidgetText/icon.svg'),
'permissions' => dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([
dcAuth::PERMISSION_USAGE,
dcAuth::PERMISSION_CONTENT_ADMIN,
]), dcCore::app()->blog->id),
'active_cb' => ['adminPostWidgetText', 'adminDashboardFavoritesActive'],
]);
}
/**
* Favorites selection.
*
* @param string $request Requested page
* @param array $params Requested parameters
*/
public static function adminDashboardFavoritesActive($request, $params)
{
return $request == 'plugin.php'
&& isset($params['p'])
&& $params['p'] == 'postWidgetText';
}
public static function adminPostHeaders()
{
$editor = dcCore::app()->auth->getOption('editor');