[pmwiki-users] ZAP search and replace...

The Editor editor at fast.st
Sat Jan 27 20:44:55 CST 2007


On 1/27/07, Jiri <mail at revida.sk> wrote:
> Very usefull for the site admin but
> very, very dangereous as there is no undo.
> After a mistake you have the only chance : to check and restore all
> pages according to the Site.AllRecentChanges

Yes--powerful and dangerous. It does of course use the standard
updatepage function so changes can be restored...  I think it would be
unfeasible for there to be an automatic undo of something like this.

> Is there any change summary info generated (e.g. "ZAPreplacement")
> to identify in RecentChanges page?

If you put (:messages:) on the form it will list all the pages where
it found a match.  As for putting something in a RecentChanges page,
someone would have to show me how...

> Maybe there should be an optional window displayed
> to confirm each page and text replacement .

I don't think a confirm window for each one would be very efficient,
nor easy to do.  One could, however, do a pagelist of checkboxes for
the find term and then use that array (set to replacepage) to allow an
admin to only replace the desired instances. A bit more advanced form,
but would require no changes to ZAP code...  A nice idea--worth
putting up a snippet if anyone cares to pull it together.

Cheers,
Dan

PS. I discovered there is a bit of a problem with the invisible marker
idea.  First if you do a search and replace on the same page it
changes the marker in the form!  (ie must use for a second page...).
Second if you use [==], when the page renders the search term
disappears.  Using [=[==]=] however, (in both find and replace
portions of the form) does the trick.

Also, multi-line replaces basically seem to work fine (at least my
first try with them) but I may need to tinker some more to find an
easy way to put multi-lines in the input fields without breaking the
input markup.  Also may need a few workarounds to solve a few of
PmWiki's habits of modifying things on save, like deleting slashes,
etc.  Details, details.



More information about the pmwiki-users mailing list