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.


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


function layout_current_user_context() {
  $current_user_context = layout_create_context('user', array(
    'name' => 'current_user',
    'label' => t('Current user'),
    'locked' => TRUE,
    'usageType' => LayoutContext::USAGE_TYPE_SYSTEM,
  return $current_user_context;