function system_admin_compact_mode

Same name and namespace in other branches
  1. 11.x core/modules/system/system.module \system_admin_compact_mode()
  2. 10 core/modules/system/system.module \system_admin_compact_mode()
  3. 9 core/modules/system/system.module \system_admin_compact_mode()
  4. 8.9.x core/modules/system/system.module \system_admin_compact_mode()
  5. 7.x 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 \Drupal\system\Controller\SystemController::compactPage().

Return value

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

Deprecated

in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement.

See also

https://www.drupal.org/node/3588109

File

core/modules/system/system.module, line 225

Code

function system_admin_compact_mode() {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3588109', E_USER_DEPRECATED);
  // PHP converts dots into underscores in cookie names to avoid problems with
  // its parser, so we use a converted cookie name.
  return \Drupal::request()->cookies
    ->get('Drupal_visitor_admin_compact_mode', FALSE);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.