You are here

function dblog_event in Drupal 6

Same name and namespace in other branches
  1. 7 modules/dblog/dblog.admin.inc \dblog_event()

Menu callback; displays details about a log message.

1 string reference to 'dblog_event'
dblog_menu in modules/dblog/dblog.module
Implementation of hook_menu().

File

modules/dblog/dblog.admin.inc, line 130
Administrative page callbacks for the dblog module.

Code

function dblog_event($id) {
  $severity = watchdog_severity_levels();
  $output = '';
  $result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = %d', $id);
  if ($dblog = db_fetch_object($result)) {
    $rows = array(
      array(
        array(
          'data' => t('Type'),
          'header' => TRUE,
        ),
        t($dblog->type),
      ),
      array(
        array(
          'data' => t('Date'),
          'header' => TRUE,
        ),
        format_date($dblog->timestamp, 'large'),
      ),
      array(
        array(
          'data' => t('User'),
          'header' => TRUE,
        ),
        theme('username', $dblog),
      ),
      array(
        array(
          'data' => t('Location'),
          'header' => TRUE,
        ),
        l($dblog->location, $dblog->location),
      ),
      array(
        array(
          'data' => t('Referrer'),
          'header' => TRUE,
        ),
        l($dblog->referer, $dblog->referer),
      ),
      array(
        array(
          'data' => t('Message'),
          'header' => TRUE,
        ),
        _dblog_format_message($dblog),
      ),
      array(
        array(
          'data' => t('Severity'),
          'header' => TRUE,
        ),
        $severity[$dblog->severity],
      ),
      array(
        array(
          'data' => t('Hostname'),
          'header' => TRUE,
        ),
        check_plain($dblog->hostname),
      ),
      array(
        array(
          'data' => t('Operations'),
          'header' => TRUE,
        ),
        $dblog->link,
      ),
    );
    $attributes = array(
      'class' => 'dblog-event',
    );
    $output = theme('table', array(), $rows, $attributes);
  }
  return $output;
}