use new addBehaviors method
This commit is contained in:
parent
466681fca7
commit
fedd65ebc8
13
_admin.php
13
_admin.php
@ -14,7 +14,8 @@ if (!defined('DC_CONTEXT_ADMIN')) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function ($blog_settings) {
|
dcCore::app()->addBehaviors([
|
||||||
|
'adminBlogPreferencesFormV2' => function ($blog_settings) {
|
||||||
$exists = [];
|
$exists = [];
|
||||||
$path = path::fullFromRoot((string) $blog_settings->get('system')->get('public_path'), DC_ROOT);
|
$path = path::fullFromRoot((string) $blog_settings->get('system')->get('public_path'), DC_ROOT);
|
||||||
foreach (['ico', 'png', 'bmp', 'gif', 'jpg', 'mng'] as $ext) {
|
foreach (['ico', 'png', 'bmp', 'gif', 'jpg', 'mng'] as $ext) {
|
||||||
@ -28,7 +29,7 @@ dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function ($blog_setting
|
|||||||
'<div class="two-cols"><div class="col">' .
|
'<div class="two-cols"><div class="col">' .
|
||||||
'<p><label class="classic">' .
|
'<p><label class="classic">' .
|
||||||
form::checkbox('simply_favicon', '1', (bool) $blog_settings->get('system')->get('simply_favicon')) .
|
form::checkbox('simply_favicon', '1', (bool) $blog_settings->get('system')->get('simply_favicon')) .
|
||||||
__('Enable "Simply favicon" extension') . '</label></p>' .
|
sprintf(__('Enable "%s" extension'), __('Simply favicon')) . '</label></p>' .
|
||||||
'<p class="form-note">' .
|
'<p class="form-note">' .
|
||||||
__("You must place an image called favicon.png or .jpg or .ico into your blog's public directory.") .
|
__("You must place an image called favicon.png or .jpg or .ico into your blog's public directory.") .
|
||||||
'</p></div><div class="col">' .
|
'</p></div><div class="col">' .
|
||||||
@ -38,8 +39,8 @@ dcCore::app()->addBehavior('adminBlogPreferencesFormV2', function ($blog_setting
|
|||||||
'<p>' . __('Current favicons:') . '</p><ul class="nice">' . implode($exists) . '</ul>'
|
'<p>' . __('Current favicons:') . '</p><ul class="nice">' . implode($exists) . '</ul>'
|
||||||
) .
|
) .
|
||||||
'</div></div><br class="clear" /></div>';
|
'</div></div><br class="clear" /></div>';
|
||||||
});
|
},
|
||||||
|
'adminBeforeBlogSettingsUpdate' => function ($blog_settings) {
|
||||||
dcCore::app()->addBehavior('adminBeforeBlogSettingsUpdate', function ($blog_settings) {
|
|
||||||
$blog_settings->get('system')->put('simply_favicon', !empty($_POST['simply_favicon']));
|
$blog_settings->get('system')->put('simply_favicon', !empty($_POST['simply_favicon']));
|
||||||
});
|
},
|
||||||
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user