You are here

function regions_init in Regions 7

Same name and namespace in other branches
  1. 6 regions.module \regions_init()

Implements hook_init().

File

./regions.module, line 35
Add regions to the screen that are cross-theme compliant

Code

function regions_init() {

  // Check for current theme.
  global $theme_key;
  $regions = _regions_list($theme_key);
  foreach ($regions as $region_info) {

    // Add optional js files if defined.
    if (isset($region_info['js'])) {
      drupal_add_js($region_info['js']);
    }

    // Add optional stylesheets if defined.
    if (isset($region_info['css'])) {
      drupal_add_css($region_info['css']);
    }
  }
}