Author Topic: Dinamic theme change (in plugin)  (Read 7083 times)

Offline zgas

  • Newbie
  • *
  • Posts: 7
Dinamic theme change (in plugin)
« 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?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Dinamic theme change (in plugin)
« Reply #1 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.
« Last Edit: December 24, 2010, 04:25:54 AM by rosali »
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

gama18812

  • Guest
Dinamic theme change (in plugin)
« Reply #2 on: January 03, 2011, 03:29:13 AM »
i will try this later
Best Mercedes Parts]Best Mercedes Parts[/URL]