views_watchdog.module in Views Watchdog 7.4
Same filename and directory in other branches
Extends the Views module and allows to create custom lists of log entries.
File
views_watchdog.moduleView source
<?php
/**
* @file
* Extends the Views module and allows to create custom lists of log entries.
*/
/**
* Implements hook_help().
*/
function views_watchdog_help($path, $arg) {
switch ($path) {
case 'admin/help#views_watchdog':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Views Watchdog module extends the Views module and allows to create custom lists of log entries. For more information, see the online handbook entry for <a href="@views_watchdog">Views Watchdog module</a>.', array(
'@views_watchdog' => 'https://www.drupal.org/project/views_watchdog',
)) . '</p>';
return $output;
}
}
/**
* Implements hook_views_api().
*/
function views_watchdog_views_api() {
return array(
'api' => '3.0',
'path' => drupal_get_path('module', 'views_watchdog') . '/views',
);
}
/**
* Helper function to retrieve list of types.
*/
function views_watchdog_get_type_list() {
return db_query('SELECT DISTINCT(type) FROM {watchdog} ORDER BY type')
->fetchAllKeyed(0, 0);
}
/**
* Helper function to retrieve list of types.
*/
function views_watchdog_get_severity_list() {
return array(
WATCHDOG_EMERGENCY => 'emergency',
WATCHDOG_ALERT => 'alert',
WATCHDOG_CRITICAL => 'critical',
WATCHDOG_ERROR => 'error',
WATCHDOG_WARNING => 'warning',
WATCHDOG_NOTICE => 'notice',
WATCHDOG_INFO => 'info',
WATCHDOG_DEBUG => 'debug',
);
}
Functions
Name![]() |
Description |
---|---|
views_watchdog_get_severity_list | Helper function to retrieve list of types. |
views_watchdog_get_type_list | Helper function to retrieve list of types. |
views_watchdog_help | Implements hook_help(). |
views_watchdog_views_api | Implements hook_views_api(). |