Author Topic: Alter config in startup  (Read 638 times)

Offline dkemens

  • Newbie
  • *
  • Posts: 6
Alter config in startup
« on: May 17, 2024, 11:22:52 AM »
Hi all,

I'm building a plugin to alter the product name (captured from a separate system) on startup. Unfortunately, it seems like the template loads before the plugin does it's business. In my template, I have

Code: [Select]
<roundcube:object name="productname">
I've tried altering this to

Code: [Select]
<roundcube:var name="config:product_name">
But it seems to make no difference.

The plugin does this:

Code: [Select]
    public function init()
    {
        $this->add_hook('startup', [$this, 'bootstrap']);
    }

    public function bootstrap($args)
    {
        Brand::init();
        $rcMail = rcmail::get_instance();

        $rcMail->config->set('product_name', Brand::getMeta('siteName'));
    }

I've tried moving the
Code: [Select]
add_hook and all logic inside of an
Code: [Select]
onload() method - but I haven't found any success yet. Anybody have any thoughts/tips?

Thanks!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,900
    • SKaero - Custom Roundcube development
Re: Alter config in startup
« Reply #1 on: May 17, 2024, 01:30:17 PM »