Intégration de la lib https://github.com/commerceguys/intl + fonctions SPIP facilitatrices autour.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
3.8 KiB
82 lines
3.8 KiB
2 years ago
|
<div class="formulaire_spip formulaire_configurer formulaire_#FORM">
|
||
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||
|
|
||
|
<form method="post" action="#ENV{action}"><div>
|
||
|
#ACTION_FORMULAIRE
|
||
|
|
||
|
[(#REM) Message si extensions php absentes ]
|
||
|
#SET{bcmath,#VAL{bcmath}|extension_loaded}
|
||
|
#SET{intl,#VAL{intl}|extension_loaded}
|
||
|
#SET{ext,#LISTE{bcmath,intl}|join{", "}}
|
||
|
[(#GET{bcmath}|non|et{#GET{intl}|non}|oui)
|
||
|
<p class="notice">
|
||
|
<:intl:cfg_message_extensions_php_ou{ext=#GET{ext}}:>
|
||
|
</p>
|
||
|
]
|
||
|
|
||
|
<div class="editer-groupe">
|
||
|
[(#REM) Devise principale ]
|
||
|
#SET{name,devise_defaut}
|
||
|
#SET{erreurs,#ENV**{erreurs/#GET{name}}}
|
||
|
#SET{defaut,#REM|intl_devise_defaut}
|
||
|
#SET{valeur,#ENV**{#GET{name}}|sinon{#GET{defaut}}}
|
||
|
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||
|
<label for="champ_#GET{name}"><:intl:cfg_devise_label:></label>
|
||
|
[<span class='erreur_message'>(#GET{erreurs})</span>]
|
||
|
<select class="select select2 chosen" name="#GET{name}" id="champ_#GET{name}">
|
||
|
<option value=""[ (#GET{valeur}|non)selected="selected"]><:intl:cfg_choisir_option:></option>
|
||
|
<BOUCLE_devises(DATA) {source table, #REM|intl_lister_devises}>
|
||
|
<option value="#CLE"[ (#CLE|=={#GET{valeur}}|oui)selected="selected"]>#CODE - #NOM</option>
|
||
|
</BOUCLE_devises>
|
||
|
</select>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<fieldset>
|
||
|
<legend class="legend"><:intl:cfg_locales_legend:></legend>
|
||
|
|
||
|
<p class="explication"><:intl:cfg_locales_explication:></p>
|
||
|
|
||
|
<div class="editer-groupe">
|
||
|
[(#REM)
|
||
|
Choisir la locale pour chaque langue de spip utilisée sur le site.
|
||
|
On obtient un tableau associatif dans la clé 'locales' : code langue de spip => locale
|
||
|
S'il y a plusieurs déclinaisons régionales, on met un select pour choisir laquelle.
|
||
|
Sinon on indique qu'il n'y en a pas.
|
||
|
]
|
||
|
#SET{langues_spip,#LISTE{#CONFIG{langue_site}}|array_merge{#CONFIG{langues_multilingue}|explode{","}}|array_unique|array_filter}
|
||
|
#SET{langues_intl,#REM|intl_lister_langues}
|
||
|
<BOUCLE_langues_spip(DATA) {source table, #GET{langues_spip}}>
|
||
|
#SET{name,locales\[#VALEUR\]}
|
||
|
#SET{erreurs,#ENV**{erreurs/#GET{name}}}
|
||
|
#SET{locale,#VALEUR|intl_langue_vers_locale}
|
||
|
#SET{valeur,#ENV**{locales/#VALEUR}|sinon{#GET{locale}}}
|
||
|
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||
|
<label for="champ_#GET{name}">[(#VALEUR|traduire_nom_langue)]</label>
|
||
|
[<span class='erreur_message'>(#GET{erreurs})</span>]
|
||
|
[(#REM) S'il y a des déclinaisons régionales pour la langue, un select ]
|
||
|
#SET{locales_langue,#ARRAY}
|
||
|
<BOUCLE_set_locales(DATA) {source table, #GET{langues_intl}} {cle == ^#GET{locale}} {par cle}>
|
||
|
#SET{locales_langue,#GET{locales_langue}|array_merge{#ARRAY{#CLE,#VALEUR}}}
|
||
|
</BOUCLE_set_locales>
|
||
|
<B_locales>
|
||
|
<select class="select select2 chosen" name="#GET{name}" id="champ_#GET{name}">
|
||
|
<BOUCLE_locales(DATA) {source table, #GET{locales_langue}} {si #GET{locales_langue}|count|>{1}}>
|
||
|
<option value="[(#CLE|attribut_html)]"[ (#CLE|=={#GET{valeur}}|oui)selected="selected"]>#VALEUR</option>
|
||
|
</BOUCLE_locales>
|
||
|
</select>
|
||
|
</B_locales>
|
||
|
[(#REM) S'il n'y a aucune option régionale, un input ]
|
||
|
<p class="explication"><:intl:cfg_locale_non:></p>
|
||
|
<input class="text" name="#GET{name}" id="champ_#GET{name}" readonly="readonly" value="[(#GET{langues_intl/#GET{locale}}|sinon{#GET{locale}}|attribut_html)]" />
|
||
|
<//B_locales>
|
||
|
</div>
|
||
|
</BOUCLE_langues_spip>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
|
||
|
<p class="boutons"><span class="image_loading"> </span><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p>
|
||
|
</div></form>
|
||
|
</div>
|