From ff8e4dad8cc47b04a7dff800dd2471a6715f0bdd Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Wed, 4 May 2011 02:29:37 -0500 Subject: Patch #1146452: Provide option to alter logout link instead of adding additional menu item. --- masquerade.module | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/masquerade.module b/masquerade.module index d36db7c..b3eae6c 100644 --- a/masquerade.module +++ b/masquerade.module @@ -164,6 +164,7 @@ function masquerade_menu_alter(&$items) { } $items['masquerade/switch/%']['options']['alter'] = TRUE; $items['masquerade/unswitch']['options']['alter'] = TRUE; + $items['user/logout']['options']['alter'] = TRUE; } /** @@ -180,6 +181,10 @@ function masquerade_translated_menu_link_alter(&$item, $map) { $item['localized_options']['query']['token'] = drupal_get_token('masquerade/unswitch'); } } + if ($item['href'] == 'user/logout' && masquerade_menu_access('unswitch')) { + $item['title'] = t('Log out (return)'); + $item['href'] = 'masquerade/unswitch'; // @TODO Some add all the token jazz. + } } -- 1.7.4.2