Merge branch 'master' into dev10
This commit is contained in:
commit
4ea76eb239
@ -316,6 +316,7 @@ core.start = function() {
|
|||||||
core.noticeAdd(_this.attr("id"), "Format incorrect");
|
core.noticeAdd(_this.attr("id"), "Format incorrect");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Iframes et vidéos responsives
|
* Iframes et vidéos responsives
|
||||||
*/
|
*/
|
||||||
@ -338,7 +339,25 @@ core.start = function() {
|
|||||||
});
|
});
|
||||||
}).trigger("resize");
|
}).trigger("resize");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Header responsive
|
||||||
|
*/
|
||||||
|
$(window).on("resize", function() {
|
||||||
|
var responsive = "<?php echo $this->getdata(['theme','header','imageContainer']);?>";
|
||||||
|
if (responsive === "cover" || responsive === "contain" ) {
|
||||||
|
var widthpx = "<?php echo $this->getdata(['theme','site','width']);?>";
|
||||||
|
var width = widthpx.substr(0,widthpx.length-2);
|
||||||
|
var heightpx = "<?php echo $this->getdata(['theme','header','height']);?>";
|
||||||
|
var height = heightpx.substr(0,heightpx.length-2);
|
||||||
|
var ratio = width / height;
|
||||||
|
$("header").height( $(window).width() / ratio );
|
||||||
|
$("header").css("line-height", $(window).width() / ratio + "px");
|
||||||
|
}
|
||||||
|
}).trigger("resize");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
core.start();
|
core.start();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1286,22 +1286,9 @@ class core extends common {
|
|||||||
$css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}';
|
$css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}';
|
||||||
$css .= 'header{background-color:' . $colors['normal'];
|
$css .= 'header{background-color:' . $colors['normal'];
|
||||||
|
|
||||||
|
// Valeur de hauteur traditionnelle
|
||||||
|
$css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
|
||||||
|
|
||||||
if ($this->getData(['theme', 'header', 'height']) === 'none') {
|
|
||||||
// Controle de l'existence du fichier
|
|
||||||
if (file_exists(self::FILE_DIR.'source/' . $this->getData(['theme','header','image'])) &&
|
|
||||||
$this->getData(['theme', 'header', 'image']) ) {
|
|
||||||
// On établie la hauteur du div en proportion de l'image
|
|
||||||
// (hauteur / largeur) . 100
|
|
||||||
$sizes = getimagesize(self::FILE_DIR.'source/'.$this->getData(['theme','header','image']));
|
|
||||||
$css .= ';height: 0; padding-top:';
|
|
||||||
$css .= ( $sizes[1] / $sizes[0] )* 100;
|
|
||||||
$css .= '%';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Valeur de hauteur traditionnelle
|
|
||||||
$css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
|
|
||||||
}
|
|
||||||
$css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
|
$css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
|
||||||
if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) {
|
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']) . '}';
|
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
|
||||||
|
@ -57,19 +57,17 @@
|
|||||||
<?php
|
<?php
|
||||||
if ($this->getData(['theme','header','linkHomePage'])){
|
if ($this->getData(['theme','header','linkHomePage'])){
|
||||||
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
|
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
|
||||||
|
<div id="headerContainer" class="container">
|
||||||
<?php if(
|
<?php if(
|
||||||
$this->getData(['theme', 'header', 'textHide']) === false
|
$this->getData(['theme', 'header', 'textHide']) === false
|
||||||
// Affiche toujours le titre de la bannière pour l'édition du thème
|
// Affiche toujours le titre de la bannière pour l'édition du thème
|
||||||
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
|
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
|
||||||
): ?>
|
): ?>
|
||||||
<div class="container">
|
|
||||||
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
|
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
|
||||||
</div> <!--fin container -->
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="container">
|
|
||||||
<span id="themeHeaderTitle"> </span>
|
<span id="themeHeaderTitle"> </span>
|
||||||
</div> <!--fin container -->
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</div> <!--fin container -->>
|
||||||
<?php
|
<?php
|
||||||
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";}
|
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";}
|
||||||
?>
|
?>
|
||||||
@ -129,19 +127,17 @@
|
|||||||
if ($this->getData(['theme','header','linkHomePage'])){
|
if ($this->getData(['theme','header','linkHomePage'])){
|
||||||
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
|
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
|
||||||
<header <?php if($this->getData(['theme', 'header', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
|
<header <?php if($this->getData(['theme', 'header', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
|
||||||
<?php if(
|
<div id="headerContainer" class="container">
|
||||||
$this->getData(['theme', 'header', 'textHide']) === false
|
<?php if(
|
||||||
// Affiche toujours le titre de la bannière pour l'édition du thème
|
$this->getData(['theme', 'header', 'textHide']) === false
|
||||||
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
|
// Affiche toujours le titre de la bannière pour l'édition du thème
|
||||||
): ?>
|
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
|
||||||
<div class="container">
|
): ?>
|
||||||
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
|
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
|
||||||
</div>
|
<?php else: ?>
|
||||||
<?php else: ?>
|
<span id="themeHeaderTitle"> </span>
|
||||||
<div class="container">
|
<?php endif; ?>
|
||||||
<span id="themeHeaderTitle"> </span>
|
</div> <!--fin container -->
|
||||||
</div> <!--fin container -->
|
|
||||||
<?php endif; ?>
|
|
||||||
</header>
|
</header>
|
||||||
<?php
|
<?php
|
||||||
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";} ?>
|
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";} ?>
|
||||||
|
@ -221,8 +221,8 @@ class theme extends common {
|
|||||||
];
|
];
|
||||||
public static $headerWide = [
|
public static $headerWide = [
|
||||||
'auto auto' => 'Automatique',
|
'auto auto' => 'Automatique',
|
||||||
'cover' => 'Responsive (cover)',
|
|
||||||
'100% 100%' => 'Image étirée (100% 100%)',
|
'100% 100%' => 'Image étirée (100% 100%)',
|
||||||
|
'cover' => 'Responsive (cover)',
|
||||||
'contain' => 'Responsive (contain)'
|
'contain' => 'Responsive (contain)'
|
||||||
];
|
];
|
||||||
public static $footerTemplate = [
|
public static $footerTemplate = [
|
||||||
|
@ -12,7 +12,10 @@
|
|||||||
* @link http://zwiicms.com/
|
* @link http://zwiicms.com/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("header").css("line-height", "");
|
||||||
|
$("header").css("height", "");
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aperçu en direct
|
* Aperçu en direct
|
||||||
@ -35,21 +38,25 @@ $("input, select").not("#barSelectLanguage").on("change", function() {
|
|||||||
tmpImgHeight = tmpImg.height;
|
tmpImgHeight = tmpImg.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Modifier la dropdown liste
|
//Modifier la dropdown liste si une image n'est pas sélectionnée
|
||||||
if ($("#themeHeaderImage").val() !== "") {
|
if ($("#themeHeaderImage").val() !== "" ) {
|
||||||
// Une image est ajoutée ou changée
|
// Une image est ajoutée ou changée
|
||||||
if ($("#themeHeaderHeight option").length === 4) {
|
if ($("#themeHeaderHeight option").length === 5) {
|
||||||
|
// Pas d'image précédemment on ajoute l'option
|
||||||
$("#themeHeaderHeight ").prepend('<option selected="selected" value="0"> Hauteur de l\'image sélectionnée </option>');
|
$("#themeHeaderHeight ").prepend('<option selected="selected" value="0"> Hauteur de l\'image sélectionnée </option>');
|
||||||
}
|
}
|
||||||
// Modifier la valeur
|
// Modifier la valeur
|
||||||
$("#themeHeaderHeight option:eq(0)").val(tmpImgHeight + "px");
|
$("#themeHeaderHeight option:eq(0)").val(tmpImgHeight + "px");
|
||||||
// Modifier l'option
|
// Modifier l'option
|
||||||
$("#themeHeaderHeight option:first-child").html("Hauteur de l\'image sélectionnée (" + tmpImgHeight + "px)");
|
$("#themeHeaderHeight option:eq(0)").html("Hauteur de l\'image sélectionnée (" + tmpImgHeight + "px)");
|
||||||
} else {
|
|
||||||
$("#themeHeaderHeight option:first-child").html("Hauteur de l\'image sélectionnée");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ($("#themeHeaderImage").val() === "" &&
|
||||||
|
$("#themeHeaderHeight option").length === 6 ) {
|
||||||
|
$("#themeHeaderHeight option:eq(0)").remove();
|
||||||
|
}
|
||||||
|
|
||||||
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
|
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
|
||||||
|
|
||||||
// Import des polices de caractères
|
// Import des polices de caractères
|
||||||
|
@ -55,24 +55,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="themeHeaderImageOptions" class="displayNone">
|
<div id="themeHeaderImageOptions" class="displayNone">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col6">
|
||||||
<?php echo template::select('themeHeaderImageRepeat', $module::$repeats, [
|
<?php echo template::select('themeHeaderImageRepeat', $module::$repeats, [
|
||||||
'label' => 'Répétition',
|
'label' => 'Répétition',
|
||||||
'selected' => $this->getData(['theme', 'header', 'imageRepeat'])
|
'selected' => $this->getData(['theme', 'header', 'imageRepeat'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col6">
|
||||||
<?php echo template::select('themeHeaderImagePosition', $module::$imagePositions, [
|
<?php echo template::select('themeHeaderImagePosition', $module::$imagePositions, [
|
||||||
'label' => 'Position',
|
'label' => 'Position',
|
||||||
'selected' => $this->getData(['theme', 'header', 'imagePosition'])
|
'selected' => $this->getData(['theme', 'header', 'imagePosition'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
|
||||||
<?php echo template::select('themeHeaderImageContainer', $module::$headerWide, [
|
|
||||||
'label' => 'Adaptation',
|
|
||||||
'selected' => $this->getData(['theme', 'header', 'imageContainer'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -98,20 +92,29 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Configuration</h4>
|
<h4>Configuration</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col3">
|
||||||
<?php echo template::select('themeHeaderPosition', $module::$headerPositions, [
|
<?php echo template::select('themeHeaderPosition', $module::$headerPositions, [
|
||||||
'label' => 'Position',
|
'label' => 'Position',
|
||||||
'selected' => $this->getData(['theme', 'header', 'position'])
|
'selected' => $this->getData(['theme', 'header', 'position'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col3">
|
||||||
|
<?php echo template::select('themeHeaderImageContainer', $module::$headerWide, [
|
||||||
|
'label' => 'Adaptation',
|
||||||
|
'selected' => $this->getData(['theme', 'header', 'imageContainer']),
|
||||||
|
'help' => 'Les modes responsives permettent de conserver des dimensions proportionnelles.<br />
|
||||||
|
Cover pour une image plus grande que la bannière, Contain pour une image plus petite.
|
||||||
|
Les modes Auto et Etiré ne provoquent pas de modification de la hauteur de la bannière.'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col3">
|
||||||
<?php echo template::select('themeHeaderHeight', $module::$headerHeights, [
|
<?php echo template::select('themeHeaderHeight', $module::$headerHeights, [
|
||||||
'label' => 'Hauteur',
|
'label' => 'Hauteur maximale',
|
||||||
'selected' => $this->getData(['theme', 'header', 'height']),
|
'selected' => $this->getData(['theme', 'header', 'height']),
|
||||||
'help' => "Quelque soit la taille de la bannière, la hauteur maximale autorisée est de 600 pixels."
|
'help' => 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures. <br />Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col3">
|
||||||
<?php echo template::select('themeHeaderTextAlign', $module::$aligns, [
|
<?php echo template::select('themeHeaderTextAlign', $module::$aligns, [
|
||||||
'label' => 'Alignement du contenu',
|
'label' => 'Alignement du contenu',
|
||||||
'selected' => $this->getData(['theme', 'header', 'textAlign'])
|
'selected' => $this->getData(['theme', 'header', 'textAlign'])
|
||||||
|
Loading…
Reference in New Issue
Block a user