theme_dblog_message

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 theme_dblog_message($variables)

Returns HTML for a log message.

Parameters

$variables An associative array containing:

  • event: An object with at least the message and variables properties.
  • link: (optional) Format message as link, event->wid is required.

Related topics

Code

modules/dblog/dblog.admin.inc, line 254

<?php
function theme_dblog_message($variables) {
  $output = '';
  $event = $variables['event'];
  // Check for required properties.
  if (isset($event->message) && isset($event->variables)) {
    // Messages without variables or user specified text.
    if ($event->variables === 'N;') {
      $output = $event->message;
    }
    // Message to translate with injected variables.
    else {
      $output = t($event->message, unserialize($event->variables));
    }
    if ($variables['link'] && isset($event->wid)) {
      // Truncate message to 56 chars.
      $output = truncate_utf8(filter_xss($output, array()), 56, TRUE, TRUE);
      $output = l($output, 'admin/reports/event/' . $event->wid, array('html' => TRUE));
    }
  }
  return $output;
}
?>