From a734c972cde10ad3fb17c0b58b761b281b05d0d0 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 15 Feb 2023 18:36:30 +0100 Subject: [PATCH] include CSS WIP --- core/Untitled-1 | 8 ++++++++ core/core.php | 13 ++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 core/Untitled-1 diff --git a/core/Untitled-1 b/core/Untitled-1 new file mode 100644 index 00000000..09a24eb1 --- /dev/null +++ b/core/Untitled-1 @@ -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 + ]); +} \ No newline at end of file diff --git a/core/core.php b/core/core.php index 8c402422..1ee302a8 100644 --- a/core/core.php +++ b/core/core.php @@ -3010,10 +3010,9 @@ class core extends common and $access ) { - $this->addOutput([ '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']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), '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) : '', '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, ''; + //var_dump($css); + //die(); + $this->addOutput([ + 'content' => $this->getPage($this->getUrl(0), self::$i18nContent) . $css + ]); + } // Importe le module else {