Deltacms/core/module/theme/view/header/header.php

326 lines
13 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Paramètres';
$text[3] = 'Position';
$text[4] = 'Nature de contenu';
$text[5] = 'Hauteur maximale';
$text[6] = '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.';
$text[7] = 'Largeur';
$text[8] = 'Masquer la bannière en écran réduit';
$text[9] = 'Aligner la bannière avec le contenu';
$text[10] = 'Couleurs';
$text[11] = 'Le curseur horizontal règle le niveau de transparence.';
$text[12] = 'Arrière-plan';
$text[13] = 'Le curseur horizontal règle le niveau de transparence.';
$text[14] = 'Texte';
$text[15] = 'Mise en forme du titre';
$text[16] = 'Masquer le titre du site';
$text[17] = 'Police';
$text[18] = 'Taille';
$text[19] = 'Style';
$text[20] = 'Casse';
$text[21] = 'Proportionnelle à celle définie dans le site.';
$text[22] = 'Alignement du contenu';
$text[23] = 'Papier peint';
$text[24] = 'Sélectionner une image aux dimensions recommandées ci-dessous :';
$text[25] = 'Image';
$text[26] = 'Répétition';
$text[27] = 'Adaptation';
$text[28] = '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.';
$text[29] = 'Bannière cliquable';
$text[30] = 'Largeur : ';
$text[31] = ' | Hauteur : ';
$text[32] = ' | ratio : ';
$text[33] = 'Contenu personnalisé';
$text[34] ='Enregistrer';
$headerPositions = $module::$headerPositions;
$headerFeatures = $module::$headerFeatures;
$headerHeights = $module::$headerHeights;
$containerWides = $module::$containerWides;
$headerFontSizes = $module::$headerFontSizes;
$fontWeights = $module::$fontWeights;
$textTransforms = $module::$textTransforms;
$aligns = $module::$aligns;
$repeats = $module::$repeats;
$headerWide = $module::$headerWide;
$imagePositions = $module::$imagePositions;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Settings';
$text[3] = 'Position';
$text[4] = 'Type of content';
$text[5] = 'Maximum height';
$text[6] = 'The maximum height is 600 pixels, even if the selected image size is larger. <br/>When the adaptation is set to Responsive, the height decreases in proportion to the width.';
$text[7] = 'Width';
$text[8] = 'Hide banner in small screen';
$text[9] = 'Align banner with content';
$text[10] = 'Colors';
$text[11] = 'Horizontal slider sets transparency level';
$text[12] = 'Background';
$text[13] = 'Horizontal slider sets transparency level';
$text[14] = 'Text';
$text[15] = 'Title formatting';
$text[16] = 'Hide site title';
$text[17] = 'Font';
$text[18] = 'Size';
$text[19] = 'Style';
$text[20] = 'Character case';
$text[21] = 'Proportional to that defined in the site';
$text[22] = 'Content alignment';
$text[23] = 'Wallpaper';
$text[24] = 'Select an image with the following recommended dimensions:';
$text[25] = 'Image';
$text[26] = 'Repeat';
$text[27] = 'Adaptation';
$text[28] = 'Responsive modes allow proportional dimensions to be maintained.<br/>Cover for an image larger than the banner, Contain for a smaller image. The Auto and Stretch modes do not change the height of the banner.';
$text[29] = 'Clickable banner';
$text[30] = 'Width : ';
$text[31] = ' | Height : ';
$text[32] = ' | ratio : ';
$text[33] = 'Custom content';
$text[34] ='Save';
$headerPositions = $module::$headerPositions_en;
$headerFeatures = $module::$headerFeatures_en;
$headerHeights = $module::$headerHeights_en;
$containerWides = $module::$containerWides_en;
$headerFontSizes = $module::$headerFontSizes_en;
$fontWeights = $module::$fontWeights_en;
$textTransforms = $module::$textTransforms_en;
$aligns = $module::$aligns_en;
$repeats = $module::$repeats_en;
$headerWide = $module::$headerWide_en;
$imagePositions = $module::$imagePositions_en;
break;
}
?>
<?php echo template::formOpen('themeHeaderForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('themeHeaderBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme',
'ico' => 'left',
'value' => $text[0]
]); ?>
</div>
<div class="col2">
<?php echo template::button('themeHeaderHelp', [
'href' => 'https://doc.deltacms.fr/personnalisation-de-la-banniere',
'target' => '_blank',
'ico' => 'help',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('themeHeaderSubmit',[
'value' => $text[34]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[2]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderPosition', $headerPositions, [
'label' => $text[3],
'selected' => $this->getData(['theme', 'header', 'position'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFeature', $headerFeatures, [
'label' => $text[4],
'selected' => $this->getData(['theme', 'header', 'feature'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderHeight', $headerHeights, [
'label' => $text[5],
'selected' => $this->getData(['theme', 'header', 'height']),
'help' => $text[6]
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderWide', $containerWides, [
'label' => $text[7],
'selected' => $this->getData(['theme', 'header', 'wide'])
]); ?>
</div>
<div class="col4">
<div id="themeHeaderSmallDisplay" class="displayNone">
<?php echo template::checkbox('themeHeaderTinyHidden', true, $text[8], [
'checked' => $this->getData(['theme', 'header', 'tinyHidden'])
]); ?>
</div>
</div>
<div class="col4">
<div id="themeHeaderPositionOptions" class="displayNone">
<?php echo template::checkbox('themeHeaderMargin', true, $text[9], [
'checked' => $this->getData(['theme', 'header', 'margin'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[10]; ?></h4>
<div class="row">
<div class="col6">
<?php echo template::text('themeHeaderBackgroundColor', [
'class' => 'colorPicker',
'help' => $text[11],
'label' => $text[12],
'value' => $this->getData(['theme', 'header', 'backgroundColor'])
]); ?>
</div>
<div class="col6">
<?php echo template::text('themeHeaderTextColor', [
'class' => 'colorPicker',
'help' => $text[13],
'label' => $text[14],
'value' => $this->getData(['theme', 'header', 'textColor'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row wallpaperContainer">
<div class="col12">
<div class="block">
<h4><?php echo $text[15]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::checkbox('themeHeaderTextHide', true, $text[16], [
'checked' => $this->getData(['theme', 'header', 'textHide'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFont', $module::$fonts, [
'label' => $text[17],
'selected' => $this->getData(['theme', 'header', 'font']),
'fonts' => true
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderFontSize', $headerFontSizes, [
'label' => $text[18],
'help' => $text[21],
'selected' => $this->getData(['theme', 'header', 'fontSize'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderFontWeight', $fontWeights, [
'label' => $text[19],
'selected' => $this->getData(['theme', 'header', 'fontWeight'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderTextTransform', $textTransforms, [
'label' => $text[20],
'selected' => $this->getData(['theme', 'header', 'textTransform'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('themeHeaderTextAlign', $aligns, [
'label' => $text[22],
'selected' => $this->getData(['theme', 'header', 'textAlign'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row wallpaperContainer">
<div class="col12">
<div class="block">
<h4><?php echo $text[23]; ?></h4>
<div class="row">
<div class="col12">
<?php
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'header', 'image'])) ?
$this->getData(['theme', 'header', 'image']) : "";
echo template::file('themeHeaderImage', [
'help' => $text[24],
'label' => $text[25],
'type' => 1,
'value' => $imageFile
]); ?>
</div>
</div>
<div id="themeHeaderImageOptions" class="displayNone">
<div class="row">
<div class="col3">
<?php echo template::select('themeHeaderImageRepeat', $repeats, [
'label' => $text[26],
'selected' => $this->getData(['theme', 'header', 'imageRepeat'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeHeaderImageContainer', $headerWide, [
'label' => $text[27],
'selected' => $this->getData(['theme', 'header', 'imageContainer']),
'help' => $text[28]
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeHeaderImagePosition', $imagePositions, [
'label' => $text[3],
'selected' => $this->getData(['theme', 'header', 'imagePosition'])
]); ?>
</div>
<div id="themeHeaderShow" class="col3">
<?php echo template::checkbox('themeHeaderlinkHomePage', true, $text[29], [
'checked' => $this->getData(['theme', 'header', 'linkHomePage'])
]); ?>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<span id="themeHeaderImage">
<?php echo $text[30]; ?><span id="themeHeaderImageWidth"></span><?php echo $text[31]; ?><span id="themeHeaderImageHeight"></span><?php echo $text[32]; ?><span id="themeHeaderImageRatio"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row featureContainer">
<div class="col12">
<div class="row">
<div class="col12">
<?php echo template::textarea('themeHeaderText', [
'label' => '<div class="titleWysiwygContent">'.$text[33].'</div>',
'class' => 'editorWysiwyg',
'value' => $this->getData(['theme', 'header', 'featureContent'])
]); ?>
</div>
</div>
</div>
</div>
<div id="featureContent" class="displayNone">
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
<?php echo template::formClose(); ?>