You are here

function magic_dev_preprocess_html in Magic 7.2

Same name and namespace in other branches
  1. 7 magic_dev/magic_dev.module \magic_dev_preprocess_html()

Implements hook_preprocess_html().

File

magic_dev/magic_dev.module, line 60
Development settings for the magic module.

Code

function magic_dev_preprocess_html(&$vars) {
  global $theme_key;

  // Theme Registry Rebuild
  if (theme_get_setting('magic_rebuild_registry', $theme_key) && !defined('MAINTENANCE_MODE')) {

    // Rebuild .info data.
    system_rebuild_theme_data();

    // Rebuild theme registry.
    drupal_theme_rebuild();
  }

  // RWD Debug Integration
  if (theme_get_setting('magic_viewport_indicator', $theme_key) || theme_get_setting('magic_modernizr_debug', $theme_key)) {
    drupal_add_css(drupal_get_path('module', 'magic_dev') . '/css/magic.debug.css');
    drupal_add_js(drupal_get_path('module', 'magic_dev') . '/js/magic.debug.js');

    // Adding a class to the body element.
    $vars['classes_array'][] = 'magic-indicator';
  }
}