aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation/menu
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 02:14:56 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 02:14:56 +0000
commit543e50d2aabfbd3c116cbb670018c66fae535955 (patch)
treed84b51988a755c03f8794e3c11cf38b78015ea65 /views/default/navigation/menu
parent07a1585f3eee1211aeaf55ea436135f637520102 (diff)
downloadelgg-543e50d2aabfbd3c116cbb670018c66fae535955.tar.gz
elgg-543e50d2aabfbd3c116cbb670018c66fae535955.tar.bz2
moved most of the code for the user hover menu into the new menu system
git-svn-id: http://code.elgg.org/elgg/trunk@7723 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/navigation/menu')
-rw-r--r--views/default/navigation/menu/user_hover.php50
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>&#64;$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>';