use Dotclear Helper

This commit is contained in:
Jean-Christian Denis 2023-04-08 00:08:06 +02:00
parent 00b27f226e
commit efe8358c78
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
3 changed files with 6 additions and 6 deletions

View file

@ -17,6 +17,7 @@ namespace Dotclear\Plugin\simplyFavicon;
use dcCore;
use dcNsProcess;
use dcSettings;
use Dotclear\Helper\File\Path;
use Dotclear\Helper\Html\Form\{
Checkbox,
Div,
@ -24,7 +25,6 @@ use Dotclear\Helper\Html\Form\{
Note,
Para
};
use path;
class Backend extends dcNsProcess
{
@ -44,7 +44,7 @@ class Backend extends dcNsProcess
dcCore::app()->addBehaviors([
'adminBlogPreferencesFormV2' => function (dcSettings $blog_settings): void {
$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) {
if (file_exists($path . '/favicon.' . $ext)) {
$url = dcCore::app()->blog->url . dcCore::app()->url->getURLFor('simplyFavicon', $ext);

View file

@ -16,7 +16,7 @@ namespace Dotclear\Plugin\simplyFavicon;
use dcCore;
use dcNsProcess;
use path;
use Dotclear\Helper\File\Path;
class Frontend extends dcNsProcess
{
@ -38,7 +38,7 @@ class Frontend extends dcNsProcess
return;
}
$public_path = path::fullFromRoot(dcCore::app()->blog->settings->get('system')->get('public_path'), DC_ROOT) . '/favicon.';
$public_path = Path::fullFromRoot(dcCore::app()->blog->settings->get('system')->get('public_path'), DC_ROOT) . '/favicon.';
$public_url = dcCore::app()->blog->url . dcCore::app()->url->getBase('simplyFavicon') . '.';
// ico : IE6

View file

@ -16,7 +16,7 @@ namespace Dotclear\Plugin\simplyFavicon;
use dcCore;
use dcUrlHandlers;
use path;
use Dotclear\Helper\File\Path;
class UrlHandler extends dcUrlHandlers
{
@ -31,7 +31,7 @@ class UrlHandler extends dcUrlHandlers
public static function simplyFaviconUrl(string $arg): void
{
$public_path = path::fullFromRoot(dcCore::app()->blog->settings->get('system')->get('public_path'), DC_ROOT);
$public_path = Path::fullFromRoot(dcCore::app()->blog->settings->get('system')->get('public_path'), DC_ROOT);
if (dcCore::app()->blog->settings->get('system')->get('simply_favicon')
&& !empty($arg)