Author Topic: macro proposal: saveopt and savevfs  (Read 1529 times)

0 Members and 1 Guest are viewing this topic.

Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
macro proposal: saveopt and savevfs
« 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  ;)

your computer has no brain - use your own !

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1234
  • ....... chut ! shh!
    • View Profile
Re: macro proposal: saveopt and savevfs
« Reply #1 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... :-\

 ;)

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
  • Posts: 1234
  • ....... chut ! shh!
    • View Profile
Re: macro proposal: saveopt and savevfs
« Reply #2 on: November 19, 2009, 09:07:11 PM »
Apart from that, I like the idea! ;)
« Last Edit: November 19, 2009, 10:46:24 PM by SilentPliz »

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1882
    • View Profile
Re: macro proposal: saveopt and savevfs
« Reply #3 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  ;)

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: macro proposal: saveopt and savevfs
« Reply #4 on: November 30, 2009, 10:40:28 PM »
ok