summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BMO/web/js')
-rw-r--r--extensions/BMO/web/js/edituser_menu.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/extensions/BMO/web/js/edituser_menu.js b/extensions/BMO/web/js/edituser_menu.js
index 0b6fed5f8..f9f20d959 100644
--- a/extensions/BMO/web/js/edituser_menu.js
+++ b/extensions/BMO/web/js/edituser_menu.js
@@ -3,23 +3,27 @@ var admin_usermenu;
YAHOO.util.Event.onDOMReady(function() {
admin_usermenu = new YAHOO.widget.Menu('admin_usermenu', { position : 'dynamic' });
admin_usermenu.addItems([
- { text: 'Edit', url: '#', target: '_blank' },
{ text: 'Activity', url: '#', target: '_blank' },
- { text: 'Mail', url: '#', target: '_blank' }
+ { text: 'Mail', url: '#', target: '_blank' },
+ { text: 'Edit', url: '#', target: '_blank' }
]);
admin_usermenu.render(document.body);
});
-function show_admin_usermenu(event, id, email) {
+function show_admin_usermenu(event, id, email, show_edit) {
if (!admin_usermenu)
return;
- admin_usermenu.getItem(0).cfg.setProperty('url', 'editusers.cgi?action=edit&userid=' + id);
- admin_usermenu.getItem(1).cfg.setProperty('url',
+ admin_usermenu.getItem(0).cfg.setProperty('url',
'page.cgi?id=user_activity.html&action=run' +
'&from=' + YAHOO.util.Date.format(new Date(new Date() - (1000 * 60 * 60 * 24 * 14)), {format: '%Y-%m-%d'}) +
'&to=' + YAHOO.util.Date.format(new Date(), {format: '%Y-%m-%d'}) +
'&who=' + encodeURIComponent(email));
- admin_usermenu.getItem(2).cfg.setProperty('url', 'mailto:' + encodeURIComponent(email));
+ admin_usermenu.getItem(1).cfg.setProperty('url', 'mailto:' + encodeURIComponent(email));
+ if (show_edit) {
+ admin_usermenu.getItem(2).cfg.setProperty('url', 'editusers.cgi?action=edit&userid=' + id);
+ } else {
+ admin_usermenu.removeItem(2);
+ }
admin_usermenu.cfg.setProperty('xy', YAHOO.util.Event.getXY(event));
admin_usermenu.show();
}