From: Florent Bruneau Date: Fri, 1 Oct 2010 12:06:10 +0000 (+0200) Subject: Smarty's {profile} function now prints the category instead of the promo. X-Git-Tag: xorg/1.0.1~122 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=31fd9b4663a6575af1219d2550ad3cf51182c0a5;p=platal.git Smarty's {profile} function now prints the category instead of the promo. For users with a promotion this does not change anything, for others this adds useful information. Example: DUCHMOL Thierry (Secrétariat de l'AX) BRUNEAU Florent (X2003) DURET Brigitte (Personnel de l'X) Signed-off-by: Florent Bruneau --- diff --git a/plugins/function.profile.php b/plugins/function.profile.php index 77909bd..f3a7fb1 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -22,7 +22,7 @@ function smarty_function_profile($params, &$smarty) { $params = new PlDict($params); - $with_promo = $params->b('promo', false); + $with_promo = $params->b('promo', false) || $params->b('cat', false); $with_sex = $params->b('sex', true); $with_link = $params->b('link', true); $with_groupperms = $params->b('groupperms', true); @@ -36,7 +36,7 @@ function smarty_function_profile($params, &$smarty) $name = '•' . $name; } if ($with_promo) { - $promo = $user->promo(); + $promo = $user->category(); if ($promo) { $name .= ' (' . pl_entities($promo) . ')'; }