I'd like it if the demo module invoked a set of hooks just after a site has been reset. For example, by implementing a hook_demo_reset() or similar, a module could run a set of commands just after the site is restored.
The use case I have for it is for resetting timers. I want to create a demo site that rebuilds itself every 2 hours. It would be nice if I could use the 'countdown' module to display a countdown to when the site will be rebuilt / reset, so users are aware of it. My first thought was to add a new block to the demo module that provided this feature. However, that's essentially re-implementing the countdown module, so I'd like it if the demo module invoked (e.g.) hook_demo_reset() after the site has been rebuilt to allow other modules update settings, etc. This would allow the countdown module to update its countdown variables, so it isn't always counting up from a past date.
Cheers,
Stella
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 489666.patch | 459 bytes | stella |
| #1 | 489666.patch | 499 bytes | stella |
Comments
Comment #1
stella commentedComment #2
sunNice. Do we have to pass that value? I think that other modules could/would need other data, while getting that variable is a no-brainer...?
Comment #3
stella commentedTrue the variable could be fetched using variable_get(), so updated patch attached.
Comment #4
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.