forked from ZwiiCMS-Team/ZwiiCMS
Merge branch 'dev' into 12-dev
This commit is contained in:
commit
dfde4ee228
@ -10,6 +10,13 @@
|
||||
- Amélioration du thème admin de base, modifications du jeu d'icônes.
|
||||
- Mise à jour automatisée, affichage de l'erreur en cas d'échec.
|
||||
|
||||
## Version 11.4.00
|
||||
### Améliorations :
|
||||
- Prise en charge des fontes Web Safe. Les fontes initiales sont transférées dans les fontes optionnelles, donc effaçables.
|
||||
- Configuration de la bannière, modalité d'affichage de la taille d'image recommandée et affichage des dimensions de l'image.
|
||||
## Correction :
|
||||
- Module blog : taille recommandée de l'image erronée lorsque la largeur de l'écran est réglée sur fluide (100%).
|
||||
|
||||
## Version 11.3.04
|
||||
### Correction :
|
||||
- Duplication d'id dans le menu.
|
||||
|
@ -651,7 +651,7 @@ class template {
|
||||
'<option value="%s"%s style="font-family: %s;">%s</option>',
|
||||
$value,
|
||||
$attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string
|
||||
core::$fonts[$value],
|
||||
$text,
|
||||
$text
|
||||
) : sprintf(
|
||||
'<option value="%s"%s>%s</option>',
|
||||
|
@ -181,37 +181,25 @@ class common {
|
||||
|
||||
// Fontes
|
||||
public static $fonts = [
|
||||
'abril-fatface' => 'Abril Fatface',
|
||||
'arimo' => 'Arimo',
|
||||
'arvo' => 'Arvo',
|
||||
'berkshire-swash' => 'Berkshire Swash',
|
||||
'dancing-script' => 'Dancing Script',
|
||||
'droid-sans-2' => 'Droid Sans',
|
||||
'droid-serif-2' => 'Droid Serif',
|
||||
'fira-sans' => 'Fira Sans',
|
||||
'genera' => 'Genera',
|
||||
'inconsolata-2' => 'Inconsolata',
|
||||
'indie-flower' => 'Indie Flower',
|
||||
'josefin-sans-std' => 'Josefin Sans',
|
||||
'liberation-sans' => 'Liberation Sans',
|
||||
'liberation-serif' => 'Liberation Serif',
|
||||
'lobster-2' => 'Lobster',
|
||||
'lora' => 'Lora',
|
||||
'lato' => 'Lato',
|
||||
'montserrat-ace' => 'Montserrat Ace',
|
||||
'old-standard-tt-3' => 'Old Standard TT',
|
||||
'open-sans' => 'Open Sans',
|
||||
'oswald-4' => 'Oswald',
|
||||
'pt-mono' => 'PT Mono',
|
||||
'pt-serif' => 'PT Serif',
|
||||
'raleway-5' => 'Raleway',
|
||||
'rancho' => 'Rancho',
|
||||
'roboto' => 'Roboto',
|
||||
'signika' => 'Signika',
|
||||
'ubuntu' => 'Ubuntu',
|
||||
'vollkorn' => 'Vollkorn'
|
||||
];
|
||||
|
||||
public static $fontsWebSafe = [
|
||||
'arial' => 'Arial, Helvetica, sans-serif;',
|
||||
'arial-black' => 'Arial Black, Gadget, sans-serif;',
|
||||
'courrier' => 'Courier, Liberation Mono, monospace;',
|
||||
'courrier-new' => 'Courier New, Courier, monospace',
|
||||
'garamond' => 'Garamond, serif',
|
||||
'georgia' => 'Georgia, serif;',
|
||||
'impact' => 'Impact, Charcoal, sans-serif;',
|
||||
'lucida' => 'Lucida Sans Unicode, Lucida Grande, sans-serif',
|
||||
'tahoma' => 'Tahoma, Geneva, sans-serif;',
|
||||
'times-new-roman' => 'Times New Roman, Liberation Serif, serif;',
|
||||
'trebuchet' => 'Trebuchet MS, Arial, Helvetica, sans-serif;',
|
||||
'tahoma' => 'Tahoma, Geneva, sans-serif;',
|
||||
'verdana' => 'Verdana, Geneva, sans-serif;',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Constructeur commun
|
||||
*/
|
||||
@ -2244,16 +2232,26 @@ class core extends common {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traitement des polices de caractères
|
||||
*/
|
||||
|
||||
// Fusionne la liste des fontes avec les webSafe
|
||||
foreach (self::$fontsWebSafe as $fontId => $fontValue) {
|
||||
$fontName = explode (',', $fontValue);
|
||||
self::$fonts [$fontId] = $fontName[0];
|
||||
}
|
||||
// Importe les polices personnalisées
|
||||
$fontsImported = $this->getData(['fonts', 'imported']);
|
||||
if (is_array($fontsImported) &&
|
||||
!empty ($fontsImported)
|
||||
) {
|
||||
// Fusionner les fonts avec les fontes installées
|
||||
// Fusionner avec les fontes installées
|
||||
self::$fonts = array_merge(self::$fonts, $fontsImported);
|
||||
|
||||
}
|
||||
// Tri Alphabétique
|
||||
asort(self::$fonts);
|
||||
}
|
||||
|
||||
// Crée le fichier de personnalisation avancée
|
||||
if(file_exists(self::DATA_DIR.'custom.css') === false) {
|
||||
@ -2278,7 +2276,9 @@ class core extends common {
|
||||
|
||||
/**
|
||||
* Import des polices de caractères
|
||||
* A partir du CDN ou dans le dossier site/file/source/fonts
|
||||
* A partir du CDN
|
||||
* ou dans le dossier site/file/source/fonts
|
||||
* ou pas du tout si fonte webSafe
|
||||
*/
|
||||
$fonts = [ $this->getData(['theme', 'text', 'font']),
|
||||
$this->getData(['theme', 'title', 'font']),
|
||||
@ -2288,12 +2288,21 @@ class core extends common {
|
||||
];
|
||||
// Suppression des polices identiques
|
||||
$fonts = array_unique($fonts);
|
||||
// Lire le fichier des fontes locales
|
||||
$localFonts = $this->getData(['fonts', 'files']);
|
||||
|
||||
/**
|
||||
* Fontes Web Safe, ne sont pas chargées.
|
||||
*/
|
||||
foreach ($fonts as $fontId) {
|
||||
if (array_key_exists($fontId, self::$fontsWebSafe) ) {
|
||||
unset($fonts[$fontId]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Chargement des polices en ligne dans un fichier séparé
|
||||
*/
|
||||
// Lire le fichier des fontes locales
|
||||
$localFonts = $this->getData(['fonts', 'files']);
|
||||
$fontFile = '';
|
||||
foreach ($fonts as $fontId) {
|
||||
if (!array_key_exists($fontId, $localFonts) ) {
|
||||
@ -2516,6 +2525,16 @@ class core extends common {
|
||||
];
|
||||
// Suppression des polices identiques
|
||||
$fonts = array_unique($fonts);
|
||||
|
||||
/**
|
||||
* Fontes Web Safe, ne sont pas chargées.
|
||||
*/
|
||||
foreach ($fonts as $fontId) {
|
||||
if (array_key_exists($fontId, self::$fontsWebSafe) ) {
|
||||
unset($fonts[$fontId]);
|
||||
}
|
||||
}
|
||||
|
||||
// Lire le fichier des fontes locales
|
||||
$localFonts = $this->getData(['fonts', 'files']);
|
||||
|
||||
|
@ -870,3 +870,33 @@ if ($this->getData(['core', 'dataVersion']) < 11400) {
|
||||
// Mise à jour
|
||||
$this->setData(['core', 'dataVersion', 11400]);
|
||||
}
|
||||
|
||||
// Version 12.0.00
|
||||
if ($this->getData(['core', 'dataVersion']) < 12000) {
|
||||
$fonts = [
|
||||
'arimo' => 'Arimo',
|
||||
'arvo' => 'Arvo',
|
||||
'dancing-script' => 'Dancing Script',
|
||||
'droid-sans-2' => 'Droid Sans',
|
||||
'droid-serif-2' => 'Droid Serif',
|
||||
'indie-flower' => 'Indie Flower',
|
||||
'liberation-sans' => 'Liberation Sans',
|
||||
'liberation-serif' => 'Liberation Serif',
|
||||
'lobster-2' => 'Lobster',
|
||||
'lora' => 'Lora',
|
||||
'lato' => 'Lato',
|
||||
'old-standard-tt-3' => 'Old Standard TT',
|
||||
'open-sans' => 'Open Sans',
|
||||
'oswald-4' => 'Oswald',
|
||||
'pt-mono' => 'PT Mono',
|
||||
'pt-serif' => 'PT Serif',
|
||||
'rancho' => 'Rancho',
|
||||
'roboto' => 'Roboto',
|
||||
'ubuntu' => 'Ubuntu',
|
||||
'vollkorn' => 'Vollkorn'
|
||||
];
|
||||
$this->setData(['fonts', 'imported', $fonts]);
|
||||
|
||||
// Mise à jour
|
||||
$this->setData(['core', 'dataVersion', 12000]);
|
||||
}
|
||||
|
@ -87,7 +87,28 @@ class init extends common {
|
||||
],
|
||||
'fonts' => [
|
||||
'files' => [],
|
||||
'imported' => []
|
||||
'imported'=> [
|
||||
'arimo'=> 'Arimo',
|
||||
'arvo'=> 'Arvo',
|
||||
'dancing-script' => 'Dancing Script',
|
||||
'droid-sans-2'=> 'Droid Sans',
|
||||
'droid-serif-2'=> 'Droid Serif',
|
||||
'indie-flower'=> 'Indie Flower',
|
||||
'liberation-sans'=> 'Liberation Sans',
|
||||
'liberation-serif'=> 'Liberation Serif',
|
||||
'lobster-2'=> 'Lobster',
|
||||
'lora'=> 'Lora',
|
||||
'lato'=> 'Lato',
|
||||
'old-standard-tt-3'=> 'Old Standard TT',
|
||||
'open-sans'=> 'Open Sans',
|
||||
'oswald-4'=> 'Oswald',
|
||||
'pt-mono'=> 'PT Mono',
|
||||
'pt-serif'=> 'PT Serif',
|
||||
'rancho'=> 'Rancho',
|
||||
'roboto'=> 'Roboto',
|
||||
'ubuntu'=> 'Ubuntu',
|
||||
'vollkorn'=> 'Vollkorn'
|
||||
]
|
||||
],
|
||||
'page' => [
|
||||
'accueil' => [
|
||||
|
@ -574,11 +574,13 @@ class theme extends common {
|
||||
}
|
||||
}
|
||||
self::$fontsList [] = [
|
||||
$fontName,
|
||||
'<span style="font-family:' . $fontName . '">' . $fontName . '</span>' ,
|
||||
$fontId,
|
||||
$fontUsed[$fontId],
|
||||
//array_key_exists($fontId, $fonts['imported']) ? 'Importée' : '',
|
||||
array_key_exists($fontId, $fonts['files']) ? $fonts['files'][$fontId] : 'CDN Fonts',
|
||||
array_key_exists($fontId, $fonts['files']) ?
|
||||
$fonts['files'][$fontId] :
|
||||
(array_key_exists($fontId, self::$fontsWebSafe) ? 'WebSafe' : 'CDN Fonts'),
|
||||
array_key_exists($fontId, $fonts['imported']) || array_key_exists($fontId, $fonts['files'])
|
||||
? template::button('themeFontDelete' . $fontId, [
|
||||
'class' => 'themeFontDelete buttonRed',
|
||||
|
@ -47,9 +47,9 @@ $("input, select").on("change", function() {
|
||||
var tmpImg = new Image();
|
||||
tmpImg.onload = function() {
|
||||
// Informations affichées
|
||||
$("#themeHeaderImageHeight").val(tmpImg.height + " px");
|
||||
$("#themeHeaderImageWidth").val(tmpImg.width + " px");
|
||||
$("#themeHeaderImageRatio").val(tmpImg.width / tmpImg.height);
|
||||
$("#themeHeaderImageHeight").html(tmpImg.height + "px");
|
||||
$("#themeHeaderImageWidth").html(tmpImg.width + "px");
|
||||
$("#themeHeaderImageRatio").html(tmpImg.width / tmpImg.height);
|
||||
|
||||
// Limiter la hauteur à 600 px
|
||||
if (tmpImg.height > 600) {
|
||||
@ -69,6 +69,9 @@ $("input, select").on("change", function() {
|
||||
$("#themeHeaderHeight option:eq(0)").val(tmpImgHeight + "px");
|
||||
// Modifier l'option
|
||||
$("#themeHeaderHeight option:eq(0)").html("Hauteur de l\'image sélectionnée (" + tmpImgHeight + "px)");
|
||||
$("#themeHeaderImageInfo").show();
|
||||
} else {
|
||||
$("#themeHeaderImageInfo").hide();
|
||||
}
|
||||
};
|
||||
|
||||
@ -207,10 +210,10 @@ $("input, select").on("change", function() {
|
||||
// Affiche / Cache les options de l'image du fond
|
||||
$("#themeHeaderImage").on("change", function() {
|
||||
if($(this).val()) {
|
||||
$("#themeHeaderImageOptions").slideDown();
|
||||
$(".themeHeaderImageOptions").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#themeHeaderImageOptions").slideUp(function() {
|
||||
$(".themeHeaderImageOptions").slideUp(function() {
|
||||
$("#themeHeaderTextHide").prop("checked", false).trigger("change");
|
||||
});
|
||||
}
|
||||
|
@ -154,40 +154,20 @@
|
||||
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'header', 'image'])) ?
|
||||
$this->getData(['theme', 'header', 'image']) : "";
|
||||
echo template::file('themeHeaderImage', [
|
||||
'help' => 'Sélectionner une image aux dimensions recommandées ci-dessous :',
|
||||
'label' => 'Image',
|
||||
'type' => 1,
|
||||
'value' => $imageFile
|
||||
]); ?>
|
||||
<span class="themeHeaderImageOptions displayNone" id="themeHeaderImageInfo">
|
||||
Largeur de l'image : <span id="themeHeaderImageWidth"></span> (largeur de site : <?php echo $this->getData(['theme', 'site', 'width']); ?>)
|
||||
-
|
||||
Hauteur de l'image : <span id="themeHeaderImageHeight"></span>
|
||||
-
|
||||
Ratio : <span id="themeHeaderImageRatio"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3 textAlignRight">
|
||||
Informations sur l'image :
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::text('themeHeaderImageWidth', [
|
||||
'label' => 'Largeur',
|
||||
'class' => 'textAlignCenter',
|
||||
'disable' => true
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::text('themeHeaderImageHeight', [
|
||||
'label' => 'Hauteur',
|
||||
'class' => 'textAlignCenter',
|
||||
'disable' => true
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::text('themeHeaderImageRatio', [
|
||||
'label' => 'Ratio (L/H)',
|
||||
'class' => 'textAlignCenter',
|
||||
'disable' => true
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="themeHeaderImageOptions" class="displayNone">
|
||||
<div class="themeHeaderImageOptions" class="displayNone">
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('themeHeaderImageRepeat', $module::$repeats, [
|
||||
|
@ -37,7 +37,6 @@ $("input, select").on("change",function() {
|
||||
var titleFontText = $("#themeTitleFont :selected").text();
|
||||
var textFont = $("#themeTextFont :selected").val();
|
||||
var textFontText = $("#themeTextFont :selected").text();
|
||||
console.log(textFontText);
|
||||
var css = "@import url('https://fonts.cdnfonts.com/css/" + titleFont + "');";
|
||||
var css = "@import url('https://fonts.cdnfonts.com/css/" + textFont + "');";
|
||||
// Couleurs des boutons
|
||||
|
@ -19,7 +19,7 @@
|
||||
<div class="col2">
|
||||
<?php echo template::submit('blogEditSubmit', [
|
||||
'value' => 'Publier',
|
||||
'uniqueSubmission' => true,
|
||||
'uniqueSubmission' => true
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,7 +38,7 @@
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::file('blogEditPicture', [
|
||||
'help' => 'Taille optimale de l\'image de couverture : ' . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.',
|
||||
'help' => $this->getData(['theme', 'site', 'width']) !== '100%' ? 'Taille optimale de l\'image de couverture : ' . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.' : '',
|
||||
'label' => 'Image de couverture',
|
||||
'type' => 1,
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture'])
|
||||
|
Loading…
Reference in New Issue
Block a user