From 2a9d8a1bc251b80b042624a4b477e7b730ae7564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Thu, 17 Feb 2022 16:58:52 +0100 Subject: [PATCH 1/9] double descripteur --- core/core.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/core.php b/core/core.php index e1e9a755..d24376ec 100644 --- a/core/core.php +++ b/core/core.php @@ -170,17 +170,17 @@ class common { // Descripteur de données Entrées / Sorties // Liste ici tous les fichiers de données private $dataFiles = [ - 'config' => '', - 'page' => '', - 'module' => '', - 'core' => '', - 'page' => '', - 'user' => '', - 'theme' => '', 'admin' => '', 'blacklist' => '', + 'config' => '', + 'core' => '', + 'fonts' => '', + 'module' => '', 'locale' => '', - 'fonts' => '' + 'page' => '', + 'theme' => '', + 'user' => '' + ]; // Fontes From 4b555ae12a0b0310ea3591dcde28b15e88debd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 18 Feb 2022 18:49:18 +0100 Subject: [PATCH 2/9] minify lity --- core/vendor/lity/lity.min.css | 223 +--------------------------------- 1 file changed, 1 insertion(+), 222 deletions(-) diff --git a/core/vendor/lity/lity.min.css b/core/vendor/lity/lity.min.css index d97cc2e6..3ff4fa55 100755 --- a/core/vendor/lity/lity.min.css +++ b/core/vendor/lity/lity.min.css @@ -1,222 +1 @@ -/*! Lity - v2.4.1 - 2020-04-26 -* http://sorgalla.com/lity/ -* Copyright (c) 2015-2020 Jan Sorgalla; Licensed MIT */ -.lity { - z-index: 9990; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - white-space: nowrap; - background: #0b0b0b; - background: rgba(0, 0, 0, 0.9); - outline: none !important; - opacity: 0; - -webkit-transition: opacity .3s ease; - -o-transition: opacity .3s ease; - transition: opacity .3s ease -} - -.lity.lity-opened { - opacity: 1 -} - -.lity.lity-closed { - opacity: 0 -} - -.lity * { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box -} - -.lity-wrap { - z-index: 9990; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - text-align: center; - outline: none !important -} - -.lity-wrap:before { - content: ''; - display: inline-block; - height: 100%; - vertical-align: middle; - margin-right: -0.25em -} - -.lity-loader { - z-index: 9991; - color: #fff; - position: absolute; - top: 50%; - margin-top: -0.8em; - width: 100%; - text-align: center; - font-size: 14px; - font-family: Arial, Helvetica, sans-serif; - opacity: 0; - -webkit-transition: opacity .3s ease; - -o-transition: opacity .3s ease; - transition: opacity .3s ease -} - -.lity-loading .lity-loader { - opacity: 1 -} - -.lity-container { - z-index: 9992; - position: relative; - text-align: left; - vertical-align: middle; - display: inline-block; - white-space: normal; - max-width: 100%; - max-height: 100%; - outline: none !important -} - -.lity-content { - z-index: 9993; - width: 100%; - -webkit-transform: scale(1); - -ms-transform: scale(1); - -o-transform: scale(1); - transform: scale(1); - -webkit-transition: -webkit-transform .3s ease; - transition: -webkit-transform .3s ease; - -o-transition: -o-transform .3s ease; - transition: transform .3s ease; - transition: transform .3s ease, -webkit-transform .3s ease, -o-transform .3s ease -} - -.lity-loading .lity-content, -.lity-closed .lity-content { - -webkit-transform: scale(.8); - -ms-transform: scale(.8); - -o-transform: scale(.8); - transform: scale(.8) -} - -.lity-content:after { - content: ''; - position: absolute; - left: 0; - top: 0; - bottom: 0; - display: block; - right: 0; - width: auto; - height: auto; - z-index: -1; - -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: 0 0 8px rgba(0, 0, 0, 0.6) -} - -.lity-close { - z-index: 9994; - width: 35px; - height: 35px; - position: fixed; - right: 0; - top: 0; - -webkit-appearance: none; - cursor: pointer; - text-decoration: none; - text-align: center; - padding: 0; - color: #fff; - font-style: normal; - font-size: 35px; - font-family: Arial, Baskerville, monospace; - line-height: 35px; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); - border: 0; - background: none; - outline: none; - -webkit-box-shadow: none; - box-shadow: none -} - -.lity-close::-moz-focus-inner { - border: 0; - padding: 0 -} - -.lity-close:hover, -.lity-close:focus, -.lity-close:active, -.lity-close:visited { - text-decoration: none; - text-align: center; - padding: 0; - color: #fff; - font-style: normal; - font-size: 35px; - font-family: Arial, Baskerville, monospace; - line-height: 35px; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); - border: 0; - background: none; - outline: none; - -webkit-box-shadow: none; - box-shadow: none -} - -.lity-close:active { - top: 1px -} - -.lity-image img { - max-width: 100%; - display: block; - line-height: 0; - border: 0 -} - -.lity-iframe .lity-container, -.lity-youtube .lity-container, -.lity-vimeo .lity-container, -.lity-facebookvideo .lity-container, -.lity-googlemaps .lity-container { - width: 100%; - /*max-width: 964px*/ - max-width: 1064px - -} - - - -.lity-iframe-container { - width: 100%; - height: 0; - padding-top: 56.25%; - overflow: auto; - pointer-events: auto; - -webkit-transform: translateZ(0); - transform: translateZ(0); - -webkit-overflow-scrolling: touch -} - -.lity-iframe-container iframe { - position: absolute; - display: block; - top: 0; - left: 0; - width: 100%; - height: 100%; - -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); - box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); - background: #000 -} - -.lity-hide { - display: none -} \ No newline at end of file +.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,.9);outline:none!important;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none!important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none!important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:-o-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease,-o-transform .3s ease}.lity-loading .lity-content,.lity-closed .lity-content{-webkit-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:hover,.lity-close:focus,.lity-close:active,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container,.lity-youtube .lity-container,.lity-vimeo .lity-container,.lity-facebookvideo .lity-container,.lity-googlemaps .lity-container{width:100%;max-width:1064px}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}.lity-hide{display:none} \ No newline at end of file From 550c23465626fdaf334d8c6eba32c637e04d6151 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 21 Feb 2022 14:11:43 +0100 Subject: [PATCH 3/9] =?UTF-8?q?Pb=20d'URL=20avec=20le=20th=C3=A8me=20moder?= =?UTF-8?q?ne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ressource/themes/theme_moderne.zip | Bin 105869 -> 105894 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/core/module/install/ressource/themes/theme_moderne.zip b/core/module/install/ressource/themes/theme_moderne.zip index 1307c56e6178ee1811ee13de9f48945337cbe57f..fdbc14d943f38169028de0814843040e6d79ec92 100644 GIT binary patch delta 1351 zcmV-N1-SZ+y9TDa1{+XI0|XQR000O8B5_qziAfijZUg`TbP)gm6qi1n0T+L*S8Z?8 zFcALEuQ2@rh_-9eF$OD@UYI?HNMLhY#9X z<#(msnn;N&IwBW-vUAKuFO-Q?s)c6x)V}5{_hIv2+psCPQ73+;?zVr0T;@z%F>&MM z(YAC(HHuMWbpcy4buV4`2HUz5b_W>>CzP9QT_aP5!)w38skU(E-5#jnX9gL`fGC>d z1GJGsP|nP_==I_=plM;@VlX~Y!_XvaI~*o91lSBa2K%g!0q>tSM*V)hx`EKlC8)9< zj>HPKCm7e73Nw*<=3sw9ih9iDvdcax5Kl)44gt!(=$^wYB>%Rq7lEc|tywc>6sL=? zm<8u?RUCE92EdeW(nvwRF|+?DrN|? zK8XErr%!=qM|XPMJ8zTceOGil6Km#_XH8j+|1PN&NyNQgohE?_r19Vv?WtpMdfd5P^(3uQ&wCe<8T4=OU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FtH)PChbV}1(rbMYM_So^?D5w?|NPbg+^a6u@2i$ z#)GE9Or$Oxe@sZR%ekyp*&hnTrxAiffaSVq_n`>c|6bLLz@g~QV$GOQoX-EkEL0H( zierHpVO`u&Rg1Y<^0}v0RxtUtN@MFRR4s`tPw6bQ4P#9nx% zPl0A9uk^UvZ<5cwP|>XtYi5*ZbyxE%=eyRSCol8vg{BE6@r0= zFBjeRzbZed^i{PVC-y?N!g{~bsZhEO3Dt%|>|cC`6hGkdwPGz?Lq{xUj=KC+7I0s2 z8(2f0pqo`ve1@I^@iQ^UU^3XVTqnpW?&Z#Z`5H#Jp%y#&AY)G?<_P1=J*lW}MGyD*k=UU_S(f3P;1M7gsQ!MF=dAQno>aBk>~PsM@x zVUUK@Ik^qbZj5Be4{lO%HK}n2sSoBLUZy||2dv16(J30n9ml34vg2kl?o4oSd`B)* z{QZW;7Gu>0)xsb$0j1T@io0>_PJ819q1?KT8gD7%lG;n+^&Im>P&e!p+oL{~0jWf0 zfAxu^_$_-o`sy_-tay$rkC)Z@oqWq{R3=9{F4g!qrs=_LHfl%zSCS(XanJ4h0Uc2*uQ1;e9$A?xqJ)Ax#O*2*+hYw^j zDK+ZG1G9YJj!~?gN&<7KI=Gd&n`zwwucih z9=`sg&jIsh?FOfkaG5@S$GdMLb>?WScM68GxXiqSmE>0~S@vlJnoVl8?^T zWMOn+FLY>SZDlTMb8l{!Zkz!s0jrmpoB==q<(Jx=0YL%RmmHk|Pyy_hZJhxx3S Date: Mon, 21 Feb 2022 16:17:16 +0100 Subject: [PATCH 4/9] =?UTF-8?q?Theme=20moderne=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ressource/themes/theme_moderne.zip | Bin 105894 -> 105893 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/core/module/install/ressource/themes/theme_moderne.zip b/core/module/install/ressource/themes/theme_moderne.zip index fdbc14d943f38169028de0814843040e6d79ec92..53a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aI~*o91lSBa2K%g!0q>tSM*V)hx`EKlC8)9HPKCm7e7 z3Nw*<=3qjKe|pU2vdcax5Kl)44gt!(=$^wYB>%Rq7lEc|tywc>6sL=?m<8u?RUCE9 z2EdeW(nvwRF|+?DrN|?K8XErr%!=q zM|XPMJ8zTceOGil6Km#_XH8j+|1PN&NyNQgohIfifAh1aI2C0gOv{LHD-?o(h8JhO z?hlpkW%^~cA4c{?_r z19Vv?WtpMdfd5P^(3uQ&wCe<8T4=OUy#^89)M_UmWbBrtoEr0L+|qJBZVktJEbb4Z zGd${*e}ZYWIZoDrzw|*z+`uR*h_MR}h;nt?F<93x@hqb31p>a$8EX>`O#pvlZ1gF*~X5L;6vlK;HDko?=)Ju67O~8>X9rg<8ISQ^~R*s6_Xox#YELz41Y)72jDu6gr{ci884N>; zN`Aw$8*eoYTrzjYoxCM+)CTJ7iF@!1p{=^7(7+da3 z9kiVZD6ED~+>2v($Q!o^<<{x9s!VZ7?Mvcm`~t_3F6;N^ zf7dXd;_E7Kn>PG*{#1Wp?Nc1;sygt>H?DH>t*)f2I zvj1?fI*2s)vSQQ0l47Uag17n_kNp+f)j>zPwp6-4eodNYtS}BA$YfGzq>F22IqXVR zc^IkIQlH>T=F(XRPk)cJt+Nzrv1O_ce{ZoPmL0ftm?_QVd`CZ=1QY-Q00;ougQ^6# zsssUPmklCuRaA*d7np7Y004BCAe;d;4IgmkG9)M10UvPYG9;H`oB=ffpqH4O0YCxT dm)V>FK>^H{8=V1A0pXWyodGij2%G@`005!xU9bQE From b0308ad941bf3279a4b85240dee7846c6447c2bc Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 21 Feb 2022 16:17:46 +0100 Subject: [PATCH 5/9] =?UTF-8?q?Bug=20import=20de=20fonte=20+=20d=C3=A9fini?= =?UTF-8?q?tion=20d'une=20fonte=20en=20ligne?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 4 +- core/module/theme/theme.php | 82 +++++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 5 deletions(-) diff --git a/core/core.php b/core/core.php index d24376ec..060c7337 100644 --- a/core/core.php +++ b/core/core.php @@ -1172,10 +1172,10 @@ class common { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ){ // Appel récursif des sous-dossiers - $success = $this->copyDir($src . '/' . $file, $dst . '/' . $file); + $success = $success OR $this->copyDir($src . '/' . $file, $dst . '/' . $file); } else { - $success = copy($src . '/' . $file, $dst . '/' . $file); + $success = $success OR copy($src . '/' . $file, $dst . '/' . $file); } } } diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index e4e02ad7..5f988d5d 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -227,6 +227,7 @@ class theme extends common { 'logo' => 'Logo du site' ]; + // Variable pour construire la liste des pages du site public static $pagesList = []; // Variable pour construire la liste des fontes installées @@ -609,7 +610,7 @@ class theme extends common { $file = $e[count($e) - 1 ]; // Vérifier l'existence de fontId et validité de family namesi usage en ligne de cdnFonts - $data = helper::urlGetContents('https://www.cdnfonts.com/' . $fontId . '.font'); + $data = helper::getUrlContents('https://www.cdnfonts.com/' . $fontId . '.font'); if ( $filePath === '' && $fontName !== '' @@ -849,18 +850,40 @@ class theme extends common { AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json') ) { $modele = 'theme'; - } + } if( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.json') AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.css') ) { $modele = 'admin'; + } if (!empty($modele) ) { // traiter l'archive $success = $zip->extractTo('.'); - // traitement de l'erreur + + // Substitution des fontes Google + if ($modele = 'theme') { + $c = $this->subFonts(self::DATA_DIR . 'theme.json'); + // Un remplacement nécessite la régénération de la feuille de style + if ($c > 0 + AND file_exists(self::DATA_DIR . 'theme.css') + ) { + unlink(self::DATA_DIR . 'theme.css'); + } + } + if ($modele = 'admin') { + $c = $this->subFonts(self::DATA_DIR . 'admin.json'); + // Un remplacement nécessite la régénération de la feuille de style + if ($c > 0 + AND file_exists(self::DATA_DIR . 'admin.css') + ) { + unlink(self::DATA_DIR . 'admin.css'); + } + } + + // traitement d'erreur $notification = $success ? 'Le thème a été importé' : 'Erreur lors de l\'extraction, vérifiez les permissions.'; @@ -968,4 +991,57 @@ class theme extends common { return ($zipFilename); } + /** + * Subsitution des fontes de Google Fonts vers CdnFont grâce à un tableau de conversion + * @param string $file, nom du fichier json à convertir + * @return int nombre de substitution effectuées + */ + private function subFonts($file) { + // Tableau de substitution des fontes + $fonts = [ + 'Abril+Fatface' => 'abril-fatface', + 'Arimo' => 'arimo', + 'Arvo' => 'arvo', + 'Berkshire+Swash' => 'berkshire-swash', + 'Cabin' => 'genera', + 'Dancing+Script' => 'dancing-script', + 'Droid+Sans' => 'droid-sans-2', + 'Droid+Serif' => 'droid-serif-2', + 'Fira+Sans' => 'fira-sans', + 'Inconsolata' => 'inconsolata-2', + 'Indie+Flower' =>'indie-flower', + 'Josefin+Slab' => 'josefin-sans-std', + 'Lobster' => 'lobster-2', + 'Lora' => 'lora', + 'Lato' =>'lato', + 'Marvel' => 'montserrat-ace', + 'Old+Standard+TT' => 'old-standard-tt-3', + 'Open+Sans' =>'open-sans', + // Corriger l'erreur de nom de police installée par défaut, il manquait un O en majuscule + 'open+Sans' =>'open-sans', + 'Oswald' =>'oswald-4', + 'PT+Mono' => 'pt-mono', + 'PT+Serif' =>'pt-serif', + 'Raleway' => 'raleway-5', + 'Rancho' => 'rancho', + 'Roboto' => 'Roboto', + 'Signika' => 'signika', + 'Ubuntu' => 'ubuntu', + 'Vollkorn' => 'vollkorn' + ]; + + $data = file_get_contents($file); + $count = 0; + foreach ($fonts as $oldId => $newId){ + $data = str_replace($oldId, $newId, $data, $c); + $count = $count + (int) $c; + } + // Sauvegarder la chaîne modifiée + if ($count > 0) { + file_put_contents($file, $data); + } + // Retourner le nombre d'occurrences + return ($count); + } + } From e022892e7d04a89dc0f165643c952922fc428f68 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 21 Feb 2022 16:38:02 +0100 Subject: [PATCH 6/9] changes --- CHANGES.md | 11 +++++++---- README.md | 4 +--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c15a9a6d..6f886b41 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,25 +1,28 @@ # Changelog -## Version 11.3.01 +## Version 11.3.02 +### Corrections : + - Importation d'une police sur cdnFonts impossible, non de fonction incorrect. + - Thème moderne, url de l'image corrigée + - Thème, import d'un thème sauvegardé, conversion des fontes Google. + +## Version 11.3.01 ### Corrections : - Gestionnaire de fichier, chevauchement d'icônes en multi sélection et aides non traduites. - Fontes : utilisation d'une adresse d'import de fonte HTTPS ## Version 11.3.00 - ### Nouveautés : - Police de caractères : - Changement de fournisseur, CdnFonts remplace Google Font. - Les polices pourront désormais être téléchargées à partir du site et non du CD grâce à une nouvelle fonctionnalité du thème permet de gérer l'installation des fontes, soit à partir du CDN, soit à partir d'un fichier téléchargé. - Pages dans le menu accessoire. Ce menu à affiché à droite de la barre de menu, il est traditionnellement utilisé pour y placer les drapeaux de traduction, le bouton de connexion et de gestion du compte des membres. Il sera désormais possible d'y placer des pages sous la forme d'icônes de préférence. - Prise en charge du format webp pour les modules nécessitant des miniatures. - ### Améliorations : - Thème / Bannière : ergonomie de l'information sur l'image sélectionnée. - Identifications des éléments du menu, les pages parents prennent comme id CSS leur id, les pages enfants également et pour classe Id de la page parente. - ### Corrections : - Thème / site : problème d'aperçu du body ; police du thème admin non chargée. - Bugs avec les aperçus des sélecteurs de fontes. diff --git a/README.md b/README.md index d22c470d..e0b99379 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ - - -# ZwiiCMS 11.3.01 +# ZwiiCMS 11.3.02 Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. From e2a9cfe2525f922332f4242b2e9ea2624ffbaccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 21 Feb 2022 17:56:16 +0100 Subject: [PATCH 7/9] core version --- core/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index 060c7337..816184b3 100644 --- a/core/core.php +++ b/core/core.php @@ -45,7 +45,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; - const ZWII_VERSION = '11.3.01'; + const ZWII_VERSION = '11.3.02'; const ZWII_UPDATE_CHANNEL = "v11"; public static $actions = []; From 43196b56806064a8cb31709cacead73764dbfb75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 21 Feb 2022 17:57:31 +0100 Subject: [PATCH 8/9] typo --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 6f886b41..a71ed59c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## Version 11.3.02 ### Corrections : - - Importation d'une police sur cdnFonts impossible, non de fonction incorrect. + - Importation d'une police sur cdnFonts impossible, nom de fonction incorrect. - Thème moderne, url de l'image corrigée - Thème, import d'un thème sauvegardé, conversion des fontes Google. From 0ac47e16af63085cb675b3c7cdb91c7c5bb9ff7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 21 Feb 2022 18:04:21 +0100 Subject: [PATCH 9/9] typo --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index a71ed59c..24071d45 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ ## Version 11.3.02 ### Corrections : - Importation d'une police sur cdnFonts impossible, nom de fonction incorrect. - - Thème moderne, url de l'image corrigée + - Thème moderne, url de l'image corrigé - Thème, import d'un thème sauvegardé, conversion des fontes Google.