You are here

function template_preprocess_emaillog in Logging and alerts 7.2

Same name and namespace in other branches
  1. 8 emaillog/emaillog.module \template_preprocess_emaillog()
  2. 6.2 emaillog/emaillog.module \template_preprocess_emaillog()
  3. 2.0.x emaillog/emaillog.module \template_preprocess_emaillog()

Process variables for emaillog.tpl.php.

File

emaillog/emaillog.module, line 191
Drupal Module: Email Logging and Alerts

Code

function template_preprocess_emaillog(&$variables) {
  global $base_url;
  $variables['base_url'] = $base_url;
  $severity_list = watchdog_severity_levels();
  $variables['log']['severity_desc'] = drupal_ucfirst($severity_list[$variables['log']['severity']]);
  $variables['log']['datetime'] = date('Y-m-d H:i:s', $variables['log']['timestamp']);
  $variables['log']['uid'] = $variables['log']['user']->uid;
  $variables['log']['name'] = format_username($variables['log']['user']);
  $variables['log']['link'] = strip_tags($variables['log']['link']);
  $variables['log']['message'] = strip_tags(t($variables['log']['message'], $variables['log']['variables']));
  $severity = _emaillog_system_string($severity_list[$variables['log']['severity']]);
  $variables['theme_hook_suggestions'][] = 'emaillog__' . $severity;
  $variables['theme_hook_suggestions'][] = 'emaillog__' . _emaillog_system_string($variables['log']['type']);
  $variables['theme_hook_suggestions'][] = 'emaillog__' . $severity . '__' . _emaillog_system_string($variables['log']['type']);
}