From 0fbd1f3fa5fb9b11ff6d3bd65d437374b9d8e6b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 24 Jun 2010 15:58:56 +0200 Subject: [PATCH] Improves email combobox. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/email.php | 5 ++++- templates/emails/redirect.tpl | 1 + templates/include/emails.combobox.tpl | 7 +++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/email.php b/modules/email.php index 41e5d25..8994590 100644 --- a/modules/email.php +++ b/modules/email.php @@ -249,15 +249,18 @@ class EmailModule extends PLModule $actifs = Env::v('emails_actifs', Array()); print_r(Env::v('emails_rewrite')); if (Env::v('emailop') == "ajouter" && Env::has('email')) { + $error_email = false; $new_email = Env::v('email'); if ($new_email == "new@example.org") { $new_email = Env::v('email_new'); } $result = $redirect->add_email($new_email); if ($result == ERROR_INVALID_EMAIL) { + $error_email = true; $page->assign('email', $new_email); } $page->assign('retour', $result); + $page->assign('error_email', $error_email); } elseif (empty($actifs)) { $result = ERROR_INACTIVE_REDIRECTION; } elseif (is_array($actifs)) { @@ -271,7 +274,7 @@ class EmailModule extends PLModule . $user->forlifeEmail() . ' ne fonctionnerait plus.'); break; case ERROR_INVALID_EMAIL: - $page->trigError('Erreur: l\'email n\'est pas valide.'); + $page->trigError('Erreur : l\'email n\'est pas valide.'); break; case ERROR_LOOP_EMAIL: $page->trigError('Erreur : ' . $user->forlifeEmail() diff --git a/templates/emails/redirect.tpl b/templates/emails/redirect.tpl index 712e7e8..a56e173 100644 --- a/templates/emails/redirect.tpl +++ b/templates/emails/redirect.tpl @@ -179,6 +179,7 @@ {/foreach} {cycle values="pair,impair" assign=class_combobox} + {$error_email} {include file="include/emails.combobox.tpl" name="email" val=$email class=$class_combobox error=$error_email i="0"}
diff --git a/templates/include/emails.combobox.tpl b/templates/include/emails.combobox.tpl index bc006a0..31a6b15 100644 --- a/templates/include/emails.combobox.tpl +++ b/templates/include/emails.combobox.tpl @@ -25,7 +25,7 @@ {if $name eq "email_directory"} - Email annuaire AX + Email annuaire AX {elseif $name eq "email"} Ajouter une adresse email {else} @@ -78,9 +78,8 @@ {/if} - - + + {if $name neq "email"} -- 2.1.4