6 * Provide the jQuery UI library with according themes.
9 * @author Cor Bosman <roundcube@wa.ter.net>
10 * @author Thomas Bruederli <roundcube@gmail.com>
12 class jqueryui extends rcube_plugin
14 public $noajax = true;
16 public function init()
20 $rcmail = rcmail::get_instance();
24 $this->include_script("js/jquery-ui-$version.custom.min.js");
26 // include UI stylesheet
27 $skin = $rcmail->config->get('skin', 'default');
28 $ui_map = $rcmail->config->get('jquery_ui_skin_map', array());
29 $ui_theme = $ui_map[$skin] ? $ui_map[$skin] : 'default';
31 if (file_exists($this->home . "/themes/$ui_theme/jquery-ui-$version.custom.css")) {
32 $this->include_stylesheet("themes/$ui_theme/jquery-ui-$version.custom.css");
35 $this->include_stylesheet("themes/default/jquery-ui-$version.custom.css");
38 // jquery UI localization
39 $jquery_ui_i18n = $rcmail->config->get('jquery_ui_i18n', array());
40 if (count($jquery_ui_i18n) > 0) {
41 $lang_l = str_replace('_', '-', substr($_SESSION['language'], 0, 5));
42 $lang_s = substr($_SESSION['language'], 0, 2);
43 foreach($jquery_ui_i18n as $package) {
44 if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_l.js")) {
45 $this->include_script("js/i18n/jquery.ui.$package-$lang_l.js");
47 else if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_s.js")) {
48 $this->include_script("js/i18n/jquery.ui.$package-$lang_s.js");