Commits

Jason Green  committed 4dfa7ba

Adding links to users from leaderboard

  • Participants
  • Parent commits e0183f4
  • Branches ui0.8

Comments (0)

Files changed (1)

File app/protected/modules/gamification/views/LeaderboardView.php

                 assert('is_string($leaderboardData["userLabel"])');
                 assert('is_int($leaderboardData["points"])');
 
+                $userUrl  = Yii::app()->createUrl('/users/default/profile', array('id' => $userId));
                 $user        = User::getById($userId);
                 $avatarImage = $user->getAvatarImage(24);
 
                 $content .= '<tr>';
                 $content .= '<td><span class="ranking">' . $leaderboardData['rank'] . '</span></td>';
-                $content .= '<td class="user-label">' . $avatarImage . '<span>' . $leaderboardData['userLabel'] . '</span></td>';
+                $content .= '<td class="user-label">' .
+                            ZurmoHtml::link($avatarImage . '<span>' . $leaderboardData['userLabel'], $userUrl) .
+                            '</span></td>';
                 $content .= '<td><span class="points">' . $leaderboardData['points'] . '</span></td>';
                 $content .= '</tr>';
             }