summaryrefslogtreecommitdiff
path: root/modules/watchdog.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
commit54b77d64354949428bc8bf48d47b587312a535f2 (patch)
tree8e29ff15063129388e14009f0de6fda996beb897 /modules/watchdog.module
parent5ad73c8eb63c8c8db451e5586860f52be8dd8874 (diff)
downloadbrdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.gz
brdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.bz2
Tabs patch!
CHANGES ------- + Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page. + Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'. + Grouped settings. All settings have been grouped under 'administer > settings'. TODO ---- + Update core themes: only Xtemplate default supports tabs and even those look ugly. Need help. + Update contributed modules. The menu() hook changed drastically. Updating your code adhere the new menu() function should be 90% of the work. Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
Diffstat (limited to 'modules/watchdog.module')
-rw-r--r--modules/watchdog.module41
1 files changed, 18 insertions, 23 deletions
diff --git a/modules/watchdog.module b/modules/watchdog.module
index a2be7242c..14c2c17d7 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -9,7 +9,7 @@ function watchdog_help($section = 'admin/help#watchdog') {
case 'admin/help#watchdog':
return t('
<p>Watchdog module monitors your web site, capturing system events in a log to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to <a href="%watchdog">check the watchdog report</a> on a regular basis as it is often the only way to tell what is going on.</p>
- <p>To ease administration, the watchdog will automatically discard old log entries, <a href="%log-entry">as configured</a>. Needs "cron.php" to discard the entries.</p>', array('%watchdog' => url('admin/logs'), '%log-entry' => url('admin/system/modules/watchdog')));
+ <p>To ease administration, the watchdog will automatically discard old log entries, <a href="%log-entry">as configured</a>. Needs "cron.php" to discard the entries.</p>', array('%watchdog' => url('admin/logs'), '%log-entry' => url('admin/settings/watchdog')));
case 'admin/logs':
return t('The watchdog module monitors your web site, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on.');
case 'admin/logs/user':
@@ -26,9 +26,9 @@ function watchdog_help($section = 'admin/help#watchdog') {
return t('Watchdog events about PHP and database errors.');
case 'admin/logs/warning':
return t('Watchdog warning events. These events don\'t stop Drupal from running, but are things you should know.');
- case 'admin/system/modules#description':
+ case 'admin/modules#description':
return t('Logs and records system events.');
- case 'admin/system/modules/watchdog':
+ case 'admin/settings/watchdog':
return t('Watchdog logs your system events. To see these events go to the <a href="%watchdog">logs</a>. Since these logs can grow out of control if kept around forever, below set how long an item should be kept in the log. Note that to discard entries as set below you must run "cron.php" regularly.', array('%watchdog' => url('admin/logs')));
}
}
@@ -41,29 +41,24 @@ function watchdog_perm() {
}
/**
- * Implementation of hook_link().
+ * Implementation of hook_menu().
*/
-function watchdog_link($type) {
- if ($type == 'system') {
- menu('admin/logs', t('logs'), user_access('administer watchdog') ? 'watchdog_overview' : MENU_DENIED, 7);
- menu('admin/logs/view', t('view details'), user_access('administer watchdog') ? 'watchdog_view' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
-
- if (arg(1) == 'logs') {
- foreach (_watchdog_get_message_types() as $type) {
- menu("admin/logs/$type", t($type), MENU_FALLTHROUGH, 0, MENU_SHOW, MENU_LOCKED);
- }
+function watchdog_menu() {
+ $items = array();
+ $items[] = array('path' => 'admin/logs', 'title' => t('logs'),
+ 'callback' => 'watchdog_overview',
+ 'access' => user_access('administer watchdog'));
+ $items[] = array('path' => 'admin/logs/view', 'title' => t('view details'),
+ 'callback' => 'watchdog_view',
+ 'access' => user_access('administer watchdog'),
+ 'type' => MENU_CALLBACK);
+ if (arg(1) == 'logs') {
+ foreach (_watchdog_get_message_types() as $type) {
+ $items[] = array('path' => 'admin/logs/'. $type, 'title' => t($type),
+ 'type' => MENU_DYNAMIC_ITEM);
}
}
-}
-
-/**
- * Implementation of hook_settings().
- */
-function watchdog_settings() {
- $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval');
- $period[1000000000] = t('Never');
- $output .= form_select(t('Discard entries older than'), 'watchdog_clear', variable_get('watchdog_clear', 604800), $period, t('The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab.'));
- return $output;
+ return $items;
}
/**