1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
<table class="default">
<caption>
<span class="actions" style="font-size: 0.9em;">
<?= _('Ihre Punkte:') ?>
<strong><?= number_format($this->current_user_score, 0, ',', '.') ?></strong>
<div class="hidden-small-down">(<?= Score::getTitel($this->current_user_score, $this->current_user->geschlecht) ?>)</div>
</span>
<?= _('Stud.IP-Rangliste')?>
</caption>
<colgroup>
<col width="3%">
<col width="1%">
<col width="50%">
<col class="hidden-small-down" width="15%">
<col width="15%">
<col class="hidden-small-down" width="15%">
<col class="hidden-small-down" width="1%">
</colgroup>
<thead>
<tr>
<th><div class="hidden-small-down"><?= _('Platz') ?></div></th>
<th></th>
<th><?= _('Name') ?></th>
<th class="hidden-small-down"></th>
<th><?= _('Punkte') ?></th>
<th class="hidden-small-down"><?= _('Titel') ?></th>
<th class="hidden-small-down"></th>
</tr>
</thead>
<tbody>
<? foreach ($persons as $index => $person): ?>
<tr>
<td style="text-align: right;">
<?= $offset + $index + 1 ?>.
</td>
<td>
<?= Avatar::getAvatar($person['user_id'], $person['username'])
->getImageTag(Avatar::SMALL, ['title' => $person['fullname']])
?>
</td>
<td>
<a href="<?= URLHelper::getLink('dispatch.php/profile?username='. $person['username']) ?>">
<?= htmlReady($person['fullname']) ?>
</a>
<? foreach ($person['is_king'] as $type => $text): ?>
<?= Icon::create('crown', Icon::ROLE_SORT, ['title' => $text])->asImg(16, ["alt" => $text, "class" => 'text-top']) ?>
<? endforeach ?>
</td>
<td class="hidden-small-down">
<?
$content = Assets::img('blank.gif', ['width' => 16]) . ' ';
// News
if ($news = ($person['newscount'] ?? false)) {
$tmp = sprintf(ngettext('Eine persönliche Ankündigung', '%s persönliche Ankündigungen', $news), $news);
$content .= sprintf(
'<a href="%s">%s</a> ',
URLHelper::getLink('dispatch.php/profile?username=' . $person['username']),
Icon::create('news', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asImg()
);
} else {
$content .= Assets::img('blank.gif', ['width' => 16]) . ' ';
}
// Votes
if ($vote = ($person['votecount'] ?? false)) {
$tmp = sprintf(ngettext('Eine Umfrage', '%s Umfragen', $vote), $vote);
$content .= sprintf(
'<a href="%s">%s</a> ',
URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#questionnaire_area'),
Icon::create('vote', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asImg()
);
} else {
$content .= Assets::img('blank.gif', ['width' => 16]) . ' ';
}
// Termine
if ($termin = ($person['eventcount'] ?? false)) {
$tmp = sprintf(ngettext('Ein Termin', '%s Termine', $termin), $termin);
$content .= sprintf(
'<a href="%s">%s</a> ',
URLHelper::getLink('dispatch.php/profile?username=' . $person['username'] . '#a'),
Icon::create('schedule', Icon::ROLE_CLICKABLE, ['title' => $tmp])->asImg()
);
} else {
$content .= Assets::img('blank.gif', ['width' => 16]) . ' ';
}
$content .= Assets::img('blank.gif', ['width' => 16]) . ' ';
echo $content;
?>
</td>
<td><?= number_format($person['score'], 0, ',', '.') ?></td>
<td class="hidden-small-down" ><?= Score::getTitel($person['score'], $person['geschlecht']) ?></td>
<td class="hidden-small-down" style="text-align: right">
<? if($person['user_id'] == $GLOBALS['user']->id): ?>
<a href="<?= $controller->url_for('score/unpublish') ?>">
<?= Icon::create('trash', Icon::ROLE_CLICKABLE, ['title' => _('Ihren Wert von der Liste löschen')])
->asImg(16, ["class" => 'text-top'])
?>
</a>
<? endif; ?>
</td>
</tr>
<? endforeach ?>
</tbody>
<? if (ceil($numberOfPersons / $max_per_page) > 1): ?>
<tfoot>
<tr>
<td colspan="7" style="text-align: right">
<?= $GLOBALS['template_factory']->render('shared/pagechooser',
[
'perPage' => $max_per_page,
'num_postings' => $numberOfPersons,
'page' => $page,
'pagelink' => 'dispatch.php/score/%u'
]
) ?>
</td>
</tr>
</tfoot>
<? endif ?>
</table>
|