function dblog_event
Same name and namespace in other branches
- 6.x drupal-6.x/modules/dblog/dblog.admin.inc \dblog_event()
Page callback: Displays details about a specific database log message.
Parameters
int $id: Unique ID of the database log message.
Return value
array|string If the ID is located in the Database Logging table, a build array in the format expected by drupal_render(); otherwise, an empty string.
See also
3 string references to 'dblog_event'
- dblog_menu in drupal-7.x/
modules/ dblog/ dblog.module - Implements hook_menu().
- drupal-6.bare.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.bare.database.php - Bare installation of Drupal 6.17, for test purposes.
- drupal-6.filled.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.filled.database.php - Filled installation of Drupal 6.17, for test purposes.
Archivo
- drupal-7.x/
modules/ dblog/ dblog.admin.inc, line 152 - Administrative page callbacks for the Database Logging module.
Código
function dblog_event($id) {
$severity = watchdog_severity_levels();
$result = db_query('SELECT w.*, u.name, u.uid FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid WHERE w.wid = :id', array(':id' => $id))->fetchObject();
if ($dblog = $result) {
$rows = array(
array(
array(
'data' => t('Type'),
'header' => TRUE,
),
t($dblog->type),
),
array(
array(
'data' => t('Date'),
'header' => TRUE,
),
format_date($dblog->timestamp, 'long'),
),
array(
array(
'data' => t('User'),
'header' => TRUE,
),
theme('username', array('account' => $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,
),
theme('dblog_message', array('event' => $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,
),
);
$build['dblog_table'] = array(
'#theme' => 'table',
'#rows' => $rows,
'#attributes' => array('class' => array('dblog-event')),
);
return $build;
}
else {
return '';
}
}