diff --git a/_admin.php b/_admin.php index 57cb514..5b03eb3 100644 --- a/_admin.php +++ b/_admin.php @@ -14,33 +14,33 @@ if (!defined('DC_CONTEXT_ADMIN')) { return null; } -dcCore::app()->blog->settings->addNamespace('enhancePostContent'); +dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); require __DIR__ . '/_widgets.php'; # Admin menu dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( __('Enhance post content'), - dcCore::app()->adminurl->get('admin.plugin.enhancePostContent'), - urldecode(dcPage::getPF('enhancePostContent/icon.svg')), - preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.enhancePostContent')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), + dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), + urldecode(dcPage::getPF(basename(__DIR__) . '/icon.svg')), + preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__))) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id) ); # Dashboard favorites dcCore::app()->addBehavior('adminDashboardFavoritesV2', function (dcFavorites $favs) { - $favs->register('enhancePostContent', [ + $favs->register(basename(__DIR__), [ 'title' => __('Enhance post content'), - 'url' => dcCore::app()->adminurl->get('admin.plugin.enhancePostContent'), - 'small-icon' => urldecode(dcPage::getPF('enhancePostContent/icon.svg')), - 'large-icon' => urldecode(dcPage::getPF('enhancePostContent/icon.svg')), + 'url' => dcCore::app()->adminurl->get('admin.plugin.' . basename(__DIR__)), + 'small-icon' => urldecode(dcPage::getPF(basename(__DIR__) . '/icon.svg')), + 'large-icon' => urldecode(dcPage::getPF(basename(__DIR__) . '/icon.svg')), 'permissions' => dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]), ]); }); # Preference form dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function (dcSettings $blog_settings) { - $active = (bool) $blog_settings->enhancePostContent->enhancePostContent_active; + $active = (bool) $blog_settings->__get(basename(__DIR__))->active; $allowedtplvalues = enhancePostContent::blogAllowedTplValues(); $allowedpubpages = enhancePostContent::blogAllowedPubPages(); @@ -54,7 +54,7 @@ dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function (dcSettings $b '
' . __('This enable public widgets and contents filter.') . '
' . - '' .
+ ' ' .
__('Set content filters') . '