forked from ZwiiCMS-Team/ZwiiCMS
showInLine style Function
This commit is contained in:
parent
c58a222887
commit
ab186d190e
@ -1,8 +0,0 @@
|
|||||||
// Créer les styles externes
|
|
||||||
if ($this->getData(['page', $this->getUrl(0), 'css' ])) {
|
|
||||||
$stylePath = self::TEMP_DIR . uniqid() . '.css';
|
|
||||||
file_put_contents($stylePath, html_entity_decode($this->getData(['page', $this->getUrl(0), 'css'])));
|
|
||||||
$this->addOutput([
|
|
||||||
'style' => $stylePath
|
|
||||||
]);
|
|
||||||
}
|
|
@ -117,6 +117,7 @@ class common
|
|||||||
'showPageContent' => false,
|
'showPageContent' => false,
|
||||||
'state' => false,
|
'state' => false,
|
||||||
'style' => '',
|
'style' => '',
|
||||||
|
'inlineStyle' => '',
|
||||||
'title' => null,
|
'title' => null,
|
||||||
// Null car un titre peut être vide
|
// Null car un titre peut être vide
|
||||||
// Trié par ordre d'exécution
|
// Trié par ordre d'exécution
|
||||||
@ -1269,34 +1270,6 @@ class common
|
|||||||
$zip->close();
|
$zip->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Summary of dateUTF8
|
|
||||||
* @param mixed $format
|
|
||||||
* @param mixed $date time()
|
|
||||||
* @param mixed $scope UI ou Content
|
|
||||||
* @return string Date formatée
|
|
||||||
*/
|
|
||||||
public static function showDate($format, $date, $scope = "UI")
|
|
||||||
{
|
|
||||||
$d = new DateTime(time());
|
|
||||||
$d->format($format);
|
|
||||||
|
|
||||||
/*
|
|
||||||
$d = datefmt_create(
|
|
||||||
self::$i18nUI,
|
|
||||||
IntlDateFormatter::FULL,
|
|
||||||
IntlDateFormatter::FULL,
|
|
||||||
self::$timezone,
|
|
||||||
IntlDateFormatter::GREGORIAN,
|
|
||||||
$format
|
|
||||||
);
|
|
||||||
exit (datefmt_format($d, $date));
|
|
||||||
//return datefmt_format($d, $date);
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Layout remplace la classe précédente
|
// Layout remplace la classe précédente
|
||||||
|
|
||||||
@ -2339,6 +2312,19 @@ class common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche le style interne des pages
|
||||||
|
*/
|
||||||
|
public function showInlineStyle()
|
||||||
|
{
|
||||||
|
// Import des styles liés à la page
|
||||||
|
if ($this->output['inlineStyle']) {
|
||||||
|
foreach($this->output['inlineStyle'] as $style) {
|
||||||
|
echo '<style type="text/css">' . helper::minifyCss($style) . '</style>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Importe les polices de carcatères
|
* Importe les polices de carcatères
|
||||||
*/
|
*/
|
||||||
@ -3005,18 +2991,18 @@ class core extends common
|
|||||||
// Importe la page simple sans module ou avec un module inexistant
|
// Importe la page simple sans module ou avec un module inexistant
|
||||||
|
|
||||||
// Importe le CSS de la page principale
|
// Importe le CSS de la page principale
|
||||||
$css = $this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']);
|
$pageContent = $this->getPage($this->getUrl(0), self::$i18nContent);
|
||||||
$css = strpos($css, '<style>') == null ? '<style>' . $css . '</style>' : $css;
|
$inlineStyle[] = $this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']);
|
||||||
$pageContent = $this->getPage($this->getUrl(0), self::$i18nContent) . $css;
|
// $css = strpos($css, '<style>') == null ? '<style>' . $css . '</style>' : $css;
|
||||||
|
|
||||||
// Importe le CSS des barres
|
// Importe le CSS des barres
|
||||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) : '';
|
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$i18nContent) : '';
|
||||||
$cssRight = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
||||||
$cssRight = strpos($cssRight, '<style>') == null ? '<style>' . $cssRight . '</style>' : $cssRight;
|
//$cssRight = strpos($cssRight, '<style>') == null ? '<style>' . $cssRight . '</style>' : $cssRight;
|
||||||
|
|
||||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) : '';
|
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$i18nContent) : '';
|
||||||
$cssLeft = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
||||||
$cssLeft = strpos($cssRight, '<style>') == null ? '<style>' . $cssLeft . '</style>' : $cssLeft;
|
//$cssLeft = strpos($cssRight, '<style>') == null ? '<style>' . $cssLeft . '</style>' : $cssLeft;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $this->getUrl(0)]) !== null
|
$this->getData(['page', $this->getUrl(0)]) !== null
|
||||||
@ -3034,8 +3020,9 @@ class core extends common
|
|||||||
'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' => $contentRight . $cssRight,
|
'contentRight' => $contentRight,
|
||||||
'contentLeft' => $contentLeft . $cssLeft,
|
'contentLeft' => $contentLeft,
|
||||||
|
'inlineStyle' => $inlineStyle,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3056,13 +3043,13 @@ class core extends common
|
|||||||
// Meta description = 160 premiers caractères de l'article
|
// Meta description = 160 premiers caractères de l'article
|
||||||
'content' => $pageContent,
|
'content' => $pageContent,
|
||||||
'metaDescription' => $metaDescription,
|
'metaDescription' => $metaDescription,
|
||||||
'content' => $this->getPage($this->getUrl(0), self::$i18nContent) . $css,
|
|
||||||
'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' => $contentRight . $cssRight,
|
'contentRight' => $contentRight,
|
||||||
'contentLeft' => $contentLeft . $cssLeft,
|
'contentLeft' => $contentLeft,
|
||||||
|
'inlineStyle' => $inlineStyle,
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
$moduleId = $this->getUrl(0);
|
$moduleId = $this->getUrl(0);
|
||||||
@ -3231,7 +3218,6 @@ class core extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Erreurs
|
// Erreurs
|
||||||
if ($access === 'login') {
|
if ($access === 'login') {
|
||||||
http_response_code(302);
|
http_response_code(302);
|
||||||
@ -3290,7 +3276,6 @@ class core extends common
|
|||||||
'metaDescription' => $this->getData(['locale', 'metaDescription'])
|
'metaDescription' => $this->getData(['locale', 'metaDescription'])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
;
|
|
||||||
switch ($this->output['display']) {
|
switch ($this->output['display']) {
|
||||||
// Layout brut
|
// Layout brut
|
||||||
case self::DISPLAY_RAW:
|
case self::DISPLAY_RAW:
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" title="fLUX rss">
|
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" title="fLUX rss">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $this->showStyle(); ?>
|
<?php $this->showStyle(); ?>
|
||||||
|
<?php $this->showInlineStyle(); ?>
|
||||||
<!-- Script perso dans le header -->
|
<!-- Script perso dans le header -->
|
||||||
<?php if (file_exists(self::DATA_DIR . 'head.inc.html')) {
|
<?php if (file_exists(self::DATA_DIR . 'head.inc.html')) {
|
||||||
include(self::DATA_DIR . 'head.inc.html');
|
include(self::DATA_DIR . 'head.inc.html');
|
||||||
|
Loading…
Reference in New Issue
Block a user