[interchange-cvs] interchange - racke modified dist/lib/UI/pages/admin/search_replace.html

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Wed Mar 26 07:29:01 2003


User:      racke
Date:      2003-03-26 12:28:46 GMT
Modified:  dist/lib/UI/pages/admin search_replace.html
Log:
added option to replace all occurences

Revision  Changes    Path
1.6       +11 -4     interchange/dist/lib/UI/pages/admin/search_replace.html


rev 1.6, prev_rev 1.5
Index: search_replace.html
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/search_replace.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- search_replace.html	14 Jan 2003 02:25:50 -0000	1.5
+++ search_replace.html	26 Mar 2003 12:28:46 -0000	1.6
@@ -93,7 +93,7 @@
 Choose the replacement string
 </td>
 <td class=cdata width="100%">
-<input name="replace_with" type="text" size="30">
+<input name="replace_with" type="text" size="30"> Replace all occurences ? [display name=replace_all type=yesno cgi-default=1]
 <br><i>(Exact text to be inserted instead of search value. Replaces parenthisized text if parentheses are used.)</i>
 </td>
 </tr>
@@ -153,9 +153,16 @@
 	delete $Scratch->{try_message};
 
 	my @set;
-	for(@$ary) {
-		next unless $_->[1] =~ s{$regex}{$1$rw$3};
-		push @set, $_;
+	if ($CGI->{replace_all}) {
+        for(@$ary) {
+			next unless $_->[1] =~ s{$regex}{$1$rw$3}g;
+			push @set, $_;
+		}
+	} else {
+		for(@$ary) {
+			next unless $_->[1] =~ s{$regex}{$1$rw$3};
+			push @set, $_;
+		}
 	}
 
 	my @messages;