--- scanner.module-old 2009-06-10 00:46:55.000000000 -0700 +++ scanner.module 2009-06-10 01:09:32.000000000 -0700 @@ -529,10 +529,21 @@ function scanner_confirm_form_submit($fo } function scanner_undo_page() { - $header = array(t('Date'), t('Searched'), t('Replaced'), t('Count'), t('Operation')); - $sandrs = db_query('SELECT undo_id, time, searched, replaced, count, undone FROM {scanner} ORDER BY undo_id DESC'); + $pager_limit = 20; + $header = array( + array('data' => t('Date'), 'field' => 'time', 'sort' => 'desc'), + array('data' => t('Searched'), 'field' => 'searched'), + array('data' => t('Replaced'), 'field' => 'replaced'), + array('data' => t('Count'), 'field' => 'count'), + array('data' => t('Operation')), + ); + + $filter = node_build_filter_query(); + + $sandrs = pager_query('SELECT undo_id, time, searched, replaced, count, undone FROM {scanner}' . tablesort_sql($header), $pager_limit); + while ($sandr = db_fetch_object($sandrs)) { $query = 'undo_id='. $sandr->undo_id; @@ -544,15 +555,18 @@ function scanner_undo_page() { } $rows[] = array( - format_date($sandr->time), - check_plain($sandr->searched), - check_plain($sandr->replaced), - $sandr->count, - $operation, + array('data' => format_date($sandr->time), 'class' => 'date'), + array('data' => check_plain($sandr->searched), 'class' => 'searched'), + array('data' => check_plain($sandr->replaced), 'class' => 'replaced'), + array('data' => $sandr->count, 'class' => 'count'), + array('data' => $operation, 'class' => 'operation'), ); } + + $output = theme('table', $header, $rows, NULL, 'Prior Search and Replace Events'); + $output .= theme('pager', NULL, $pager_limit); - return theme('table', $header, $rows, NULL, 'Prior Search and Replace Events'); + return $output; } function scanner_undo_confirm_form() {