auth->check(dcCore::app()->auth->makePermissions([ dcCore::app()->auth::PERMISSION_CONTENT_ADMIN, ]), dcCore::app()->blog->id); return static::$init; } public static function process(): bool { if (!static::$init) { return false; } # Admin menu dcCore::app()->menu[dcAdmin::MENU_PLUGINS]->addItem( My::name(), dcCore::app()->adminurl->get('admin.plugin.' . My::id()), dcPage::getPF(My::id() . '/icon.svg'), preg_match('/' . preg_quote(dcCore::app()->adminurl->get('admin.plugin.' . My::id())) . '(&.*)?$/', $_SERVER['REQUEST_URI']), dcCore::app()->auth->check(dcCore::app()->auth->makePermissions([dcCore::app()->auth::PERMISSION_CONTENT_ADMIN]), dcCore::app()->blog->id) ); dcCore::app()->addBehaviors([ # Dashboard favorites 'adminDashboardFavoritesV2' => function (dcFavorites $favs): void { $favs->register(My::id(), [ 'title' => My::name(), 'url' => dcCore::app()->adminurl->get('admin.plugin.' . My::id()), 'small-icon' => dcPage::getPF(My::id() . '/icon.svg'), 'large-icon' => dcPage::getPF(My::id() . '/icon.svg'), 'permissions' => dcCore::app()->auth->makePermissions([dcCore::app()->auth::PERMISSION_CONTENT_ADMIN]), ]); }, # Preference form 'adminBlogPreferencesFormV2' => function (dcSettings $blog_settings):void { $active = (bool) $blog_settings->get(My::id())->get('active'); $allowedtplvalues = Epc::blogAllowedTplValues(); $allowedpubpages = Epc::blogAllowedPubPages(); echo '
' . __('This enable public widgets and contents filter.') . '
' . '' . '' . __('This is a special feature to edit list of allowed template values and public pages where this plugin works.') . '
' . // allowedtplvalues (new Para())->items([ (new Label(__('Allowed DC template values:'), Label::OUTSIDE_LABEL_BEFORE))->for('epc_allowedtplvalues'), (new Input('epc_allowedtplvalues'))->size(100)->maxlenght(0)->value(Epc::implode($allowedtplvalues)), ])->render() . '' . __('Use "readable_name1:template_value1;readable_name2:template_value2;" like "entry content:EntryContent;entry excerpt:EntryExcerpt;".') . '
' . // allowedpubpages (new Para())->items([ (new Label(__('Allowed public pages:'), Label::OUTSIDE_LABEL_BEFORE))->for('epc_allowedpubpages'), (new Input('epc_allowedpubpages'))->size(100)->maxlenght(0)->value(Epc::implode($allowedpubpages)), ])->render() . '' . __('Use "readable_name1:template_page1;readable_name2:template_page2;" like "post page:post.html;home page:home.html;".') . '
' . '