Commit 9bbddaf1 authored by Michael Rossetti's avatar Michael Rossetti
Browse files

Created branch 7.x-beta1. This is the first implementation of scanner for Drupal 7

parent 85fd3314
Scanner Search and Replace Scanner Search and Replace
-------------------------- --------------------------
......
This diff is collapsed.
Scanner Search and Replace Scanner Search and Replace
-------------------------- --------------------------
...@@ -50,8 +49,7 @@ searching for "run" with the whole word option selected will filter out ...@@ -50,8 +49,7 @@ searching for "run" with the whole word option selected will filter out
6. Can limit search and replace to published nodes only. 6. Can limit search and replace to published nodes only.
7. Can search and replace on CCK text fields, in addition to node title 7. Can search and replace on CCK text fields, in addition to the node title.
and body fields.
8. Searches can be limited to specific fields in specific node types. 8. Searches can be limited to specific fields in specific node types.
...@@ -64,7 +62,7 @@ to revert a change. ...@@ -64,7 +62,7 @@ to revert a change.
a specific replacement action. a specific replacement action.
12. Can dynamically update teasers after replacements in other fields, or can 12. Can dynamically update teasers after replacements in other fields, or can
by updated manually, or not at all. by updated manually, or not at all. (Not yet working in D7)
13. Will dynamically expand PHP's maximum execution time for scripts up to 13. Will dynamically expand PHP's maximum execution time for scripts up to
10 minutes on servers that support it. This allows complex queries on large 10 minutes on servers that support it. This allows complex queries on large
...@@ -79,7 +77,7 @@ V. TODO / KNOWN BUGS: ...@@ -79,7 +77,7 @@ V. TODO / KNOWN BUGS:
bug where multiple search terms on the same line aren't all highlighted. (The bug where multiple search terms on the same line aren't all highlighted. (The
hit count is correct, though, and all items are replaced correctly.) hit count is correct, though, and all items are replaced correctly.)
2. Perform more thorough testing of the "custom field" feature. 2. Perform more thorough testing of the "custom field" feature. (Functionality not yet provided in D7)
VI. INSTALLATION AND ADMINISTRATION: VI. INSTALLATION AND ADMINISTRATION:
...@@ -89,6 +87,11 @@ See INSTALL.txt for installation and administration instructions. ...@@ -89,6 +87,11 @@ See INSTALL.txt for installation and administration instructions.
VII. CREDITS: VII. CREDITS:
Version 7.x-dev by:
- Michael Rossetti
Drupal username: MikeyR
rossetti [at] mit.edu
Version 6.x-dev by: Version 6.x-dev by:
- Amit Asaravala - Amit Asaravala
Drupal username: aasarava Drupal username: aasarava
......
name = Scanner name = Scanner
description = Do Search and Replace on the content of nodes. description = Do Search and Replace on the content of nodes.
core = 7.x
core = 6.x
\ No newline at end of file
...@@ -7,48 +7,48 @@ ...@@ -7,48 +7,48 @@
/** /**
* Implementation of hook_schema(). * Implements hook_schema().
*/ */
function scanner_schema() { function scanner_schema() {
$schema['scanner'] = array( $schema['scanner'] = array(
'description' => t('Holds info on recent replacements in case undo is needed.'), 'description' => 'Holds info on recent replacements in case undo is needed.',
'fields' => array( 'fields' => array(
'undo_id' => array( 'undo_id' => array(
'description' => t('Row identifier'), 'description' => 'Row identifier',
'type' => 'serial', 'type' => 'serial',
'not null' => TRUE, 'not null' => TRUE,
), ),
'undo_data' => array( 'undo_data' => array(
'description' => t('What was changed'), 'description' => 'What was changed',
'type' => 'text', 'type' => 'text',
'size' => 'big', 'size' => 'big',
'not null' => TRUE, 'not null' => TRUE,
), ),
'undone' => array( 'undone' => array(
'description' => t('Whether the replacement has been undone'), 'description' => 'Whether the replacement has been undone',
'type' => 'int', 'type' => 'int',
'size' => 'tiny', 'size' => 'tiny',
'not null' => TRUE, 'not null' => TRUE,
), ),
'searched' => array( 'searched' => array(
'description' => t('Text that was searched for'), 'description' => 'Text that was searched for',
'type' => 'varchar', 'type' => 'varchar',
'length' => 256, 'length' => 256,
'not null' => TRUE, 'not null' => TRUE,
), ),
'replaced' => array( 'replaced' => array(
'description' => t('Text that was used as replacement'), 'description' => 'Text that was used as replacement',
'type' => 'varchar', 'type' => 'varchar',
'length' => 256, 'length' => 256,
'not null' => TRUE, 'not null' => TRUE,
), ),
'count' => array( 'count' => array(
'description' => t('How many fields were modified on replacement'), 'description' => 'How many fields were modified on replacement',
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
), ),
'time' => array( 'time' => array(
'description' => t('How long the replacement took'), 'description' => 'How long the replacement took',
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
), ),
...@@ -60,20 +60,26 @@ function scanner_schema() { ...@@ -60,20 +60,26 @@ function scanner_schema() {
} }
/** /**
* Implementation of hook_install(). * Implements hook_install().
*/ */
function scanner_install() { function scanner_install() {
// Create tables. // Create tables.
drupal_install_schema('scanner'); // TODO The drupal_(un)install_schema functions are called automatically in D7.
// drupal_install_schema('scanner')
} }
/** /**
* Implementation of hook_uninstall(). * Implements hook_uninstall().
*/ */
function scanner_uninstall() { function scanner_uninstall() {
// Remove tables. // Remove tables.
drupal_uninstall_schema('scanner'); // TODO The drupal_(un)install_schema functions are called automatically in D7.
// drupal_uninstall_schema('scanner')
db_query("DELETE FROM {variable} WHERE name LIKE 'scanner_%'"); // TODO Please review the conversion of this statement to the D7 database API syntax.
/* db_query("DELETE FROM {variable} WHERE name LIKE 'scanner_%'") */
//db_delete('variable')
//->condition('name', 'scanner_%', 'LIKE')
//->execute();
} }
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment