X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=3a05b6148aa7e882489673bc409e19f3c0f7825e;hb=2fad6caaf37741a07697101d4776f6976e998756;hp=77909bdbb5dedc9d52ea83c853ad096ae98cb444;hpb=ba879af870d71163785c12ae4f4e7a070c6e614e;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index 77909bd..3a05b61 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -22,21 +22,26 @@ 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_dir = $params->b('directory', true); $with_groupperms = $params->b('groupperms', true); $user = $params->v('user'); if (is_int($user) || ctype_digit($user)) { $user = User::getWithUID($user); } - $name = pl_entities($user->directoryName()); + if ($with_dir) { + $name = pl_entities($user->directoryName()); + } else { + $name = pl_entities($user->fullName()); + } if ($with_sex && $user->isFemale()) { $name = '•' . $name; } if ($with_promo) { - $promo = $user->promo(); + $promo = $user->category(); if ($promo) { $name .= ' (' . pl_entities($promo) . ')'; }