You are here

function scanner_undo_page in Search and Replace Scanner 6

Same name and namespace in other branches
  1. 5.2 scanner.module \scanner_undo_page()
  2. 7 scanner.module \scanner_undo_page()
1 string reference to 'scanner_undo_page'
scanner_menu in ./scanner.module
Implementation of hook_menu().

File

./scanner.module, line 560
Search and Replace Scanner - works on all nodes text content.

Code

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');
  while ($sandr = db_fetch_object($sandrs)) {
    $query = 'undo_id=' . $sandr->undo_id;
    if ($sandr->undone) {
      $operation = l('Redo', 'admin/content/scanner/undo/confirm', array(
        'query' => $query,
      ));
    }
    else {
      $operation = l('Undo', 'admin/content/scanner/undo/confirm', array(
        'query' => $query,
      ));
    }
    $rows[] = array(
      format_date($sandr->time),
      check_plain($sandr->searched),
      check_plain($sandr->replaced),
      $sandr->count,
      $operation,
    );
  }
  return theme('table', $header, $rows, NULL, 'Prior Search and Replace Events');
}