X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Ffunction.profile.php;h=be02e7b88c21e529f17987a1630ce0f58b302155;hb=c12cc82e1d97b51e19b294942ea9450a34d929cd;hp=d686b1ce1b2b972c6d014b322130e60b18ae176b;hpb=45dcd6dd4d35789f657ffb1e983de67897499b64;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index d686b1c..be02e7b 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -21,11 +21,15 @@ function smarty_function_profile($params, &$smarty) { - $with_promo = isset($params['with_promo']) ? $params['with_promo'] : false; - $with_sex = isset($params['with_sex']) ? $params['with_sex'] : true; - $with_link = isset($params['with_link']) ? $params['with_link'] : true; - $with_groupperms = isset($params['with_groupperms']) ? $params['with_groupperms'] : true; - $user = $params['user']; + $params = new PlDict($params); + $with_promo = $params->b('promo', false); + $with_sex = $params->b('sex', true); + $with_link = $params->b('link', true); + $with_groupperms = $params->b('groupperms', true); + $user = $params->v('user'); + if (ctype_digit($user)) { + $user = User::getWithUID($user); + } $name = pl_entities($user->fullName()); if ($with_sex && $user->isFemale()) {