watchdog_menu

Definition

watchdog_menu($may_cache)
modules/watchdog/watchdog.module, line 32

Description

Implementation of hook_menu().

Code

<?php
function watchdog_menu($may_cache) {
  $items = array();

  if ($may_cache) {
    $items[] = array('path' => 'admin/logs/watchdog', 'title' => t('Recent log entries'),
      'description' => t('View events that have recently been logged.'),
      'callback' => 'watchdog_overview',
      'weight' => -1);
    $items[] = array('path' => 'admin/logs/page-not-found', 'title' => t("Top 'page not found' errors"),
      'description' => t("View 'page not found' errors (404s)."),
      'callback' => 'watchdog_top',
      'callback arguments' => array('page not found'));
    $items[] = array('path' => 'admin/logs/access-denied', 'title' => t("Top 'access denied' errors"),
      'description' => t("View 'access denied' errors (403s)."),
      'callback' => 'watchdog_top',
      'callback arguments' => array('access denied'));
    $items[] = array('path' => 'admin/logs/event', 'title' => t('Details'),
      'callback' => 'watchdog_event',
      'type' => MENU_CALLBACK);
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'logs') {
      // Add the CSS for this module
      drupal_add_css(drupal_get_path('module', 'watchdog') .'/watchdog.css', 'module', 'all', FALSE);
    }
  }

  return $items;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.