function alpha_page_alter

cis7 template.php alpha_page_alter(&$vars)
cle7 template.php alpha_page_alter(&$vars)
elmsmedia7 template.php alpha_page_alter(&$vars)
icor7 template.php alpha_page_alter(&$vars)
meedjum_blog7 template.php alpha_page_alter(&$vars)
mooc7 template.php alpha_page_alter(&$vars)

Implements hook_page_alter().

File

sites/all/themes/ulmus/omega/alpha/template.php, line 139

Code

function alpha_page_alter(&$vars) {
  $theme = alpha_get_theme();
  $theme->settings['debug']['access'] = alpha_debug_access($GLOBALS['user'], $theme->settings['debug']['roles']);

  // If no module has taken care of the main content, add it to the page now.
  // This allows the site to still be usable even if no modules that
  // control page regions (for example, the Block module) are enabled.
  if (!drupal_static('system_main_content_added', FALSE)) {
    $vars['content']['system_main'] = drupal_set_page_content();
  }

  if (($theme->settings['debug']['access'] || $GLOBALS['user']->uid == 1) && ($theme->settings['debug']['grid'] || $theme->settings['debug']['block'])) {
    drupal_add_css(drupal_get_path('theme', 'alpha') . '/css/alpha-debug.css', array('group' => CSS_THEME, 'weight' => -5));
    drupal_add_js(drupal_get_path('theme', 'alpha') . '/js/alpha-debug.js', array('group' => JS_THEME, 'weight' => -5));

    if ($theme->settings['responsive']) {
      $vars['page_bottom']['alpha_resize_indicator'] = array(
        '#type' => 'markup',
        '#markup' => '<div class="alpha-resize-indicator"></div>',
      );
    }

    if ($theme->settings['debug']['grid']) {
      $vars['page_bottom']['alpha_grid_toggle'] = array(
        '#type' => 'markup',
        '#markup' => '<a class="alpha-grid-toggle" href="#"></a>',
      );
    }
    if ($theme->settings['debug']['block']) {
      $vars['page_bottom']['alpha_block_toggle'] = array(
        '#type' => 'markup',
        '#markup' => '<a class="alpha-block-toggle" href="#"></a>',
      );

      foreach ($theme->regions as $region => $item) {
        if ($item['enabled']) {
          if (empty($vars[$region])) {
            $vars[$region]['#region'] = $region;
            $vars[$region]['#theme_wrappers'] = array('region');
          }

          if (isset($vars[$region]['#theme_wrappers']) && array_search('region', $vars[$region]['#theme_wrappers']) !== FALSE) {
            $vars[$region] = array('alpha_debug_' . $region => array(
              '#type' => 'markup',
              '#markup' => '<div class="alpha-debug-block"><h2>' . $item['name'] . '</h2><p>' . t('This is a debugging block') . '</p></div>',
              '#weight' => -999,
            )) + $vars[$region];
          }
        }
      }
    }
  }

  if (!module_implements('alpha_page_structure_alter')) {
    alpha_alter('alpha_page_structure', $vars, $theme->theme);
  }
  else {
    drupal_alter('alpha_page_structure', $vars, $theme->theme);
  }
}