Merge branch 'master' of https://github.com/fredtempez/ZwiiCMS
This commit is contained in:
commit
10e292e831
@ -1006,16 +1006,16 @@ class core extends common {
|
||||
$css .= ';height: 0; padding-top:';
|
||||
$css .= ( $sizes[1] / $sizes[0] )* 100;
|
||||
$css .= '%';
|
||||
} else {
|
||||
//} else {
|
||||
// Le fichier n'existe plus
|
||||
// largeur par défaut
|
||||
$css .= ';height: 150px;';
|
||||
// $css .= ';height: 150px; line-height: 150px;';
|
||||
}
|
||||
} else {
|
||||
// Valeur de hauteur traditionnelle
|
||||
$css .= ';height:' . $this->getData(['theme', 'header', 'height']);
|
||||
$css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
|
||||
}
|
||||
$css .= ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
|
||||
$css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
|
||||
if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) {
|
||||
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
|
||||
}
|
||||
@ -1888,14 +1888,14 @@ class layout extends common {
|
||||
* Affiche le copyright
|
||||
*/
|
||||
public function showCopyright() {
|
||||
// Bloc copyright
|
||||
// Ouverture Bloc copyright
|
||||
$items = '<div id="footerCopyright">';
|
||||
$items .= '<span id="footerFont">';
|
||||
// Affichage de motorisé par
|
||||
$items .= '<span id="footerDisplayCopyright" ';
|
||||
$items .= $this->getData(['theme','footer','displayCopyright']) === false ? 'class="displayNone"' : '';
|
||||
$items .= '>Motorisé par </span>';
|
||||
// Toujours affiche le nom du CMS
|
||||
// Toujours afficher le nom du CMS
|
||||
$items .= '<span id="footerZwiiCMS">';
|
||||
$items .= '<a href="http://zwiicms.com/" onclic="window.open(this.href);return false" data-tippy-content="Zwii CMS sans base de données, très léger et performant">ZwiiCMS</a>';
|
||||
$items .= '</span>';
|
||||
@ -1904,7 +1904,7 @@ class layout extends common {
|
||||
$items .= $this->getData(['theme','footer','displayVersion']) === false ? 'class="displayNone"' : '';
|
||||
$items .= '><wbr> '. common::ZWII_VERSION ;
|
||||
$items .= '</span>';
|
||||
// Afifchage du lien de connexion
|
||||
// Affichage du lien de connexion
|
||||
$items .= '<span id="footerDisplaySiteMap"';
|
||||
$items .= $this->getData(['theme','footer','displaySiteMap']) === false? 'class="displayNone"' : '';
|
||||
$items .= '><wbr> | <a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan du site</a>';
|
||||
|
@ -12,42 +12,73 @@
|
||||
|
||||
|
||||
|
||||
// Récupérer les dimensions de l'image et les place dans des champs cachés
|
||||
$("#themeHeaderImage").on("change", function() {
|
||||
if($(this).val() !== '') {
|
||||
var tmpImg = new Image();
|
||||
var url = "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
|
||||
tmpImg.src= url;
|
||||
$(tmpImg).on('load',function(){
|
||||
$("#themeHeaderImageWidth").val(tmpImg.width);
|
||||
$("#themeHeaderImageHeight").val(tmpImg.height);
|
||||
});
|
||||
} else {
|
||||
$("#themeHeaderImageWidth").val(0);
|
||||
$("#themeHeaderImageHeight").val(0);
|
||||
}
|
||||
console.log ("imagesize");
|
||||
}).trigger("change");
|
||||
|
||||
|
||||
/**
|
||||
* Aperçu en direct
|
||||
*/
|
||||
$("input, select").on("change", function() {
|
||||
|
||||
var themeHeaderHeight = $("#themeHeaderHeight").val();
|
||||
var widthSize = $("#themeHeaderImageWidth").val();
|
||||
var heightSize = $("#themeHeaderImageHeight").val();
|
||||
var themeHeaderImage = $("#themeHeaderImage").val();
|
||||
|
||||
|
||||
// Import des polices de caractères
|
||||
var headerFont = $("#themeHeaderFont").val();
|
||||
var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');";
|
||||
|
||||
// Couleurs, image, alignement et hauteur de la bannière
|
||||
css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";line-height:" + $("#themeHeaderHeight").val();
|
||||
css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";";
|
||||
|
||||
// Hauteur proportionnelle
|
||||
var themeHeaderHeight = $("#themeHeaderHeight").val();
|
||||
var widthSize = $("#themeHeaderImageWidth").val();
|
||||
var heightSize = $("#themeHeaderImageHeight").val();
|
||||
if (themeHeaderHeight === "none" ) {
|
||||
css += ";height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%;}";
|
||||
} else {
|
||||
css += ";height:" + themeHeaderHeight + ";}";
|
||||
}
|
||||
|
||||
var themeHeaderImage = $("#themeHeaderImage").val();
|
||||
|
||||
// Une imge est sélectionnée
|
||||
if(themeHeaderImage) {
|
||||
css += "header{background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + themeHeaderImage + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + "}";
|
||||
}
|
||||
else {
|
||||
css += "header{background-image:none}";
|
||||
}
|
||||
|
||||
// Adaptation de la bannière
|
||||
css += "header{background-size:" + $("#themeHeaderImageContainer").val() + "}";
|
||||
|
||||
css += "background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + themeHeaderImage + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";";
|
||||
// Adaptation de la bannière
|
||||
css += "background-size:" + $("#themeHeaderImageContainer").val() + ";";
|
||||
|
||||
// Position responsive
|
||||
if (themeHeaderHeight === "none" ) {
|
||||
|
||||
css += "height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%;";
|
||||
|
||||
console.log(widthSize + "-" + heightSize + ' ' + themeHeaderImage );
|
||||
//console.log(css);
|
||||
} else {
|
||||
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + ";";
|
||||
}
|
||||
|
||||
}else {
|
||||
|
||||
css += "background-image:none;";
|
||||
// Forcer la sélection 150px
|
||||
$("#themeHeaderHeight option:eq(2)").prop("selected", true);
|
||||
|
||||
}
|
||||
css += "}";
|
||||
|
||||
console.log(css);
|
||||
|
||||
|
||||
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
|
||||
@ -119,20 +150,6 @@ $("#themeHeaderHeight").on("change", function() {
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
// Récupérer les dimensions de l'image et les place dans des champs cachés
|
||||
$("#themeHeaderImage").on("change", function() {
|
||||
if($(this).val() !== '') {
|
||||
var tmpImg = new Image();
|
||||
var url = "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
|
||||
tmpImg.src= url;
|
||||
$(tmpImg).on('load',function(){
|
||||
$("#themeHeaderImageWidth").val(tmpImg.width);
|
||||
$("#themeHeaderImageHeight").val(tmpImg.height);
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
|
||||
|
||||
// Affiche / Cache les options de l'image du fond
|
||||
$("#themeHeaderImage").on("change", function() {
|
||||
@ -145,6 +162,7 @@ $("#themeHeaderImage").on("change", function() {
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
// Affiche / Cache les options de la position
|
||||
$("#themeHeaderPosition").on("change", function() {
|
||||
if($(this).val() === 'site') {
|
||||
|
@ -40,16 +40,19 @@
|
||||
<div class="block">
|
||||
<h4>Image</h4>
|
||||
<?php
|
||||
$sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image']));
|
||||
echo template::text('themeHeaderImageWidth', [
|
||||
$imageFile = file_exists('site/file/source/'.$this->getData(['theme', 'header', 'image'])) ? $this->getData(['theme', 'header', 'image']) : "";
|
||||
if ($this->getData(['theme', 'header', 'image']) &&
|
||||
$imageFile !== '') {
|
||||
$sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image']));
|
||||
}
|
||||
echo template::hidden('themeHeaderImageWidth', [
|
||||
'value' => $sizes [0],
|
||||
'noDirty' => true
|
||||
]);
|
||||
echo template::text('themeHeaderImageHeight', [
|
||||
echo template::hidden('themeHeaderImageHeight', [
|
||||
'value' => $sizes [1],
|
||||
'noDirty' => true
|
||||
]);
|
||||
$imageFile = file_exists('site/file/source/'.$this->getData(['theme', 'header', 'image'])) ? $this->getData(['theme', 'header', 'image']) : "";
|
||||
echo template::file('themeHeaderImage', [
|
||||
'label' => 'Fond',
|
||||
'type' => 1,
|
||||
|
Loading…
Reference in New Issue
Block a user