I’ve tried this out now.
As suggested by Wenceslaus D’silva:
$this->widget('zii.widgets.jui.CJuiTabs', array(
...
'themeUrl'=>'/css/jquery-ui-1.8/themes',
'theme'=>'redmond',
...
);
My suggestion
how to switch jui theme together with Yii theme:
1. Prepare a skin file mywebapp/protected/views/skins/CJuiTabs.php. I chose to name the skin ‘yiitheme’ since it will be controlled by the Yii theme currently selected. Save in the directory mywebapp/themes/some-yii-theme/views/skins and select an appropriate jui theme, in this example ‘redmond’.
<?php
return array(
'default'=>array(
),
'yiitheme'=>array(
'themeUrl'=>'/css/jquery-ui-1.8/themes',
'theme'=>'redmond',
),
);
?>
2. In configuration add a widget factory, set enableSkin to true and select the skin ‘theme’ for the jui widgets:
'components'=>array(
...
'widgetFactory'=>array(
'class'=>'CWidgetFactory',
'enableSkin'=>true,
'widgets' => array(
'CJuiTabs' => array(
'skin'=>'yiitheme',
),
'CJui...' => array(
'skin'=>'yiitheme',
),
...
),
),
...
),
An inherited common configuration (from CJuiWidget) seems not to be possible.
3. Now select a Yii theme and jui widgets should change jui theme too whats selected in the corresponding skin files, in my example mywebapp/themes/some-yii-theme/views/skins/CJuiTab.php, …
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
'theme'=>'some-yii-theme',
...
);
Edit:
I noticed that Qiang checked in an enhancement for release 1.1.5, enabling us to also add widget view files to the Yii themes. This looks really good.
Edit2: skin name ‘theme’ changed to ‘yiitheme’ to reduce confusion
/Tommy