From 5eb93a079b5e451f330a1fb5df926b0b75710f68 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 22 Jul 2015 14:09:55 -0700 Subject: [PATCH] Admin-UI: Fixed styling of dropdown actions in admin->users. --- e107_admin/users.php | 160 +++++++++++++++++---- e107_languages/English/admin/lan_users.php | 4 +- 2 files changed, 135 insertions(+), 29 deletions(-) diff --git a/e107_admin/users.php b/e107_admin/users.php index 1efaf8cc8..95919cdcb 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -81,6 +81,33 @@ class users_admin extends e_admin_dispatcher } + $JS = <<'); // + + $(".user-action").click(function(e){ + // e.stopPropagation(); + + var action = $(this).attr('data-action-type'); + var user = $(this).attr('data-action-user'); + + // $('#user-action-indicator-'+user).html(''); // + + $('.user-action-hidden').val(''); // clear all, incase of back-button or auto-fill. + $('#user-action-'+ user).val(action); + $('#core-user-list-form').submit(); + + + }); +JS; + + e107::js('footer-inline', $JS); + e107::css('inline', ' + .user-action { cursor: pointer } + .btn-user-action { margin-right:15px} + + '); + } /** @@ -2443,80 +2470,159 @@ class users_admin_form_ui extends e_admin_form_ui extract($row); + + $user_id = $row['user_id']; + $user_ip = $row['user_ip']; + $user_admin = $row['user_admin']; + $text = ""; $head = "
- + "; + + //
"; + // $foot = ""; + // $foot = ""; + $btn = '
+ + +
'; + + if(!empty($opts)) + { + return $head.$btn; + } + else + { + return ''; + } - return ($text) ? $head.$text.$foot : ""; + // return ($text) ? $head.$text.$foot . $btn : ""; } diff --git a/e107_languages/English/admin/lan_users.php b/e107_languages/English/admin/lan_users.php index 479a65814..2364a8b94 100644 --- a/e107_languages/English/admin/lan_users.php +++ b/e107_languages/English/admin/lan_users.php @@ -294,8 +294,8 @@ define("USFLAN_6", "User ID"); define("USFLAN_7", "User Information"); -define("USRLAN_AS_1", "Login as %s"); //FIXME use [x] -define("USRLAN_AS_2", "Logout from %s account"); +define("USRLAN_AS_1", "Login as [x]"); +define("USRLAN_AS_2", "Logout from [x] account"); define("USRLAN_AS_3", "You are already logged in as another user account. Please logout first."); // Always search lan_admin.php before adding more.