diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-04-06 06:00:05 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-04-06 06:00:05 +0000 |
commit | 90351aa71c1ada304f557b1c82e462670c7b2587 (patch) | |
tree | aaaa113bb17fa6f931b0c91d51812cf731aaa707 /modules/system/system.module | |
parent | f2e3917acbd0b2ed215db7f5f0817d5dab19e692 (diff) | |
download | brdo-90351aa71c1ada304f557b1c82e462670c7b2587.tar.gz brdo-90351aa71c1ada304f557b1c82e462670c7b2587.tar.bz2 |
- Patch #748976 by jpmckinney, David_Rothstein: 'Show/hide descriptions' links no longer work.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 5e65fd9e1..eea5e90f0 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2703,11 +2703,15 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL, } /** - * Determine if a user is in compact mode. + * Determines if the current user is in compact mode. + * + * @return + * TRUE when in compact mode, FALSE when in expanded mode. */ function system_admin_compact_mode() { - global $user; - return (isset($user->admin_compact_mode)) ? $user->admin_compact_mode : variable_get('admin_compact_mode', FALSE); + // PHP converts dots into underscores in cookie names to avoid problems with + // its parser, so we use a converted cookie name. + return isset($_COOKIE['Drupal_visitor_admin_compact_mode']) ? $_COOKIE['Drupal_visitor_admin_compact_mode'] : variable_get('admin_compact_mode', FALSE); } /** @@ -2717,8 +2721,7 @@ function system_admin_compact_mode() { * Valid values are 'on' and 'off'. */ function system_admin_compact_page($mode = 'off') { - global $user; - user_save($user, array('admin_compact_mode' => ($mode == 'on'))); + user_cookie_save(array('admin_compact_mode' => ($mode == 'on')), array('admin_compact_mode')); drupal_goto(); } |