Roundcube Community Forum

Themes & Styling => Theme Releases => Topic started by: zgas on December 23, 2010, 02:29:51 PM

Title: Dinamic theme change (in plugin)
Post by: zgas on December 23, 2010, 02:29:51 PM
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?
Title: Dinamic theme change (in plugin)
Post by: rosali on December 24, 2010, 04:19:18 AM
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.
Title: Dinamic theme change (in plugin)
Post by: gama18812 on January 03, 2011, 03:29:13 AM
i will try this later
Best Mercedes Parts (//%5Burl=http://www.incarparts.com)]Best Mercedes Parts (http://www.incarparts.com)[/URL]