mise au carré des remplacements @@ des slugs
This commit is contained in:
parent
a2ec61032f
commit
dbf1f5388f
5 changed files with 12 additions and 2 deletions
|
@ -122,6 +122,7 @@
|
|||
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{Tid_doc}}
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<h2><:gamumail:fichiers_annexes:></h2>
|
||||
<INCLURE{fond=gamumail/#GET{fichier},env,options=#ENV{options}}>
|
||||
]
|
||||
|
||||
|
|
|
@ -311,6 +311,11 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
'args' => $args,
|
||||
'data' => $html
|
||||
));
|
||||
|
||||
// traitement des remplacements génériques fournis par Gamumail
|
||||
$remplacement_generiques = charger_fonction('gamumail_remplacements', 'inc');
|
||||
$html = $remplacement_generiques($args, $html);
|
||||
|
||||
$texte = facteur_mail_html2text($html);
|
||||
$corps = [
|
||||
'html' => $html,
|
||||
|
|
|
@ -29,6 +29,7 @@ function crayons_determine_input_mode_type_gamumail($type, $champ, $sqltype) {
|
|||
**/
|
||||
$GLOBALS['remplacements_gamumail'] = [
|
||||
'@@nom@@' => _T('gamumail:nom'),
|
||||
'@@prenom@@' => _T('gamumail:prenom_sinon_nom'),
|
||||
'@@url_site@@' => _T('gamumail:url_site'),
|
||||
'@@url_raz_passe@@' => _T('gamumail:url_raz_passe'),
|
||||
];
|
||||
|
|
|
@ -13,11 +13,11 @@ if (!defined('_ECRIRE_INC_VERSION')) {
|
|||
*
|
||||
**/
|
||||
function inc_gamumail_remplacements_dist($args, $html) {
|
||||
|
||||
/**
|
||||
* @@nom@@ => Prenom Nom | Nom (gère la présence/absence du champ prenom dans spip_auteurs)
|
||||
**/
|
||||
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]));
|
||||
$prenom = $nom;
|
||||
$trouver_table = charger_fonction('trouver_table', 'base');
|
||||
$desc = $trouver_table('spip_auteurs');
|
||||
if (array_key_exists('prenom', $desc['field'])
|
||||
|
@ -25,6 +25,7 @@ function inc_gamumail_remplacements_dist($args, $html) {
|
|||
$nom = $prenom.' '.$nom;
|
||||
}
|
||||
$html = gamumail_remplacer_modele('nom', ucwords($nom), $html);
|
||||
$html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html);
|
||||
|
||||
/**
|
||||
* @@url_site@@ => URL du site
|
||||
|
|
|
@ -37,7 +37,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
|
|||
'explication_mail_auto_uniquement' => 'permet de ne pas afficher les modèles utilisés uniquement en envoi automatique',
|
||||
|
||||
// F
|
||||
'pdf_envoyes' => 'Fichiers PDF envoyés',
|
||||
'fichiers_annexes' => 'Fichiers annexes',
|
||||
|
||||
// I
|
||||
'icone_creer_gamumail' => 'Créer un gamumail',
|
||||
|
@ -71,6 +71,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
|
|||
// P
|
||||
'pas_de_slug' => 'Pas de slug avec cet identifiant',
|
||||
'plusieurs_mails_separer_virgule' => 'Si plusieurs emails, les séparer par une virgule.',
|
||||
'pdf_envoyes' => 'Fichiers PDF générés',
|
||||
'prenom_sinon_nom' => 'Prénom du destinataire (ou Nom si pas de champ "prenom")',
|
||||
|
||||
// R
|
||||
'retirer_lien_gamumail' => 'Retirer ce gamumail',
|
||||
|
|
Loading…
Add table
Reference in a new issue