You are here

function site_alert_get_alert in Site Alert 7

Callback to get site alert information.

1 string reference to 'site_alert_get_alert'
site_alert_menu in ./site_alert.module
Create the page for and link to the form.

File

./site_alert.module, line 180
Core functionality for the Site Alert module.

Code

function site_alert_get_alert() {
  $start = variable_get('site_alert_start');
  $begin = strtotime($start);
  $alert = variable_get('site_alert_expire');
  $expire = strtotime($alert);
  $level = variable_get('site_alert_severity');
  $alert = variable_get('site_alert_content');
  if ($begin < time()) {
    if ($expire > time()) {
      $output = array(
        '#theme' => 'site_alert',
        '#level' => $level,
        '#alert' => $alert,
      );
      print render($output);
      drupal_exit();
    }
  }
}