diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index d2c3be20..b7b26ce6 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -590,7 +590,7 @@ class theme extends common { $type, $type !== 'websafe' ? template::button('themeFontEdit' . $fontId, [ 'class' => 'themeFontEdit', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontEdit/' . $fontId . '/' . $_SESSION['csrf'], + 'href' => helper::baseUrl() . $this->getUrl(0) . '/fontEdit/' . $type . '/' . $fontId . '/' . $_SESSION['csrf'], 'value' => template::ico('pencil'), 'disabled' => !empty($fontUsed[$fontId]) ]) @@ -719,8 +719,8 @@ class theme extends common { } // Valeurs en sortie $this->addOutput([ - 'title' => 'Ajouter une fonte', - 'view' => 'fontAdd' + 'title' => 'Editer une fonte', + 'view' => 'fontEdit' ]); } diff --git a/core/module/theme/view/fontAdd/fontAdd.php b/core/module/theme/view/fontAdd/fontAdd.php index ebe3daf9..804b3674 100644 --- a/core/module/theme/view/fontAdd/fontAdd.php +++ b/core/module/theme/view/fontAdd/fontAdd.php @@ -9,7 +9,7 @@ ]); ?>
- 'https://doc.zwiicms.fr/fontes#add', 'target' => '_blank', 'ico' => 'help', diff --git a/core/module/theme/view/fontEdit/fontEdit.js.php b/core/module/theme/view/fontEdit/fontEdit.js.php index e9105513..dda81719 100644 --- a/core/module/theme/view/fontEdit/fontEdit.js.php +++ b/core/module/theme/view/fontEdit/fontEdit.js.php @@ -10,35 +10,3 @@ */ -/** - * Option par défaut du sélecteur de mode - */ - $(document).ready(function(){ - $('input[name=fontAddFontImported]').prop('checked', true); - $('input[name=fontAddFontUrl]').prop('checked', false); - $('#containerFontAddFile').hide(); -}); - - -/** - * Mode téléchargement en ligne de la fonte ou installation locale - */ -$("input[name=fontAddFontImported]").on("click", function() { - if( $('input[name=fontAddFontImported]').is(':checked') ){ - $('input[name=fontAddFontFile]').prop('checked', false); - } else { - $('input[name=fontAddFontFile]').prop('checked', true); - } - $('#containerFontAddFile').hide(); - $('#containerFontAddUrl').show(); -}); - -$("input[name=fontAddFontFile]").on("click", function() { - if( $('input[name=fontAddFontFile]').is(':checked') ){ - $('input[name=fontAddFontImported]').prop('checked', false); - } else { - $('input[name=fontAddFontImported]').prop('checked', true); - } - $('#containerFontAddFile').show(); - $('#containerFontAddUrl').hide(); -}); diff --git a/core/module/theme/view/fontEdit/fontEdit.php b/core/module/theme/view/fontEdit/fontEdit.php index ebe3daf9..d6a1d2a9 100644 --- a/core/module/theme/view/fontEdit/fontEdit.php +++ b/core/module/theme/view/fontEdit/fontEdit.php @@ -1,7 +1,7 @@ - +
- 'buttonGrey', 'href' => helper::baseUrl() . 'theme/fonts', 'ico' => 'left', @@ -9,7 +9,7 @@ ]); ?>
- 'https://doc.zwiicms.fr/fontes#add', 'target' => '_blank', 'ico' => 'help', @@ -18,7 +18,7 @@ ]); ?>
- 'Valider', 'uniqueSubmission' => true ]); ?> @@ -30,51 +30,67 @@

Identité de la fonte

- -
-
- + getUrl(2)) { + case 'imported': + echo template::checkbox('fontEditFontImported', true, 'Fonte en ligne',[ + 'checked' => true + ]); + break; + case 'files': + echo template::checkbox('fontEditFontFile', true,'Fonte installée', [ + 'checked' => true + ]); + break; + } + ?>
- 'off', 'label' => 'Identifiant (sans espace ni majuscule)', - 'placeholder' => 'big-marker-extrude' + 'value' => $this->getUrl(3) ]); ?>
- 'off', 'label' => 'Nom', - 'placeholder' => 'Big Marker Extrude' + 'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'name']) ]); ?>
+
- 'off', 'label' => 'Famille', - 'placeholder' => "'Big Marker Extrude', sans-serif" + 'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'font-family']) ]); ?>
-
+
- 'Fichier de fonte (Format WOFF)' - ]); ?> -
-
-
-
- 'Url du fichier de fonte', - 'placeholder' => 'https://fonts.cdnfonts.com/css/big-marker-extrude' - ]); ?> + getUrl(2)) { + case 'imported': + echo template::text('fontEditUrl', [ + 'label' => 'Url du fichier de fonte', + 'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']), + 'class' => $this->getUrl(2) === 'imported' ? '' : 'noDisplay' + ]); + break; + case 'files': + echo template::file('fontEditFile', [ + 'label' => 'Fichier de fonte (Format WOFF)', + 'value' => $this->getData(['fonts', $this->getUrl(2), $this->getUrl(3), 'ressource']), + 'class' => $this->getUrl(2) === 'file' ? '' : 'noDisplay' + ]); + break; + } + ?>