From b9420e697104be6ecab9140fce2edc7cebe2b23b Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 26 Nov 2022 14:54:16 +0100 Subject: [PATCH] use svg icon and fix admin url --- _admin.php | 31 +++++++------------------------ icon-big.png | Bin 1823 -> 0 bytes icon.png | Bin 438 -> 0 bytes icon.svg | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 24 deletions(-) delete mode 100644 icon-big.png delete mode 100644 icon.png create mode 100644 icon.svg diff --git a/_admin.php b/_admin.php index 64b4915..1b1326c 100644 --- a/_admin.php +++ b/_admin.php @@ -45,7 +45,7 @@ if (dcCore::app()->blog->settings->periodical->periodical_active) { dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( __('Periodical'), dcCore::app()->adminurl->get('admin.plugin.periodical'), - dcPage::getPF('periodical/icon.png'), + dcPage::getPF('periodical/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.periodical')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_USAGE, @@ -55,7 +55,7 @@ if (dcCore::app()->blog->settings->periodical->periodical_active) { dcCore::app()->addBehavior( 'adminDashboardFavoritesV2', - ['adminPeriodical', 'adminDashboardFavorites'] + ['adminPeriodical', 'adminDashboardFavoritesV2'] ); dcCore::app()->addBehavior( 'adminPostHeaders', @@ -233,13 +233,13 @@ class adminPeriodical * * @param dcFavorites $favs Array of favorites */ - public static function adminDashboardFavorites(dcFavorites $favs) + public static function adminDashboardFavoritesV2(dcFavorites $favs) { $favs->register('periodical', [ 'title' => __('Periodical'), - 'url' => 'plugin.php?p=periodical', - 'small-icon' => 'index.php?pf=periodical/icon.png', - 'large-icon' => 'index.php?pf=periodical/icon-big.png', + 'url' => dcCore::app()->adminurl->get('admin.plugin.periodical'), + 'small-icon' => dcPage::getPF('periodical/icon.svg'), + 'large-icon' => dcPage::getPF('periodical/icon.svg'), 'permissions' => dcCore::app()->auth->check( dcCore::app()->auth->makePermissions([ dcAuth::PERMISSION_USAGE, @@ -247,26 +247,9 @@ class adminPeriodical ]), dcCore::app()->blog->id ), - 'active_cb' => [ - 'adminPeriodical', - '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'] == 'periodical'; - } - /** * Add javascript for toggle * @@ -274,7 +257,7 @@ class adminPeriodical */ public static function adminPostHeaders() { - return dcPage::jsLoad('index.php?pf=periodical/js/toggle.js'); + return dcPage::jsLoad(dcPage::getPF('periodical/js/toggle.js')); } /** diff --git a/icon-big.png b/icon-big.png deleted file mode 100644 index ddb5527e6353e76a3f494a4431cccd8db925a37f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1823 zcmZuydpHwp8=s3DH$!up#V$Tk7;Bpx%P=ByrZ*8wY8!?rF}$tTkcwWCe3*uF4K!pEOsBKXEz{08ka| zhRi@*&3S1NdI|T-rGU5#m#z?~Q2<{8iE;_yjSGY)p%54Z66wC?d=vnX&+%}@1}2|f znLm|<4ubZ79iHi_y!sF0(C+y$mYm`CXvNF zI7ft?fyg#0$1!sSudWqs@c&1$7@`-@8Wti8^naB+Daw^GcAtH!g+H){WQAwGIhm99 z;Z)NFs}^h3(o73lj7HZ}a?vn=*)T?(NgDPXG_GDCKaT>i(Q!~u16rQoGcC5Sl`tKV zu$5}lI^ajBX4QZ)byqVv={62KMzB*#9jYqSdgOBel-HfO8Eu-r>=8$sj5Y%vI}{3| zD7G=rFcMdUgl5*Jm8`X*LdKe4M4aO}_#SQ21{DBVzXg|&rWMv79(DZGqN$;?ytuTr z>Y03K$D|C}-WsfPzGu4^@)j+$yz%ptGs5a-(54Ap*J<2Z>cdkZ) zyAxkTEtR_<>5M+WhsASr+=uXM6WRA2ZsB&tDs@;%NLHxAo}ffhIpE`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