function template_preprocess_emaillog in Logging and alerts 6.2
Same name and namespace in other branches
- 8 emaillog/emaillog.module \template_preprocess_emaillog()
- 7.2 emaillog/emaillog.module \template_preprocess_emaillog()
- 2.0.x emaillog/emaillog.module \template_preprocess_emaillog()
Process variables for emaillog.tpl.php.
File
- emaillog/
emaillog.module, line 163 - 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'] = strip_tags(theme('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['template_files'][] = 'emaillog-' . $severity;
$variables['template_files'][] = 'emaillog-' . _emaillog_system_string($variables['log']['type']);
$variables['template_files'][] = 'emaillog-' . $severity . '-' . _emaillog_system_string($variables['log']['type']);
}