diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index cd1be767..7046ac92 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -29,7 +29,8 @@ class theme extends common { 'manage' => self::GROUP_ADMIN, 'export' => self::GROUP_ADMIN, 'import' => self::GROUP_ADMIN, - 'save' => self::GROUP_ADMIN + 'save' => self::GROUP_ADMIN, + 'fonts' => self::GROUP_ADMIN ]; public static $aligns = [ 'left' => 'À gauche', @@ -226,6 +227,8 @@ class theme extends common { // Variable pour construire la liste des pages du site public static $pagesList = []; + // Variable pour construire la liste des fontes installées + public static $fontsList = []; /** * Thème des écrans d'administration @@ -412,42 +415,14 @@ class theme extends common { $featureContent = $this->getInput('themeHeaderText', null); $featureContent = str_replace(helper::baseUrl(false,false), './', $featureContent); - // Encodage des images en base64 - // Identifier les images - /* - preg_match_all('/]+>/i',$featureContent, $results); - foreach($results[0] as $value) { - // Lire le contenu XML - $sx = simplexml_load_string($value); - // Elément à remplacer - $src = 'src="' . $sx[0]['src'] . '"'; - // Elément encodé en base64 - $base64 = 'src="data:image/'. pathinfo($sx[0]['src'],PATHINFO_EXTENSION) . ';base64,'. base64_encode(file_get_contents($sx[0]['src'])).'"'; - // Effectuer le remplacement dans la chaine - $featureContent = str_replace($src, $base64, $featureContent); - } - - // Encodage des videos en base64 - preg_match_all('/]+>/i',$featureContent, $results); - foreach($results[0] as $value) { - // Lire le contenu XML - $sx = simplexml_load_string($value); - // Elément à remplacer - $src = 'src="' . $sx[0]['src'] . '"'; - // Elément encodé en base64 - $base64 = 'src="data:source/'. pathinfo($sx[0]['src'],PATHINFO_EXTENSION) . ';base64,'. base64_encode(file_get_contents($sx[0]['src'])).'"'; - // Effectuer le remplacement dans la chaine - $featureContent = str_replace($src, $base64, $featureContent); - }*/ - - /** + /** * Stocker les images incluses dans la bannière perso dans un tableau */ - preg_match_all('/]+>/i',$featureContent, $results); - foreach($results[0] as $value) { + preg_match_all('/]+>/i',$featureContent, $results); + foreach($results[0] as $value) { // Lire le contenu XML $sx = simplexml_load_string($value); - // Elément à remplacer + // Élément à remplacer $files [] = str_replace('./site/file/source/','',(string) $sx[0]['src']); } @@ -566,6 +541,32 @@ class theme extends common { ]); } + /** + * Options des fontes + */ + public function fonts() { + // Soumission du formulaire + if($this->isPost()) { + } + //Polices trouvées dans la configuration + + if ( file_exists(self::DATA_DIR . 'fonts.json') ) { + $localFonts = $this->getData(['fonts', 'files']); + } + // Parcourir les fontes installées et construire le tableau pour le formulaire + foreach (self::$fonts as $fontId => $fontName) { + self::$fontsList [] = [ + $fontName, + $fontId + ]; + } + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Gestion des fontes', + 'view' => 'fonts' + ]); + } + /** * Réinitialisation de la personnalisation avancée */ @@ -823,10 +824,10 @@ class theme extends common { // Traite les images du header perso if (!empty($this->getData(['theme','header','featureFiles'])) ) { foreach($this->getData(['theme','header','featureFiles']) as $value) { - $zip->addFile(self::FILE_DIR . 'source/' . $value, + $zip->addFile(self::FILE_DIR . 'source/' . $value, self::FILE_DIR . 'source/' . $value ); } - } + } break; } $ret = $zip->close(); diff --git a/core/module/theme/view/admin/admin.php b/core/module/theme/view/admin/admin.php index 8b81ad02..ef3e4f9a 100644 --- a/core/module/theme/view/admin/admin.php +++ b/core/module/theme/view/admin/admin.php @@ -1,24 +1,25 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+ +
'buttonRed', 'href' => helper::baseUrl() . 'theme/reset/admin' . '&csrf=' . $_SESSION['csrf'], - 'value' => 'Réinitialiser', - 'ico' => 'cancel' + 'value' => template::ico('cancel'), + 'help' => 'Réinitialiser avec le thème par défaut' ]); ?>
diff --git a/core/module/theme/view/advanced/advanced.php b/core/module/theme/view/advanced/advanced.php index f1895306..598b8507 100644 --- a/core/module/theme/view/advanced/advanced.php +++ b/core/module/theme/view/advanced/advanced.php @@ -1,19 +1,19 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
helper::baseUrl() . 'theme/reset/custom' . '&csrf=' . $_SESSION['csrf'], 'class' => 'buttonRed', - 'ico' => 'cancel', - 'value' => 'Réinitialiser' + 'value' => template::ico('cancel'), + 'help' => 'Réinitialiser la feuille de style' + ]); ?>
diff --git a/core/module/theme/view/body/body.php b/core/module/theme/view/body/body.php index 6e1f536d..51243668 100644 --- a/core/module/theme/view/body/body.php +++ b/core/module/theme/view/body/body.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/arriere-plan', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
diff --git a/core/module/theme/view/fonts/fonts copy.php b/core/module/theme/view/fonts/fonts copy.php new file mode 100644 index 00000000..b7d4590b --- /dev/null +++ b/core/module/theme/view/fonts/fonts copy.php @@ -0,0 +1,11 @@ +loadHTMLFile($filefont, LIBXML_NOERROR); +$elements = $doc->getElementsByTagName('i'); +var_dump ($elements); +foreach($elements as $element) { + if ($element->$textContent === 'http://fonts.cdnfonts.com/css/sketched') { + var_dump( $element['textContent'] ); + } +} \ No newline at end of file diff --git a/core/module/theme/view/fonts/fonts.css b/core/module/theme/view/fonts/fonts.css new file mode 100644 index 00000000..52709ea6 --- /dev/null +++ b/core/module/theme/view/fonts/fonts.css @@ -0,0 +1,18 @@ +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2022, Frédéric Tempez + * @license GNU General Public License, version 3 + * @link http://zwiicms.fr/ + */ + + +/** NE PAS EFFACER +* admin.css +*/ \ No newline at end of file diff --git a/core/module/theme/view/fonts/fonts.php b/core/module/theme/view/fonts/fonts.php new file mode 100644 index 00000000..1f5efa0b --- /dev/null +++ b/core/module/theme/view/fonts/fonts.php @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 9b78b052..9c47aa82 100644 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/pied-de-page', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index e503d88d..a9956412 100644 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/banniere', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
diff --git a/core/module/theme/view/index/index.css b/core/module/theme/view/index/index.css index 0f66fdf7..9d32a5a3 100755 --- a/core/module/theme/view/index/index.css +++ b/core/module/theme/view/index/index.css @@ -40,7 +40,8 @@ nav li ul { #themeBack, #themeManage, #themeAdmin, -#themeAdvanced { +#themeAdvanced, +#themeFonts { position: relative; z-index: 11; } diff --git a/core/module/theme/view/index/index.php b/core/module/theme/view/index/index.php index 85f0a16f..5f6621be 100644 --- a/core/module/theme/view/index/index.php +++ b/core/module/theme/view/index/index.php @@ -30,9 +30,9 @@
-
+
'cogs', + 'ico' => 'sliders', 'href' => helper::baseUrl() . $this->getUrl(0) . '/manage', 'value' => 'Gestion' ]); ?> @@ -52,6 +52,13 @@ 'value' => 'Éditeur CSS' ]); ?>
+
+ 'code', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts', + 'value' => 'Fontes' + ]); ?> +
@@ -75,9 +82,9 @@
-
+
'cogs', + 'ico' => 'sliders', 'href' => helper::baseUrl() . $this->getUrl(0) . '/manage', 'value' => 'Gestion' ]); ?> @@ -97,5 +104,12 @@ 'value' => 'Éditeur CSS' ]); ?>
+
+ 'code', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/fonts', + 'value' => 'Fontes' + ]); ?> +
diff --git a/core/module/theme/view/manage/manage.php b/core/module/theme/view/manage/manage.php index 42658cd9..c6c3ac22 100644 --- a/core/module/theme/view/manage/manage.php +++ b/core/module/theme/view/manage/manage.php @@ -1,19 +1,18 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'buttonRed', 'href' => helper::baseUrl() . 'theme/reset/manage' . '&csrf=' . $_SESSION['csrf'], - 'value' => 'Réinitialiser', - 'ico' => 'cancel' + 'value' => template::ico('cancel'), + 'help' => 'Réinitialiser avec le thème par défaut' ]); ?>
diff --git a/core/module/theme/view/menu/menu.php b/core/module/theme/view/menu/menu.php index 11bde3da..9bcbb88a 100644 --- a/core/module/theme/view/menu/menu.php +++ b/core/module/theme/view/menu/menu.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/menu', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+
diff --git a/core/module/theme/view/site/site.php b/core/module/theme/view/site/site.php index 7414f397..7f4c4e67 100644 --- a/core/module/theme/view/site/site.php +++ b/core/module/theme/view/site/site.php @@ -1,23 +1,21 @@
-
+
'buttonGrey', 'href' => helper::baseUrl() . 'theme', - 'ico' => 'left', - 'value' => 'Retour' + 'value' => template::ico('left') ]); ?>
-
+
'https://doc.zwiicms.fr/site61863d315ffe0', 'target' => '_blank', - 'ico' => 'help', - 'value' => 'Aide', + 'value' => template::ico('help'), 'class' => 'buttonHelp' ]); ?>
-
+