You are here

function mcd_preprocess_maintenance_page in Maintenance Countdown 6

Same name and namespace in other branches
  1. 7 mcd.countdown.inc \mcd_preprocess_maintenance_page()

Add some variables for maintenance-coundown-page.tpl.php file.

To add or override something you can use the same TEMPLATE_preprocess_maintenance_page function in your theme template.php file.

Parameters

$variables: New and updated variables for maintenance-coundown-page.tpl.php file.

File

./mcd.countdown.inc, line 72
This file will be processed if time is set

Code

function mcd_preprocess_maintenance_page(&$variables) {
  $path = drupal_get_path('module', 'mcd');

  //  unset regions
  unset($variables['left']);
  unset($variables['right']);

  //  add theme css
  $variables['styles'] = drupal_add_css($path . '/styles/' . variable_get('mcd_page_themes', 'light') . '.css', 'theme', 'all');
  $css = drupal_add_css();

  //  we don't need all modules css
  unset($css['all']['module']);
  $variables['styles'] = drupal_get_css($css);

  //  we need jquery 1.4.1+ to make it work
  $variables['scripts'] = drupal_add_js($path . '/js/jquery-1.4.1.min.js', 'module', 'header', FALSE, TRUE, FALSE);
  $variables['scripts'] = drupal_add_js($path . '/js/jquery.lwtCountdown-1.0-min.js', 'module', 'header', FALSE, TRUE, FALSE);
  $variables['scripts'] = drupal_add_js(mcd_js_countdown(), 'inline');

  //  we don't need core js for this page
  $js = drupal_add_js(NULL, NULL, 'header');
  unset($js['core']);
  $variables['scripts'] = drupal_get_js('header', $js);
  $variables['time_up_message'] = variable_get('mcd_time_up_message', FALSE);
  if (variable_get('mcd_reload_button', 0) == 0) {
    $variables['reload_button'] = l(t('♻ Reload'), $_GET['q'], array(
      'attributes' => array(
        'id' => 'page_reload',
        'title' => t('Reload this page'),
      ),
    ));
  }
  else {
    $variables['reload_button'] = FALSE;
  }
}