diff --git a/_admin.php b/_admin.php index 04019f7..6fc3121 100644 --- a/_admin.php +++ b/_admin.php @@ -14,45 +14,30 @@ if (!defined('DC_CONTEXT_ADMIN')) { return; } -# settings namespace -dcCore::app()->blog->settings->addNamespace('saba'); - # widget require_once __DIR__ . '/_widgets.php'; +# settings namespace +dcCore::app()->blog->settings->addNamespace('saba'); + # behaviors -dcCore::app()->addBehavior( - 'adminBlogPreferencesFormV2', - ['adminSaba', 'adminBlogPreferencesForm'] -); -dcCore::app()->addBehavior( - 'adminBeforeBlogSettingsUpdate', - ['adminSaba', 'adminBeforeBlogSettingsUpdate'] -); +dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function ($blog_settings) { + echo + '
' . + '

' . __('Search Across Blog Archive') . '

' . + '

' . + '

' . + '

' . + __('This suggests visitors some posts on page 404.') . + '

' . + '
'; +}); -# add settings to admin blog pref page -class adminSaba -{ - public static function adminBlogPreferencesForm($blog_settings) - { - echo - '
' . - '

' . __('Search Across Blog Archive') . '

' . - '

' . - '

' . - '

' . - __('This suggests visitors some posts on page 404.') . - '

' . - '
'; - } - - public static function adminBeforeBlogSettingsUpdate($blog_settings) - { - $blog_settings->saba->put('active', !empty($_POST['saba_active'])); - $blog_settings->saba->put('error', !empty($_POST['saba_error'])); - } -} +dcCore::app()->addBehavior('adminBeforeBlogSettingsUpdate', function ($blog_settings) { + $blog_settings->saba->put('active', !empty($_POST['saba_active'])); + $blog_settings->saba->put('error', !empty($_POST['saba_error'])); +});