[Pmwiki-users] SandBox Reset

Patrick R. Michaud pmichaud
Sun Jul 18 20:56:02 CDT 2004


On Sun, Jul 18, 2004 at 02:23:41PM -0400, Kass Lloyd wrote:
> It would be useful to have a link automaticly added to the sandbox
> page(s) to reset them to a default. That way you can easyly erase what
> someone else has done and restore it to the default with just a click.
> 
> I've seen this in other Wikis.

A simplistic answer--place the following in local/Main.WikiSandbox.php:

<?php
  if ($action=='reset') @unlink("$WikiDir/$pagename");
?>

After this, adding "?action=reset" to your Main/WikiSandbox page URL
will cause it to automatically reset to the version of the page
that is in wikilib.d.  If you want to have a custom WikiSandbox page
instead of the one in wikilib.d, you can instead do something like:

<?php
  if ($action=='reset') @system("cp local/Main.WikiSandbox $WikiDir");
?>

where local/Main.WikiSandbox is a copy of the page (from wiki.d)
that you'd like to have restored.

Pm



More information about the pmwiki-users mailing list