You are here

function commons_origins_preprocess_page in Drupal Commons 6.2

Same name and namespace in other branches
  1. 7.3 themes/commons/commons_origins/template.php \commons_origins_preprocess_page()

File

themes/commons_origins/template.php, line 30

Code

function commons_origins_preprocess_page(&$variables) {
  $variables['pre_header_top'] = theme('grid_row', $variables['header_top'], 'header-top', 'full-width', $variables['grid_width']);
  $variables['pre_secondary_links'] = theme('grid_block', theme('links', $variables['secondary_links']), 'secondary-menu');
  $variables['pre_search_box'] = theme('grid_block', $variables['search_box'], 'search-box');
  $variables['pre_primary_links_tree'] = theme('grid_block', $variables['primary_links_tree'], 'primary-menu');
  $variables['pre_breadcrumb'] = theme('grid_block', $variables['breadcrumb'], 'breadcrumbs');
  $variables['pre_preface_top'] = theme('grid_row', $variables['preface_top'], 'preface-top', 'full-width', $variables['grid_width']);
  $variables['pre_sidebar_first'] = theme('grid_row', $variables['sidebar_first'], 'sidebar-first', 'nested', $variables['sidebar_first_width']);
  $variables['pre_preface_bottom'] = theme('grid_row', $variables['preface_bottom'], 'preface-bottom', 'nested');
  $variables['pre_help'] = theme('grid_block', $variables['help'], 'content-help');
  $variables['pre_messages'] = theme('grid_block', $variables['messages'], 'content-messages');
  $variables['pre_tabs'] = theme('grid_block', $variables['tabs'], 'content-tabs');
  $variables['pre_content_bottom'] = theme('grid_row', $variables['content_bottom'], 'content-bottom', 'nested');
  $variables['pre_sidebar_last'] = theme('grid_row', $variables['sidebar_last'], 'sidebar-last', 'nested', $variables['sidebar_last_width']);
  $variables['pre_postscript_top'] = theme('grid_row', $variables['postscript_top'], 'postscript-top', 'nested');
  $variables['pre_postscript_bottom'] = theme('grid_row', $variables['postscript_bottom'], 'postscript-bottom', 'full-width', $variables['grid_width']);
  $variables['pre_footer'] = theme('grid_row', $variables['footer'] . $variables['footer_message'], 'footer', 'full-width', $variables['grid_width']);

  //show group description if group node present
  if (isset($variables['node'])) {
    $node = $variables['node'];
    if (og_is_group_type($node->type)) {
      $variables['group_header_image'] = content_format('field_group_image', $node->field_group_image[0], 'user_picture_meta_default');
      if (!empty($node->body)) {
        $variables['group_header_text'] = check_markup($node->body, $node->format);
      }
      else {
        $variables['group_header_text'] = check_plain($node->og_description);
      }
    }
  }
}