simplyFavicon/_admin.php

40 lines
1.3 KiB
PHP
Raw Normal View History

2021-08-16 20:36:26 +00:00
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of simplyFavicon, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2011 JC Denis and contributors
# jcdenis@gdwd.com
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------
2021-08-16 21:44:38 +00:00
if (!defined('DC_CONTEXT_ADMIN')) {
return;
}
2021-08-16 20:36:26 +00:00
2021-08-16 21:44:38 +00:00
$core->addBehavior('adminBlogPreferencesForm', ['adminSimplyFavicon', 'adminBlogPreferencesForm']);
$core->addBehavior('adminBeforeBlogSettingsUpdate', ['adminSimplyFavicon', 'adminBeforeBlogSettingsUpdate']);
2021-08-16 20:36:26 +00:00
class adminSimplyFavicon
{
2021-08-16 21:44:38 +00:00
public static function adminBlogPreferencesForm($core, $blog_settings)
2021-08-16 20:36:26 +00:00
{
echo
2021-08-16 21:44:38 +00:00
'<div class="fieldset"><h4 id="simply_favicon_params">Favicon</h4>' .
'<p><label class="classic">' .
form::checkbox('simply_favicon', '1', (boolean) $blog_settings->system->simply_favicon) .
__('Enable "Simply favicon" extension') . '</label></p>' .
'<p class="form-note">' .
__("You must place an image called favicon.png or .jpg or .ico into your blog's public directory.") .
'</p>' .
'</div>';
2021-08-16 20:36:26 +00:00
}
public static function adminBeforeBlogSettingsUpdate($blog_settings)
{
2021-08-16 21:44:38 +00:00
$blog_settings->system->put('simply_favicon', !empty($_POST['simply_favicon']));
2021-08-16 20:36:26 +00:00
}
}