1 layout.module layout_theme()

Implements hook_theme()

File

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

Code

function layout_theme() {
  $base = array(
    'file' => 'layout.theme.inc',
  );

  $items = array(
    'layout' => array(
      'variables' => array(
        'content' => NULL,
        'settings' => NULL,
        'layout' => NULL,
        // @todo: Rename to layout_template_info in 2.x.
        'layout_info' => NULL,
        'renderer' => NULL,
        'attributes' => array(),
        'admin' => FALSE,
      ),
      'template' => 'templates/layout',
    ) + $base,
    'layout_reorder_layouts' => array(
      'render element' => 'element',
    ) + $base,
    'layout_content_form' => array(
      'template' => 'templates/layout-content-form',
      'render element' => 'form',
    ) + $base,
    'layout_hero_background_image' => array(
      'render element' => 'element',
    ) + $base,
    'layout_info' => array(
      'variables' => array('layout' => NULL),
    ) + $base,
    'layout_condition_info' => array(
      'variables' => array(
        'layout' => NULL,
        'show_empty' => TRUE,
      ),
    ) + $base,
    'layout_template_option' => array(
      'variables' => array('template_info' => NULL),
    ) + $base,
    'layout_template_info' => array(
      'variables' => array('template_info' => NULL),
    ) + $base,
    'layout_flexible_template_style_option' => array(
      'variables' => array('row_style' => NULL),
    ) + $base,
    'layout_menu_item_arguments_table' => array(
      'render element' => 'element',
    ) + $base,
    'layout_settings_context_table' => array(
      'render element' => 'element',
    ) + $base,
    'layout_action_links' => array(
      'render element' => 'element',
    ) + $base,
    'layout_conditions' => array(
      'render element' => 'element',
    ) + $base,
    'layout_region_inner' => array(
      'variables' => array(
        'blocks' => array(),
        'tag' => '',
        'classes' => array(),
        'attributes' => array(),
      ),
    ) + $base,
  );

  // Register all layout templates.
  $layout_templates = layout_get_layout_template_info();

  foreach ($layout_templates as $template) {
    if (!empty($template['template'])) {
      $theme_key = str_replace('-', '_', $template['template']);
      $items[$theme_key] = array(
        'variables' => array(
          'content' => NULL,
          'settings' => NULL,
          'layout' => NULL,
          // @todo: Rename to layout_template_info in 2.x.
          'layout_info' => NULL,
          'renderer' => NULL,
          'attributes' => array(),
          'admin' => FALSE,
        ),
        'template' => $template['template'],
        'path' => $template['path'],
        'base hook' => 'layout',
      );

      if (isset($template['file'])) {
        $items[$theme_key]['file'] = $template['file'];
      }
    }
  }

  // Register all styles.
  $styles = _layout_get_all_info('layout_style');

  foreach ($styles as $style) {
    if (!empty($style['block theme'])) {
      $items[$style['block theme']] = array(
        'variables' => array(
          'content' => NULL,
          'layout' => NULL,
          'block' => NULL,
          'style' => NULL,
          'settings' => array(),
          'attributes' => array(),
        ),
      );

      if (isset($style['file'])) {
        $items[$style['block theme']]['file'] = $style['file'];
      }

      if (isset($style['path'])) {
        $items[$style['block theme']]['path'] = $style['path'];
      }

      if (isset($style['template'])) {
        $items[$style['block theme']]['template'] = $style['template'];
      }
    }

    if (!empty($style['hook theme'])) {
      if (is_array($style['hook theme'])) {
        $items += $style['hook theme'];
      }
      elseif (function_exists($style['hook theme'])) {
        $style['hook theme']($items, $style);
      }
    }
  }

  return $items;
}