Roundcube Community Forum

 

Dinamic theme change (in plugin)

Started by zgas, December 23, 2010, 02:29:51 PM

Previous topic - Next topic

zgas

I want to change theme dynamically - in plug-in.

For example if I have in url: ?skin=new_skin

The theme will be changed in "new_skin" without changes in global configuration file.

I tried this:

class sa_mobile extends rcube_plugin
{
    public 
$task '';

    function 
init() {        
        
$rcmail rcmail::get_instance();
        if (isset(
$_GET['skin'])) {
            
$rcmail->config->set('skin'$_GET['skin']);
        }                
    }
}


But theme is not changed. Config variable is changed but skin is the same.

Can you help please?

rosali

#1
Give remember_skin plugin a chance. Download see signature.

Basically your plugin should work too after you changed in main.inc.php
the skin definition to dynamic value:

$rcmail_config['skin'] = get_input_value('skin', RCUBE_INPUT_GPC);

Alternatively try to move the config overwrite from init to startup hook.
Regards,
Rosali