'. t('Within the "Filter log messages" field set there is a button that you may use to clear selected entries.') .'

'; } } /** * Implementation of hook_form_alter(). */ function log_clear_form_alter(&$form, $form_state, $form_id) { switch ($form_id) { case 'dblog_filter_form': drupal_add_css(drupal_get_path('module', 'log_clear') . '/log_clear.css'); $form['filters']['buttons']['clear'] = array( '#type' => 'submit', '#value' => t('Clear'), '#submit' => array('log_clear_submit'), ); break; } } /** * Handle log_clear button clicks. */ function log_clear_submit($form, &$form_state) { $filter = dblog_build_filter_query(); $sql = 'DELETE FROM {watchdog}'. ($filter['where'] ? (' WHERE '. str_replace('w.', '', $filter['where'])) : ''); if (db_query($sql, $filter['args']) === FALSE) { drupal_set_message(t('Log_clear failed.')); } else { $count = db_affected_rows(); drupal_set_message(t('Deleted !count rows.', array('!count' => $count))); // Clear the filter. unset($_SESSION['dblog_overview_filter']); } }