fix PSR12 CS
This commit is contained in:
parent
254562e384
commit
f26464ca9f
4 changed files with 47 additions and 52 deletions
|
@ -10,7 +10,6 @@
|
|||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
@ -25,7 +24,7 @@ class adminSimplyFavicon
|
|||
echo
|
||||
'<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) .
|
||||
form::checkbox('simply_favicon', '1', (bool) $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.") .
|
||||
|
|
|
@ -10,15 +10,14 @@
|
|||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->registerModule(
|
||||
"Simply favicon",
|
||||
"Multi-agents favicon",
|
||||
"Jean-Christian Denis",
|
||||
'Simply favicon',
|
||||
'Multi-agents favicon',
|
||||
'Jean-Christian Denis',
|
||||
'2021.09.02.1',
|
||||
[
|
||||
'requires' => [['core', '2.19']],
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return;
|
||||
}
|
||||
|
|
14
_public.php
14
_public.php
|
@ -10,7 +10,6 @@
|
|||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return;
|
||||
}
|
||||
|
@ -19,14 +18,14 @@ $core->addBehavior('publicHeadContent', ['publicSimplyFavicon', 'publicHeadConte
|
|||
|
||||
class publicSimplyFavicon extends dcUrlHandlers
|
||||
{
|
||||
public static $mimetypes = array(
|
||||
public static $mimetypes = [
|
||||
'ico' => 'image/x-icon',
|
||||
'png' => 'image/png',
|
||||
'bmp' => 'image/bmp',
|
||||
'gif' => 'image/gif',
|
||||
'jpg' => 'image/jpeg',
|
||||
'mng' => 'video/x-mng'
|
||||
);
|
||||
];
|
||||
|
||||
public static function simplyFaviconUrl($arg)
|
||||
{
|
||||
|
@ -40,14 +39,13 @@ class publicSimplyFavicon extends dcUrlHandlers
|
|||
|| !array_key_exists($arg, $mimetypes)
|
||||
|| file_exists($public_path . 'favicon' . $arg)
|
||||
) {
|
||||
throw new Exception ("Page not found", 404);
|
||||
throw new Exception('Page not found', 404);
|
||||
}
|
||||
else {
|
||||
|
||||
header('Content-Type: ' . $mimetypes[$arg] . ';');
|
||||
readfile($public_path . $arg);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public static function publicHeadContent($core)
|
||||
{
|
||||
|
@ -72,11 +70,11 @@ class publicSimplyFavicon extends dcUrlHandlers
|
|||
}
|
||||
// all others
|
||||
else {
|
||||
foreach($mimetypes as $ext => $mime)
|
||||
{
|
||||
foreach ($mimetypes as $ext => $mime) {
|
||||
if (file_exists($public_path . $ext)) {
|
||||
echo
|
||||
'<link rel="icon" type="' . $mime . '" href="' . $public_url . $ext . '" />' . "\n";
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue