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

107 lines
3.0 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Retour';
$text[1] = 'Aide';
$text[2] = 'Enregistrer';
$text[3] = 'Paramètres de la police';
$text[4] = 'Nom de la police sélectionnée';
$text[5] = 'Valeur non modifiable';
$text[6] = 'Liaison avec un fichier de police';
$text[7] = 'Le fichier de police est envoyé, ou pas, depuis un dépôt local';
$text[8] = 'Vous devez au préalable téléverser le fichier de police, ttf, woff, otf, eot ou woff2 dans le dossier fonts avec le gestionnaire de fichiers.';
$text[9] = 'Sélection d\'une police';
$text[10] = 'License';
$text[11] = 'Type de license de la police';
$typeAddFont = $module::$typeAddFont;
break;
case 'en' :
$text[0] = 'Back';
$text[1] = 'Help';
$text[2] = 'Save';
$text[3] = 'Font settings';
$text[4] = 'Selected font name';
$text[5] = 'Value not editable';
$text[6] = 'Link to a font file';
$text[7] = 'The font file is sent, or not, from a local repository';
$text[8] = 'You must first upload the font file, ttf, woff, otf, eot or woff2 to the fonts folder with the file manager';
$text[9] = 'Select a font';
$text[10] = 'License';
$text[11] = 'License type of the font';
$typeAddFont = $module::$typeAddFont_en;
break;
}
?>
<?php echo template::formOpen('themeEditFonts'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('themeFontsBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'theme/fonts',
'ico' => 'left',
'value' => $text[0]
]); ?>
</div>
<div class="col2">
<?php echo template::button('themeSiteHelp', [
'href' => 'https://doc.deltacms.fr/polices',
'target' => '_blank',
'ico' => 'help',
'value' => $text[1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset6">
<?php echo template::submit('editFontSubmit',[
'value' => $text[2]
]); ?>
</div>
</div>
<div class="block">
<h4><?php echo $text[3]; ?></h4>
<div class="row">
<div class="col4">
<?php echo template::text('nameEditFont', [
'value' => $this->getData(['fonts', $this->getUrl(2),'name']),
'label' => $text[4],
'readonly' => true,
'help' => $text[5]
]); ?>
</div>
<div class="col4">
<?php echo template::select('typeEditFont', $typeAddFont, [
'label' => $text[6],
'selected' => $this->getData(['fonts', $this->getUrl(2),'type']),
'help' => $text[7]
]); ?>
</div>
<div class="col4">
<!-- Sélection d'un fichier font -->
<?php $key = array_search( $this->getData(['fonts', $this->getUrl(2),'file']), $module::$fontFiles);
echo template::select('fileEditFont', $module::$fontFiles, [
'selected' => $key,
'help' => $text[8],
'label' => $text[9]
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::text('licenseEditFont', [
'value' => $this->getData(['fonts', $this->getUrl(2),'license']),
'label' => $text[10],
'help' => $text[11]
]); ?>
</div>
</div>
</div>
<?php echo template::formClose(); ?>