This material describes problem in general:
http://greenash.net.au/thoughts/2006/05/an-undo-button-for-drupal/
As far as I'm familiar with Drupal, there's no way one could possibly create this functionality using an external module. It must be implemented in core (somewhere in db_query() function ) so it must be a patch.
Being also a desktop/flash developer I'm familiar with techniques used to provide undo/redo subsystem to these kinds of platforms.
As most of you know widely used are Command objects:
http://en.wikipedia.org/wiki/Command_pattern
As for Drupal websites there's no simple method to implement this that way. However I'm certain it can be done in quite similar fashion:
Assumptions:
1. There's more that one Undo/Redo list ( one for each admin-role user )
2. RUL (Redo/Undo List) is NOT unlimited
3. It can be turned off easily
Definitions:
Let's call each undo-able operation (INSERT, DELETE, UPDATE) a .
Where to begin ?
For me there's perfect place called . Every nice query will go through it.
Procedure of creating RUL could be similar to this:
(in db_query call)
- Check if passed query is a Command
- Extract Command Object from the query
- Calculate query with db_query()
- Calculate query with similar
- Write the object for given user to the RUL table
- Execute Command-> query
Undo handling (if possible)
(in undo handler)
- Fetch the last saved Command Object for current user
- Execute unExecute() procedure
- Remove object from DB
Additional branching, redo and Commands removal will have to be made.
It can be tedious but definitely worth it.