[RCD] Override plugin config with user's preferences

Benjamin Meichsner benjamin.meichsner at loehr-computer.de
Tue Feb 9 17:46:10 CET 2010


hey,

I am using the plugin "automatic_addressbook" (vers. 0.1, RC vers.
0.3.1) and everything works fine, except the possibilty for the users to
override the default configuration.

I solved the problem, as I manually merged the users preferences with
the fresh loaded plugin configuration. Like this:

#automatic_addressbook.php:
...
        $this->load_config('config/config.inc.php.dist');

if(file_exists("./plugins/automatic_addressbook/config/config.inc.php"))
          $this->load_config('config/config.inc.php');
        $rcmail = rcmail::get_instance();
        $config = $rcmail->config;
        $config->merge($rcmail->user->get_prefs());

Now I am just interested if this is the prefered solution. I mean, why
is it necessary to manually merge the user's config with the plugin
defaults. Shoudn't it be done automatically?

benni




 --- 8< --- detachments --- 8< ---
 The following attachments have been detached and are available for viewing.
  http://detached.gigo.com/rc/4G/8sx3mIk1/signature.asc
 Only click these links if you trust the sender, as well as this message.
 --- 8< --- detachments --- 8< ---

-------------- next part --------------
_______________________________________________
List info: http://lists.roundcube.net/dev/


More information about the Dev mailing list