diff options
Diffstat (limited to 'views/default/navigation')
-rw-r--r-- | views/default/navigation/menu/user_hover.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php new file mode 100644 index 000000000..e8c5d0cbc --- /dev/null +++ b/views/default/navigation/menu/user_hover.php @@ -0,0 +1,50 @@ +<?php +/** + * User hover menu + * + * Register for the 'register', 'menu:user_hover' plugin hook to add to the user + * hover menu. There are three sections: action, default, and admin. + */ + +$user = $vars['entity']; +$actions = elgg_get_array_value('action', $vars['menu'], null); +$main = elgg_get_array_value('default', $vars['menu'], null); +$admin = elgg_get_array_value('admin', $vars['menu'], null); + +echo '<ul class="elgg-menu elgg-hover-menu">'; + +// name and username +$name_link = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => "<h3>$user->name</h3>@$user->username", +)); +echo "<li>$name_link</li>"; + +// actions +if (isloggedin() && $actions) { + echo '<li><ul>'; + foreach ($actions as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); + } + echo '</ul></li>'; +} + +// main +if ($main) { + echo '<li><ul>'; + foreach ($main as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); + } + echo '</ul></li>'; +} + +// admin +if (isadminloggedin() && $admin) { + echo '<li><ul class="elgg-hover-admin">'; + foreach ($admin as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); + } + echo '</ul></li>'; +} + +echo '</ul>'; |