rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: bacter on November 19, 2009, 06:59:51 PM

Title: macro proposal: saveopt and savevfs
Post by: bacter on November 19, 2009, 06:59:51 PM
Templates tend to include tools for user-administration (add user, change password ..) and to allow to use the use of the {.set account|...} and {.new account|....}. Also macros to manipulate the virtual file system (adding folders ...) are used in some templates.

At the moment, we have an option in the menu that allows to save the options file 'every xxx seconds'. As there is no need to save the options file every xx seconds as no modifications goes on, and as there is no automatic saving of the virtual filesystem, i suggest two new macros that allow to do this.

{.saveopt|file/reg.}  saves the options to file or register
{.savevfs|filename.} saves te virtual filesystem to file

This allows to fire this tasks when needed, after after modifing something in accounts or in the vfs.

Another idea:
As this tasks are not needed in the template, they could be executed from the events script. As there could also be other tasks that could be executed outside of the template, i suggest also a new macro

{.toggleevent|eventname|optional parameters.}

this would allow to fire events that are defined int the events script.

{.toggleevent|_saveufs|new folder 'campics' added.}  in the template
 executes the event;
[_savevfs]
{.savevfs|Filesystem.vfs.}
{.add to log| filesystem saved. Motif: $1.}
If the use of optional parameters would be a problem, it can be implemented without them, as we can always use #vars  ;)

Title: Re: macro proposal: saveopt and savevfs
Post by: SilentPliz on November 19, 2009, 08:46:29 PM
Salut bacter !

Si tu veux des macros, j'ai l'adresse d'une bonne poissonnerie!  ;D

Je suis déjà dehors... :-\

 ;)
Title: Re: macro proposal: saveopt and savevfs
Post by: SilentPliz on November 19, 2009, 09:07:11 PM
Apart from that, I like the idea! ;)
Title: Re: macro proposal: saveopt and savevfs
Post by: Mars on November 19, 2009, 11:47:24 PM
Quote
{.toggleevent|eventname|optional parameters.}

this would allow to fire events that are defined int the events script.

{.toggleevent|_saveufs|new folder 'campics' added.}  in the template
 executes the event;
[_savevfs]
{.savevfs|Filesystem.vfs.}
{.add to log| filesystem saved. Motif: $1.}

Déjà fonctionnel mais il est trop tard pour poster maintenant  ;)
Title: Re: macro proposal: saveopt and savevfs
Post by: rejetto on November 30, 2009, 10:40:28 PM
ok