projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Administrators can easily switch between skins (without affecting their
[platal.git]
/
plugins
/
function.profile.php
diff --git
a/plugins/function.profile.php
b/plugins/function.profile.php
index
53f2a5d
..
3a05b61
100644
(file)
--- a/
plugins/function.profile.php
+++ b/
plugins/function.profile.php
@@
-22,21
+22,26
@@
function smarty_function_profile($params, &$smarty)
{
$params = new PlDict($params);
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_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');
$with_groupperms = $params->b('groupperms', true);
$user = $params->v('user');
- if (ctype_digit($user)) {
+ if (
is_int($user) ||
ctype_digit($user)) {
$user = User::getWithUID($user);
}
$user = User::getWithUID($user);
}
- $name = pl_entities($user->fullName());
+ if ($with_dir) {
+ $name = pl_entities($user->directoryName());
+ } else {
+ $name = pl_entities($user->fullName());
+ }
if ($with_sex && $user->isFemale()) {
$name = '•' . $name;
}
if ($with_promo) {
if ($with_sex && $user->isFemale()) {
$name = '•' . $name;
}
if ($with_promo) {
- $promo = $user->
promo
();
+ $promo = $user->
category
();
if ($promo) {
$name .= ' (' . pl_entities($promo) . ')';
}
if ($promo) {
$name .= ' (' . pl_entities($promo) . ')';
}
@@
-47,7
+52,10
@@
function smarty_function_profile($params, &$smarty)
$name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
}
}
$name = '<a href="profile/' . $profile->hrid() . '" class="popup2">' . $name . '</a>';
}
}
- if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin') {
+ if ($user->lost) {
+ $name .= ' <a href="https://www.polytechnique.org/marketing/broken/' . $user->hruid . '"><img src="images/icons/error.gif" alt="Patte cassée" /></a>';
+ }
+ if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) {
$name = '<strong>' . $name . '</strong>';
}
return $name;
$name = '<strong>' . $name . '</strong>';
}
return $name;