Browse Source

Concernant #7

-  Le "logo" dans les `.yaml` ne servait en pratique pas -> on supprime
  -  En revanche on garde icone_barre
  -  Du coup pas de possibilité de `#CHEMIN_IMAGE` comme suggéré en #7, puisque par définition
  c'est dans le dossier `icones_barre`
  -  On passe les icones en svg
  -  lorsqu'on a choisi le modèle qu'on veut insérer, on insère l'icone en
  titre de formulaire
Autre :
  -  correction de bug d'appel sur `_T_ou_Typo()` dans certains cas
Maïeul 10 months ago
parent
commit
5a4bf98b68
  1. 25
      formulaires/inserer_modeles.html
  2. 4
      formulaires/inserer_modeles.php
  3. 1
      icones_barre/document-xx.svg
  4. BIN
      icones_barre/inserer_modeles.png
  5. BIN
      icones_barre/media.png
  6. 1
      icones_barre/modele-xx.svg
  7. 2
      inc/inserer_modeles.php
  8. 2
      inserer_modeles_pipelines.php
  9. 3
      modeles/media.yaml
  10. 2
      paquet.xml
  11. BIN
      prive/themes/spip/images/modele-16.png
  12. BIN
      prive/themes/spip/images/modele-24.png
  13. BIN
      prive/themes/spip/images/modele-32.png
  14. BIN
      prive/themes/spip/images/modele-add-16.png
  15. BIN
      prive/themes/spip/images/modele-add-24.png
  16. 1
      prive/themes/spip/images/modele-add-24.svg
  17. BIN
      prive/themes/spip/images/modele-add-32.png
  18. 11
      prive/themes/spip/images/modele-xx.svg

25
formulaires/inserer_modeles.html

@ -1,9 +1,10 @@
<div class="ajax formulaire_spip formulaire_configurer formulaire_inserer_modeles">
[(#ENV{formulaire_modele}|non)<h3 class="titrem">
<img src="[(#CHEMIN_IMAGE{modele-add-24.png}|url_absolue)]" class="cadre-icone" />
<img src="[(#CHEMIN_IMAGE{modele-add-24.svg}|url_absolue)]" class="cadre-icone" />
<:inserer_modeles:titre_inserer_modeles:>
</h3>]
[(#ENV{formulaire_modele}|oui)<h3 class="titrem">
[(#ENV{icone_barre}|balise_img)&nbsp;]
<:inserer_modeles:titre_inserer{modele=#ENV{_nom}}:>
</h3>]
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
@ -30,22 +31,22 @@
]
<input type="hidden" name="formulaire_modele" value="#ENV{formulaire_modele}" />
<div class="editer-groupe">
#GENERER_SAISIES{#ENV{_saisies}}
#GENERER_SAISIES{#ENV{_saisies}}
</div>
<p class="boutons">
<input type="submit" class="submit" name="inserer" value="<:inserer_modeles:bouton_inserer:>" />
[(#ENV{ne_pas_afficher_bouton_annuler}|non)<input type="submit" class="submit link" name="annuler" value="<:bouton_annuler:>" />]
<input type="submit" class="submit" name="inserer" value="<:inserer_modeles:bouton_inserer:>" />
[(#ENV{ne_pas_afficher_bouton_annuler}|non)<input type="submit" class="submit link" name="annuler" value="<:bouton_annuler:>" />]
</p>
</BOUCLE_deja_choisi>
<B_choix>
<strong><:inserer_modeles:choisir_modele:></strong>
<div class="editer-groupe">
<B_choix>
<strong><:inserer_modeles:choisir_modele:></strong>
<div class="editer-groupe">
<div class="editer">
<BOUCLE_choix(POUR){tableau #ENV{_liste_formulaires_modeles}}{par valeur}>
<div class="choix modele">
#SET{id,#CLE|concat{#ENV{modalbox}|?{'_modalbox',''}}}
<input type="radio" class="radio" name="formulaire_modele" id="#GET{id}" value="#CLE" />
<label for="#GET{id}">[(#VALEUR|table_valeur{icone_barre}|balise_img|liens_absolus)&nbsp;][(#VALEUR|table_valeur{nom})]</label>
<BOUCLE_choix(POUR){tableau #ENV{_liste_formulaires_modeles}}{par valeur}>
<div class="choix modele">
#SET{id,#CLE|concat{#ENV{modalbox}|?{'_modalbox',''}}}
<input type="radio" class="radio" name="formulaire_modele" id="#GET{id}" value="#CLE" />
<label for="#GET{id}">[(#VALEUR|table_valeur{icone_barre}|balise_img|liens_absolus)&nbsp;][(#VALEUR|table_valeur{nom})]</label>
</div>
</BOUCLE_choix>
</div>

4
formulaires/inserer_modeles.php

@ -36,7 +36,9 @@ function formulaires_inserer_modeles_charger_dist($formulaire_modele, $modalbox,
$contexte['formulaire_modele'] = $formulaire_modele;
$contexte['_nom'] = _T_ou_typo($infos_modele['nom']);
$contexte['logo'] = $infos_modele['logo'];
if (isset($infos_modele['icone_barre'])) {
$contexte['icone_barre'] = find_in_path('icones_barre/'.$infos_modele['icone_barre']);
}
$contexte['_saisies'] = $infos_modele['parametres'];
if (_request('_code_modele')) {
$contexte['_code_modele'] = _request('_code_modele');

1
icones_barre/document-xx.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="16" viewBox="0 0 111.408 128" width="13.926"><path d="M100.972 10.411c-13.881-13.881-36.467-13.881-50.349 0L1.83 59.205a6.245 6.245 0 0 0 8.832 8.832l48.795-48.794c9.011-9.012 23.673-9.012 32.684 0 9.034 9.033 9.033 23.652 0 32.684L31.018 113.05c-3.288 3.289-8.639 3.289-11.927 0-3.288-3.288-3.288-8.638 0-11.927l58.287-58.286a6.245 6.245 0 0 0-8.832-8.832L10.259 92.29c-8.158 8.158-8.158 21.433 0 29.591 8.159 8.159 21.433 8.158 29.591 0l61.122-61.121c13.916-13.915 13.914-36.436 0-50.349z" style="fill:#555;stroke-width:.25000048"/></svg>

After

Width:  |  Height:  |  Size: 588 B

BIN
icones_barre/inserer_modeles.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

BIN
icones_barre/media.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

1
icones_barre/modele-xx.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M14.994.85v14.272H.975V.85Z" style="fill:#fff;stroke-width:.28920519"/><path d="M11.032 5.242v5.489H4.937V5.24Z" style="fill:#1d83d4;stroke-width:.28920519"/><path d="M9.204 6.889v2.195H6.766V6.889Z" style="fill:#fff;stroke-width:.28920519"/><path d="m12.609 5-1.293-1.164.862-.776 1.293 1.164zM4.654 3.809 3.361 4.973l-.862-.776 1.293-1.165ZM3.36 11l1.294 1.164-.862.776-1.293-1.164zM13.47 11.776l-1.293 1.164-.862-.776 1.293-1.165z" style="fill:#888;stroke-width:.28920519"/><path d="M16 15.204c0 .44-.396.796-.884.796H.884C.396 16 0 15.643 0 15.204V.796C0 .356.396 0 .884 0h14.232c.488 0 .884.357.884.796Zm-1.768-.823V1.59H1.798v12.817h12.434Z" style="fill:#666;stroke-width:.28920519"/></svg>

After

Width:  |  Height:  |  Size: 768 B

2
inc/inserer_modeles.php

@ -2,7 +2,7 @@
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
include_spip('inc/saisies');
/**
* Lister les formulaires de modeles disponibles dans les dossiers modeles/
* les trie par ordre alphabétique de nom

2
inserer_modeles_pipelines.php

@ -87,7 +87,7 @@ function inserer_modeles_porte_plume_lien_classe_vers_icone($flux) {
$formulaires_modeles = inserer_modeles_lister_formulaires_modeles();
if (count($formulaires_modeles) > 0) {
$icones = array();
$icones['outil_inserer_modeles'] = 'inserer_modeles.png';
$icones['outil_inserer_modeles'] = 'modele-xx.svg';
foreach ($formulaires_modeles as $nom => $formulaire) {
if (substr($nom, -5) == '.yaml') {
$nom = substr($nom, 0, -5);

3
modeles/media.yaml

@ -1,6 +1,5 @@
nom: '<:inserer_modeles:nom_media:>'
logo: 'images/media-24.png'
icone_barre: 'media.png'
icone_barre: 'document-xx.svg'
parametres:
-
saisie: 'hidden'

2
paquet.xml

@ -4,7 +4,7 @@
version="2.0.0"
etat="stable"
compatibilite="[4.0.0;4.1.*]"
logo="prive/themes/spip/images/modele-32.png"
logo="prive/themes/spip/images/modele-xx.svg"
documentation="https://contrib.spip.net/?article3631"
>

BIN
prive/themes/spip/images/modele-16.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

BIN
prive/themes/spip/images/modele-24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

BIN
prive/themes/spip/images/modele-32.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

BIN
prive/themes/spip/images/modele-add-16.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

BIN
prive/themes/spip/images/modele-add-24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

1
prive/themes/spip/images/modele-add-24.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path fill="#fff" d="M6 9h52v46H6z"/><path fill="#1d83d4" d="M22 22h20v20H22z"/><path fill="#fff" d="M28 28h8v8h-8z"/><path fill="#888" d="m50 16.878-4.242 4.243-2.829-2.828 4.243-4.243zM16.828 13.95l4.243 4.242-2.828 2.829L14 16.778zM14 47.222l4.242-4.243 2.829 2.828-4.243 4.243zM45.757 42.979 50 47.22l-2.828 2.829-4.243-4.243z"/><path fill="#666" d="M58.3 5.8c1.6 0 2.9 1.3 2.9 2.9v46.7c0 1.6-1.3 2.9-2.9 2.9H5.8c-1.6 0-2.9-1.3-2.9-2.9V8.7c0-1.6 1.3-2.9 2.9-2.9h52.5zm-3 5.8H8.7v40.8h46.7V11.6z"/><g transform="matrix(.5 0 0 .5 32 0)"><circle style="fill:#4caf50" cx="32" cy="32" r="32"/><path style="fill:#fff" d="M54.748 26.293c-.632-.633-1.4-.949-2.304-.949H38.352V11.252c0-.903-.316-1.671-.949-2.304C36.771 8.316 36.003 8 35.1 8h-6.503c-.903 0-1.671.316-2.303.948-.633.633-.949 1.4-.949 2.304v14.092H11.252a3.14 3.14 0 0 0-2.304.949c-.632.632-.948 1.4-.948 2.303v6.505c0 .903.316 1.67.948 2.303.633.632 1.4.948 2.304.948h14.092v14.093c0 .903.316 1.672.948 2.304.633.632 1.4.948 2.304.948H35.1c.904 0 1.671-.316 2.304-.948.632-.633.948-1.4.948-2.304V38.352h14.092c.904 0 1.672-.316 2.304-.948.632-.632.948-1.4.948-2.303v-6.505c0-.903-.315-1.671-.948-2.303z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
prive/themes/spip/images/modele-add-32.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

11
prive/themes/spip/images/modele-xx.svg

@ -1,10 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
<path fill="#fff" d="M6 9h52v46H6z"/>
<path fill="#1d83d4" d="M22 22h20v20H22z" />
<path fill="#fff" d="M28 28h8v8h-8z" />
<path fill="#888" transform="rotate(135 46.46472156 17.5355308)" d="M43.5 15.5h6v4h-6z"/>
<path fill="#888" transform="rotate(45 17.53585718 17.53535205)" d="M14.5 15.5h6v4h-6z"/>
<path fill="#888" transform="rotate(-45 17.53505362 46.46488079)" d="M14.5 44.5h6v4h-6z"/>
<path fill="#888" transform="rotate(45 46.46522921 46.46419794)" d="M43.5 44.5h6v4h-6z"/>
<path fill="#666" d="M58.3 5.8c1.6 0 2.9 1.3 2.9 2.9v46.7c0 1.6-1.3 2.9-2.9 2.9H5.8c-1.6 0-2.9-1.3-2.9-2.9V8.7c0-1.6 1.3-2.9 2.9-2.9h52.5zm-3 5.8H8.7v40.8h46.7V11.6z"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><path fill="#fff" d="M6 9h52v46H6z"/><path fill="#1d83d4" d="M22 22h20v20H22z"/><path fill="#fff" d="M28 28h8v8h-8z"/><path fill="#888" d="m50 16.878-4.242 4.243-2.829-2.828 4.243-4.243zM16.828 13.95l4.243 4.242-2.828 2.829L14 16.778zM14 47.222l4.242-4.243 2.829 2.828-4.243 4.243zM45.757 42.979 50 47.22l-2.828 2.829-4.243-4.243z"/><path fill="#666" d="M58.3 5.8c1.6 0 2.9 1.3 2.9 2.9v46.7c0 1.6-1.3 2.9-2.9 2.9H5.8c-1.6 0-2.9-1.3-2.9-2.9V8.7c0-1.6 1.3-2.9 2.9-2.9h52.5zm-3 5.8H8.7v40.8h46.7V11.6z"/></svg>

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 570 B

Loading…
Cancel
Save