Only display name when using name in moderation email.
authorStéphane Jacob <sj@m4x.org>
Wed, 31 Aug 2011 10:59:00 +0000 (12:59 +0200)
committerStéphane Jacob <sj@m4x.org>
Wed, 31 Aug 2011 10:59:00 +0000 (12:59 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
plugins/function.profile.php
templates/lists/moderate_mail.tpl

index 516f019..fe40261 100644 (file)
@@ -27,6 +27,7 @@ function smarty_function_profile($params, $smarty)
     $with_link  = $params->b('link', true);
     $with_dir   = $params->b('directory', true);
     $with_groupperms = $params->b('groupperms', true);
+    $raw = $params->b('raw', true);
     $user = $params->v('user');
     if (is_int($user) || ctype_digit($user)) {
         $user = User::getWithUID($user);
@@ -37,15 +38,19 @@ function smarty_function_profile($params, $smarty)
     } else {
         $name = pl_entities($user->fullName());
     }
-    if ($with_sex && $user->isFemale()) {
-        $name = '&bull;' . $name;
-    }
     if ($with_promo) {
         $promo = $user->category();
         if ($promo) {
             $name .= ' (' . pl_entities($promo) . ')';
         }
     }
+    if ($raw) {
+        return $name;
+    }
+
+    if ($with_sex && $user->isFemale()) {
+        $name = '&bull;' . $name;
+    }
     if ($with_link) {
         $profile = ($user instanceof Profile) ? $user : $user->profile();
         if ($profile) {
index 94ef8cf..8b8eeae 100644 (file)
@@ -35,7 +35,7 @@
       <td>raison (pour les refus)&nbsp;:
         <textarea cols='50' rows='10' name='reason' id='raison'>
 -- 
-{profile user=$smarty.session.user promo=true directory=false link=false sex=false}
+{profile user=$smarty.session.user promo=true directory=false link=false sex=false raw=true}
 </textarea>
       </td>
     </tr>