summaryrefslogtreecommitdiff
path: root/modules/watchdog
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
commit7e1527ee61bc10b3765b95b9af8faaa2254da5a8 (patch)
tree2225c7f571b4a3f635564f8281406a12b2a271a7 /modules/watchdog
parent7b5b460534e5c54b07d28467c2aa2fc670c714e4 (diff)
downloadbrdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.gz
brdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.bz2
- Patch #29465: new form API by Adrian et al.
TODO: + The contact.module was broken; a new patch for contact.module is needed. + Documentation is needed. + The most important modules need to be updated ASAP.
Diffstat (limited to 'modules/watchdog')
-rw-r--r--modules/watchdog/watchdog.module26
1 files changed, 20 insertions, 6 deletions
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index bf2192566..6e2066cdd 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -77,13 +77,18 @@ function watchdog_overview() {
$_SESSION['watchdog_overview_filter'] = 'all';
}
- $op = $_POST['op'];
- if ($op == t('Filter') && isset($_POST['edit']['filter'])) {
- $_SESSION['watchdog_overview_filter'] = $_POST['edit']['filter'];
+ if (empty($_SESSION['watchdog_overview_filter'])) {
+ $_SESSION['watchdog_overview_filter'] = 'all';
}
- $form = form_select(t('Filter by message type'), 'filter', $_SESSION['watchdog_overview_filter'], $names);
- $form .= form_submit(t('Filter'));
+ $form['filter'] = array(
+ type => 'select',
+ title => t('Filter by message type'),
+ options => $names,
+ default_value => $_SESSION['watchdog_overview_filter']
+ );
+
+ $form['submit'] = array(type => 'submit', value =>t('Filter'));
$header = array(
' ',
@@ -117,13 +122,22 @@ function watchdog_overview() {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => '7'));
}
- $output = '<div class="container-inline">'. form($form) .'</div>';
+ $output = drupal_get_form('watchdog_form_overview', $form);
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0, tablesort_pager());
return $output;
}
+function theme_watchdog_form_overview($form) {
+ return '<div class="container-inline">'. form_render($form) .'</div>';
+}
+
+function watchdog_form_overview_execute($form_id, $form) {
+ global $form_values;
+ $_SESSION['watchdog_overview_filter'] = $form_values['filter'];
+}
+
/**
* Menu callback; displays details about a log message.
*/