showFontes

This commit is contained in:
Fred Tempez 2023-02-15 18:17:24 +01:00
parent 9544c3305d
commit c670443132
5 changed files with 26 additions and 28 deletions

View File

@ -350,9 +350,9 @@ class common
self::$i18nUI = $this->getData(['user', $this->getUser('id'), 'language']); self::$i18nUI = $this->getData(['user', $this->getUser('id'), 'language']);
// Validation de la langue // Validation de la langue
self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI)) self::$i18nUI = (empty(self::$i18nUI) || is_null(self::$i18nUI))
&& !file_exists(self::I18N_DIR . self::$i18nUI . '.json') && !file_exists(self::I18N_DIR . self::$i18nUI . '.json')
? 'fr_FR' ? 'fr_FR'
: self::$i18nUI; : self::$i18nUI;
} }
// Stocker le cookie de langue pour l'éditeur de texte // Stocker le cookie de langue pour l'éditeur de texte
@ -2337,6 +2337,12 @@ class common
} }
echo '<style type="text/css">' . helper::minifyCss($this->output['style']) . '</style>'; echo '<style type="text/css">' . helper::minifyCss($this->output['style']) . '</style>';
} }
}
/**
* Importe les polices de carcatères
*/
public function showFonts() {
// Import des fontes liées au thème // Import des fontes liées au thème
if (file_exists(self::DATA_DIR . 'fonts/fonts.html')) { if (file_exists(self::DATA_DIR . 'fonts/fonts.html')) {
include_once(self::DATA_DIR . 'fonts/fonts.html'); include_once(self::DATA_DIR . 'fonts/fonts.html');
@ -3007,26 +3013,16 @@ class core extends common
$this->addOutput([ $this->addOutput([
'title' => $title, 'title' => $title,
'content' => $this->getPage($this->getUrl(0), self::$i18nContent) . 'content' => $this->getPage($this->getUrl(0), self::$i18nContent),
($this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']) ).
($this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']) ),
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']),
'contentRight' => $this->getData(['page', $this->getUrl(0), 'barRight']) 'contentRight' => $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) : '',
? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) . 'contentLeft' => $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) : ''
($this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) == null ?'' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css'])) .
($this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']))
: '',
'contentLeft' => $this->getData(['page', $this->getUrl(0), 'barLeft'])
? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) .
($this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css'])) .
($this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']))
: ''
]); ]);
// ($this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']) );
} }
// Importe le module // Importe le module
else { else {
@ -3045,15 +3041,15 @@ class core extends common
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']),
'contentRight' => $this->getData(['page', $this->getUrl(0), 'barRight']) 'contentRight' => $this->getData(['page', $this->getUrl(0), 'barRight'])
? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent)
: '', : '',
'contentLeft' => $this->getData(['page', $this->getUrl(0), 'barLeft']) 'contentLeft' => $this->getData(['page', $this->getUrl(0), 'barLeft'])
? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent)
: '' : ''
]); ]);
$pageContent = $this->getPage($this->getUrl(0), self::$i18nContent) . //$pageContent = $this->getPage($this->getUrl(0), self::$i18nContent) .
($this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']) ). //($this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']) ).
($this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']) ); //($this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']) );
} else { } else {
$moduleId = $this->getUrl(0); $moduleId = $this->getUrl(0);
$pageContent = ''; $pageContent = '';
@ -3148,7 +3144,8 @@ class core extends common
} }
if ($output['style']) { if ($output['style']) {
$this->addOutput([ $this->addOutput([
'style' => $this->output['style'] . file_get_contents($output['style']) //'style' => $this->output['style'] . file_get_contents($output['style'])
'style' => file_get_contents($output['style'])
]); ]);
} }

View File

@ -10,6 +10,7 @@
<?php $this->showFavicon(); ?> <?php $this->showFavicon(); ?>
<?php $this->showVendor(); ?> <?php $this->showVendor(); ?>
<?php $this->showStyle(); ?> <?php $this->showStyle(); ?>
<?php $this->showFonts(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/blank.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?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">

View File

@ -10,6 +10,7 @@
<?php $this->showFavicon(); ?> <?php $this->showFavicon(); ?>
<?php $this->showVendor(); ?> <?php $this->showVendor(); ?>
<?php $this->showStyle(); ?> <?php $this->showStyle(); ?>
<?php $this->showFonts(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/light.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?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">

View File

@ -9,6 +9,7 @@
<?php $this->showMetaImage(); ?> <?php $this->showMetaImage(); ?>
<?php $this->showFavicon(); ?> <?php $this->showFavicon(); ?>
<?php $this->showVendor(); ?> <?php $this->showVendor(); ?>
<?php $this->showFonts(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css?<?php echo md5_file('core/layout/common.css'); ?>"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css?<?php echo md5_file('core/layout/common.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR . 'theme.css'); ?>"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR . 'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR . 'custom.css'); ?>"> <link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR . 'custom.css'); ?>">

View File

@ -562,8 +562,7 @@ class page extends common
{ {
// Soumission du formulaire // Soumission du formulaire
if ($this->isPost()) { if ($this->isPost()) {
// Supprime les balises styles si elles ont été saisies $css = $this->getInput('pageCssEditorContent') === null ? '': $this->getInput('pageCssEditorContent');
$css = $this->getInput('pageCssEditorContent') === null ? '': $this->getInput('pageCssEditorContent');
// Enregistre le CSS // Enregistre le CSS
$this->setData([ $this->setData([
'page', $this->getUrl(2), 'css', 'page', $this->getUrl(2), 'css',
@ -593,7 +592,6 @@ class page extends common
{ {
// Soumission du formulaire // Soumission du formulaire
if ($this->isPost()) { if ($this->isPost()) {
// Supprime les balises scripts si elles ont été saisies
$js = $this->getInput('pageJsEditorContent') === null ? '' : $this->getInput('pageJsEditorContent'); $js = $this->getInput('pageJsEditorContent') === null ? '' : $this->getInput('pageJsEditorContent');
// Enregistre le JS // Enregistre le JS
$this->setData([ $this->setData([