Different JQuerry-ui.css for different themes

Hi everyone :)

I’m still on a pretty big project with yii framework. It’s almost completely done, now i’m focusing on theming my website.

I would like to use custom jquery-ui.css files, this is pretty easy to do. The problem is that i can’t find a way to use different jquery-ui.css files for different themes!

Let’s say i have 2 themes: classic and fancy

I created 2 foldes in “theme”, with the right files in them, everything works correctly. But when i’m trying to use a specific jquery-ui.css for each of them, i’m stuck… I can’t find a way to look for those css in the right folder. Like this tutorial explains, i created a jquery/classic folder under my general css folder, this is working, but this can’t be changed “dynamically”.

Do you know how i could use multiple CSS for jquery, depending on the selected theme?

Thanks a lot, and sorry for my poor english, it’s not my mother langage ;)

i’ve done this for a user-based theme:


<?php

//classe permettant de modifier le theme en fonction de la préférence de chacun

    class BeginRequestBehavior extends CBehavior{

        public function attach($owner){

            $owner->attachEventHandler('onBeginRequest', array($this, 'switchThemes'));

        }


        public function switchThemes($event){

           //Some logic that will determine which theme to use

           try{

           	    Yii::app()->theme = Yii::app()->user->theme;

           }catch(Exception $ex){

           		Yii::app()->theme = "classic";

           }

        }

     }

?>

and in my config file i have


'widgetFactory' => array(

            'widgets' => array(

                'CJuiAutoComplete' => array(

                    'themeUrl' => '/TriTECHSchool/themes/'.$theme.'/css',

					'theme'=>'jqueryui',		

                ),

                'CJuiDialog' => array(

                    'themeUrl' => '/TriTECHSchool/themes/'.$theme.'/css',

					'theme'=>'jqueryui',                

                ),

                'CJuiTabs' => array(

                    'themeUrl' => '/TriTECHSchool/themes/'.$theme.'/css',

					'theme'=>'jqueryui',                

                ),

                'CJuiDatePicker' => array(

                    'themeUrl' => '/TriTECHSchool/themes/'.$theme.'/css',

					'theme'=>'jqueryui',                

                ),

                'CJuiButton' => array(

                    'themeUrl' => '/TriTECHSchool/themes/'.$theme.'/css',

					'theme'=>'jqueryui',                

                ),

            ),

($theme is declared as $theme = “classic”;)

This works well for the theme (CSS, etc), as the beginrequestbehavior changes it. but the themeUrl of the Zii component does not change… Because the config file does not change. How can i edit the widget factory, based on the user theme??

Does anyone have any idea of how i can solve this?