From 1eadab6b7515a49b96cc69afabe69c4b40ffd347 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Tue, 7 Feb 2023 16:53:49 +0100 Subject: [PATCH] styles en url relatives --- core/core.php | 28 ++++++++++++++++------------ core/layout/blank.php | 12 +++++++----- core/layout/light.php | 12 +++++++----- core/layout/main.php | 10 ++++++---- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/core/core.php b/core/core.php index b8cb0a9..aa11819 100644 --- a/core/core.php +++ b/core/core.php @@ -2128,7 +2128,6 @@ class common { */ public function showStyle() { if($this->output['style']) { - echo ''; if (strpos($this->output['style'], 'admin.css') >= 1 ) { echo ''.PHP_EOL; } @@ -2136,7 +2135,22 @@ class common { } } /** - * Tri le tableau output['vendor'] et affiche les variables partagées + * Affiche les variables partagées + */ + public function showSharedVariables() { + // Variables partagées + $vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';'; + $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; + if( + $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD') + AND $this->getUser('group') >= self::GROUP_EDITOR + ) { + $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';'; + } + echo ''; + } + /* + * Tri le tableau output['vendor'] */ public function sortVendor() { $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); @@ -2152,16 +2166,6 @@ class common { if( file_exists('module/' . $moduleId . '/vendor/' . $vendorName . '/jsbody.inc.json') ) self::$jsBodyVendorPath[] = 'module/' . $moduleId . '/vendor/' . $vendorName . '/'; } } - // Variables partagées - $vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';'; - $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; - if( - $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD') - AND $this->getUser('group') >= self::GROUP_EDITOR - ) { - $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';'; - } - echo ''; } /** * Affiche les scripts et les styles dans le head ou le body diff --git a/core/layout/blank.php b/core/layout/blank.php index ea28a45..d50a6b1 100644 --- a/core/layout/blank.php +++ b/core/layout/blank.php @@ -6,14 +6,16 @@ showMetaTitle(); ?> - - - - + + + + + showStyle(); + $this->showSharedVariables(); $this->sortVendor(); $this->showVendor('css');?> - + showFavicon(); $this->showVendor('jshead'); diff --git a/core/layout/light.php b/core/layout/light.php index fccda80..eaff2f9 100644 --- a/core/layout/light.php +++ b/core/layout/light.php @@ -6,14 +6,16 @@ showMetaTitle(); ?> - - - - + + + + + showStyle(); + $this->showSharedVariables(); $this->sortVendor(); $this->showVendor('css'); ?> - + showFavicon(); $this->showVendor('jshead'); diff --git a/core/layout/main.php b/core/layout/main.php index c3e5e65..55880f0 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -12,13 +12,15 @@ else { echo ''; } $this->showMetaTitle(); if( $this->getData(['config', 'social', 'headFacebook' ]) === true) $this->showMetaPropertyFacebook(); ?> - - - + + + + showStyle(); + $this->showSharedVariables(); $this->sortVendor(); $this->showVendor('css'); echo PHP_EOL;?> - + showFavicon(); $this->showVendor('jshead');