You are here

function system_admin_compact_mode in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/system/system.module \system_admin_compact_mode()
  2. 5 modules/system/system.module \system_admin_compact_mode()
  3. 6 modules/system/system.module \system_admin_compact_mode()
  4. 9 core/modules/system/system.module \system_admin_compact_mode()
  5. 10 core/modules/system/system.module \system_admin_compact_mode()

Determines whether the current user is in compact mode.

Compact mode shows certain administration pages with less description text, such as the configuration page and the permissions page.

Whether the user is in compact mode is determined by a cookie, which is set for the user by system_admin_compact_page().

If the user does not have the cookie, the default value is given by the system variable 'admin_compact_mode', which itself defaults to FALSE. This does not have a user interface to set it: it is a hidden variable which can be set in the settings.php file.

Return value

TRUE when in compact mode, FALSE when in expanded mode.

4 calls to system_admin_compact_mode()
seven_admin_block_content in themes/seven/template.php
Overrides theme_admin_block_content().
theme_admin_block_content in modules/system/system.admin.inc
Returns HTML for the content of an administrative block.
theme_system_compact_link in modules/system/system.module
Returns HTML for a link to show or hide inline help descriptions.
user_admin_permissions in modules/user/user.admin.inc
Menu callback: administer permissions.

File

modules/system/system.module, line 2954
Configuration system that lets administrators modify the workings of the site.

Code

function system_admin_compact_mode() {

  // 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);
}