use Dotclear Helper
This commit is contained in:
parent
00b27f226e
commit
efe8358c78
3 changed files with 6 additions and 6 deletions
|
@ -17,6 +17,7 @@ namespace Dotclear\Plugin\simplyFavicon;
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use dcNsProcess;
|
use dcNsProcess;
|
||||||
use dcSettings;
|
use dcSettings;
|
||||||
|
use Dotclear\Helper\File\Path;
|
||||||
use Dotclear\Helper\Html\Form\{
|
use Dotclear\Helper\Html\Form\{
|
||||||
Checkbox,
|
Checkbox,
|
||||||
Div,
|
Div,
|
||||||
|
@ -24,7 +25,6 @@ use Dotclear\Helper\Html\Form\{
|
||||||
Note,
|
Note,
|
||||||
Para
|
Para
|
||||||
};
|
};
|
||||||
use path;
|
|
||||||
|
|
||||||
class Backend extends dcNsProcess
|
class Backend extends dcNsProcess
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ class Backend extends dcNsProcess
|
||||||
dcCore::app()->addBehaviors([
|
dcCore::app()->addBehaviors([
|
||||||
'adminBlogPreferencesFormV2' => function (dcSettings $blog_settings): void {
|
'adminBlogPreferencesFormV2' => function (dcSettings $blog_settings): void {
|
||||||
$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) {
|
||||||
if (file_exists($path . '/favicon.' . $ext)) {
|
if (file_exists($path . '/favicon.' . $ext)) {
|
||||||
$url = dcCore::app()->blog->url . dcCore::app()->url->getURLFor('simplyFavicon', $ext);
|
$url = dcCore::app()->blog->url . dcCore::app()->url->getURLFor('simplyFavicon', $ext);
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Dotclear\Plugin\simplyFavicon;
|
||||||
|
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use dcNsProcess;
|
use dcNsProcess;
|
||||||
use path;
|
use Dotclear\Helper\File\Path;
|
||||||
|
|
||||||
class Frontend extends dcNsProcess
|
class Frontend extends dcNsProcess
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ class Frontend extends dcNsProcess
|
||||||
return;
|
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') . '.';
|
$public_url = dcCore::app()->blog->url . dcCore::app()->url->getBase('simplyFavicon') . '.';
|
||||||
|
|
||||||
// ico : IE6
|
// ico : IE6
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace Dotclear\Plugin\simplyFavicon;
|
||||||
|
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use dcUrlHandlers;
|
use dcUrlHandlers;
|
||||||
use path;
|
use Dotclear\Helper\File\Path;
|
||||||
|
|
||||||
class UrlHandler extends dcUrlHandlers
|
class UrlHandler extends dcUrlHandlers
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ class UrlHandler extends dcUrlHandlers
|
||||||
|
|
||||||
public static function simplyFaviconUrl(string $arg): void
|
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')
|
if (dcCore::app()->blog->settings->get('system')->get('simply_favicon')
|
||||||
&& !empty($arg)
|
&& !empty($arg)
|
||||||
|
|
Loading…
Reference in a new issue