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 ddb5527..0000000 Binary files a/icon-big.png and /dev/null differ diff --git a/icon.png b/icon.png deleted file mode 100644 index e747628..0000000 Binary files a/icon.png and /dev/null differ diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..d8c86be --- /dev/null +++ b/icon.svg @@ -0,0 +1,32 @@ + + + +