aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 20:45:47 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-27 20:45:47 +0000
commit4abf61c5a7447f1f7ad16eb3decee1969396fd58 (patch)
tree031eed2da4cab80f84d3e23e71bdfce74483b80f
parent66aabc4b86670c0ef9599e0c21287c5503165d22 (diff)
downloadelgg-4abf61c5a7447f1f7ad16eb3decee1969396fd58.tar.gz
elgg-4abf61c5a7447f1f7ad16eb3decee1969396fd58.tar.bz2
removed early version of admin context menu and fixed missing edit profile button
git-svn-id: http://code.elgg.org/elgg/trunk@7728 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/users.php33
-rw-r--r--views/default/navigation/menu/user_admin.php30
2 files changed, 1 insertions, 62 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index a87b241a2..6fe400f62 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1509,7 +1509,7 @@ function elgg_user_hover_menu($hook, $type, $return, $params) {
// prevent admins from banning or deleting themselves
if (get_loggedin_userid() == $user->guid) {
- return;
+ return $return;
}
if (isadminloggedin()) {
@@ -1545,36 +1545,6 @@ function elgg_user_hover_menu($hook, $type, $return, $params) {
}
/**
- * Setup the user admin menu
- */
-function elgg_user_admin_menu($hook, $type, $return, $params) {
- $user = $params['user'];
-
- $actions = array();
- if (!$user->isBanned()) {
- $actions[] = 'ban';
- } else {
- $actions[] = 'unban';
- }
- $actions[] = 'delete';
- $actions[] = 'resetpassword';
- if (!$user->isAdmin()) {
- $actions[] = 'makeadmin';
- } else {
- $actions[] = 'removeadmin';
- }
-
- foreach ($actions as $action) {
- $url = "action/admin/user/$action?guid={$user->guid}";
- $url = elgg_add_action_tokens_to_url($url);
- $item = new ElggMenuItem($action, elgg_echo($action), $url);
- $return[] = $item;
- }
-
- return $return;
-}
-
-/**
* This function loads a set of default fields into the profile, then triggers a hook letting other plugins to edit
* add and delete fields.
*
@@ -1754,7 +1724,6 @@ function users_init() {
}
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elgg_user_hover_menu');
- elgg_register_plugin_hook_handler('register', 'menu:user_admin', 'elgg_user_admin_menu');
elgg_register_action("register", '', 'public');
elgg_register_action("useradd", '', 'public');
diff --git a/views/default/navigation/menu/user_admin.php b/views/default/navigation/menu/user_admin.php
deleted file mode 100644
index c88142876..000000000
--- a/views/default/navigation/menu/user_admin.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
- * User admin menu
- *
- * @todo css/html clean up needed as this was pulled from early 1.8 profile code
- *
- * @uses vars['menu']
- * @uses vars['toggle']
- */
-
-$toggle = elgg_get_array_value('toggle', $vars, false);
-
-$id = '';
-
-if ($toggle) {
- echo '<ul class="admin_menu">';
- echo '<li><a class="elgg-toggle" id="elgg-toggler-admin-menu">Admin options&hellip;</a>';
- $id = 'id="elgg-togglee-admin-menu"';
-}
-foreach ($vars['menu'] as $section => $menu_items) {
- echo "<ul class=\"admin_menu_options\" $id>";
- foreach ($menu_items as $menu_item) {
- echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item));
- }
- echo '</ul>';
-}
-if ($toggle) {
- echo '</li>';
- echo '</ul>';
-} \ No newline at end of file