user_over.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. $user = $vars['entity'];
  3. $actions = elgg_extract('action', $vars['menu'], null);
  4. $main = elgg_extract('default', $vars['menu'], null);
  5. $admin = elgg_extract('admin', $vars['menu'], null);
  6. echo '<ul class="elgg-menu elgg-menu-hover">';
  7. // name and username
  8. $name_link = elgg_view('output/url', array(
  9. 'href' => $user->getURL(),
  10. 'text' => "<span class=\"elgg-heading-basic\">$user->name</span>&#64;$user->username",
  11. 'is_trusted' => true,
  12. ));
  13. echo "<li>$name_link</li>";
  14. // actions
  15. if (elgg_is_logged_in() && $actions) {
  16. echo '<li>';
  17. echo elgg_view('navigation/menu/elements/section', array(
  18. 'class' => "elgg-menu elgg-menu-hover-actions",
  19. 'items' => $actions,
  20. ));
  21. echo '</li>';
  22. }
  23. // main
  24. if ($main) {
  25. echo '<li>';
  26. echo elgg_view('navigation/menu/elements/section', array(
  27. 'class' => 'elgg-menu elgg-menu-hover-default',
  28. 'items' => $main,
  29. ));
  30. echo '</li>';
  31. }
  32. // admin
  33. if (elgg_is_admin_logged_in() && $admin) {
  34. echo '<li>';
  35. echo elgg_view('navigation/menu/elements/section', array(
  36. 'class' => 'elgg-menu elgg-menu-hover-admin',
  37. 'items' => $admin,
  38. ));
  39. echo '</li>';
  40. }
  41. echo '</ul>';