include CSS WIP

This commit is contained in:
Fred Tempez 2023-02-15 18:36:30 +01:00
parent c670443132
commit a734c972cd
2 changed files with 18 additions and 3 deletions

8
core/Untitled-1 Normal file
View File

@ -0,0 +1,8 @@
// 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
]);
}

View File

@ -3010,10 +3010,9 @@ class core extends common
and $access and $access
) { ) {
$this->addOutput([ $this->addOutput([
'title' => $title, 'title' => $title,
'content' => $this->getPage($this->getUrl(0), self::$i18nContent), //'content' => $this->getPage($this->getUrl(0), self::$i18nContent),
'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']),
@ -3022,7 +3021,15 @@ class core extends common
'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) : '',
'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) : ''
]); ]);
// ($this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']) ); // Importe le CSS dans la page
$css = $this->getData(['page', $this->getUrl(0), 'css']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'css']);
$css = strpos($css, '<style>') == null ? $css : '<style>' . $css . '</style>';
//var_dump($css);
//die();
$this->addOutput([
'content' => $this->getPage($this->getUrl(0), self::$i18nContent) . $css
]);
} }
// Importe le module // Importe le module
else { else {