styles en url relatives

This commit is contained in:
Deltacms 2023-02-07 16:53:49 +01:00
parent 527d465a4e
commit 1eadab6b75
4 changed files with 36 additions and 26 deletions

View File

@ -2128,7 +2128,6 @@ class common {
*/
public function showStyle() {
if($this->output['style']) {
echo '<base href="' . helper::baseUrl(true) .'">';
if (strpos($this->output['style'], 'admin.css') >= 1 ) {
echo '<link rel="stylesheet" href="' . self::DATA_DIR . 'admin.css' . '">'.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 '<script>' . helper::minifyJs($vars) . '</script>';
}
/*
* 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 '<script>' . helper::minifyJs($vars) . '</script>';
}
/**
* Affiche les scripts et les styles dans le head ou le body

View File

@ -6,14 +6,16 @@
<?php
$this->showMetaTitle();
?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/mediaqueries.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/blank.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css">
<base href="<?php echo helper::baseUrl(true); ?>">
<link rel="stylesheet" href="core/layout/common.css">
<link rel="stylesheet" href="core/layout/mediaqueries.css">
<link rel="stylesheet" href="core/layout/blank.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>theme.css">
<?php $this->showStyle();
$this->showSharedVariables();
$this->sortVendor();
$this->showVendor('css');?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>custom.css">
<?php
$this->showFavicon();
$this->showVendor('jshead');

View File

@ -6,14 +6,16 @@
<?php
$this->showMetaTitle();
?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/mediaqueries.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/light.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css">
<base href="<?php echo helper::baseUrl(true); ?>">
<link rel="stylesheet" href="core/layout/common.css">
<link rel="stylesheet" href="core/layout/mediaqueries.css">
<link rel="stylesheet" href="core/layout/light.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>theme.css">
<?php $this->showStyle();
$this->showSharedVariables();
$this->sortVendor();
$this->showVendor('css'); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>custom.css">
<?php
$this->showFavicon();
$this->showVendor('jshead');

View File

@ -12,13 +12,15 @@ else { echo '<html lang="'.$lang.'">'; }
$this->showMetaTitle();
if( $this->getData(['config', 'social', 'headFacebook' ]) === true) $this->showMetaPropertyFacebook();
?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/mediaqueries.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css">
<base href="<?php echo helper::baseUrl(true); ?>">
<link rel="stylesheet" href="core/layout/common.css">
<link rel="stylesheet" href="core/layout/mediaqueries.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>theme.css">
<?php $this->showStyle();
$this->showSharedVariables();
$this->sortVendor();
$this->showVendor('css'); echo PHP_EOL;?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>custom.css">
<?php
$this->showFavicon();
$this->showVendor('jshead');