You are here

function filelog_ui_entry in File Log 6.2

Menu callback; displays details about a log message.

1 string reference to 'filelog_ui_entry'
filelog_ui_menu in ./filelog_ui.module
Implementation of hook_menu()

File

./filelog_ui.pages.inc, line 115
Log viewer page callbacks for the filelog_ui module.

Code

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