This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/web/core/modules/dblog/dblog.views.inc

217 lines
4.4 KiB
PHP
Raw Normal View History

<?php
/**
* @file
* Provide views data for dblog.module.
*/
/**
* Implements hook_views_data().
*/
function dblog_views_data() {
2017-04-13 14:53:35 +00:00
$data = [];
$data['watchdog']['table']['group'] = t('Watchdog');
$data['watchdog']['table']['wizard_id'] = 'watchdog';
2017-04-13 14:53:35 +00:00
$data['watchdog']['table']['base'] = [
'field' => 'wid',
'title' => t('Log entries'),
'help' => t('Contains a list of log entries.'),
2017-04-13 14:53:35 +00:00
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['wid'] = [
'title' => t('WID'),
'help' => t('Unique watchdog event ID.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['uid'] = [
'title' => t('UID'),
'help' => t('The user ID of the user on which the log entry was written..'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'numeric',
2017-04-13 14:53:35 +00:00
],
'relationship' => [
'title' => t('User'),
'help' => t('The user on which the log entry as written.'),
'base' => 'users',
'base field' => 'uid',
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['type'] = [
'title' => t('Type'),
'help' => t('The type of the log entry, for example "user" or "page not found".'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'in_operator',
'options callback' => '_dblog_get_message_types',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['message'] = [
'title' => t('Message'),
'help' => t('The actual message of the log entry.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'dblog_message',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['variables'] = [
'title' => t('Variables'),
'help' => t('The variables of the log entry in a serialized format.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'serialized',
'click sortable' => FALSE,
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['severity'] = [
'title' => t('Severity level'),
'help' => t('The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'machine_name',
'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'in_operator',
'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['link'] = [
'title' => t('Operations'),
'help' => t('Operation links for the event.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'dblog_operations',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['location'] = [
'title' => t('Location'),
'help' => t('URL of the origin of the event.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['referer'] = [
'title' => t('Referer'),
'help' => t('URL of the previous page.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['hostname'] = [
'title' => t('Hostname'),
'help' => t('Hostname of the user who triggered the event.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'string',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'standard',
2017-04-13 14:53:35 +00:00
],
];
2017-04-13 14:53:35 +00:00
$data['watchdog']['timestamp'] = [
'title' => t('Timestamp'),
'help' => t('Date when the event occurred.'),
2017-04-13 14:53:35 +00:00
'field' => [
'id' => 'date',
2017-04-13 14:53:35 +00:00
],
'argument' => [
'id' => 'date',
2017-04-13 14:53:35 +00:00
],
'filter' => [
'id' => 'date',
2017-04-13 14:53:35 +00:00
],
'sort' => [
'id' => 'date',
2017-04-13 14:53:35 +00:00
],
];
return $data;
}