1 layout.module layout_current_user_context()

Returns the current user context, which is always available.

@since 1.17.5 Function added.

Return value

EntityLayoutContext: The layout context for the current user.

File

core/modules/layout/layout.module, line 1823
The Layout module creates pages and wraps existing pages in layouts.

Code

function layout_current_user_context() {
  $current_user_context = layout_create_context('user', array(
    'name' => 'current_user',
    'label' => t('Current user'),
    'locked' => TRUE,
  ));
  $current_user_context->setData($GLOBALS['user']);
  return $current_user_context;
}