summaryrefslogtreecommitdiff
path: root/plugins/jqueryui/jqueryui.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-10-19 15:28:11 +0000
committerthomascube <thomas@roundcube.net>2011-10-19 15:28:11 +0000
commit5da48a95224e925f4b070f2581a121516df33829 (patch)
treefadc87888faae54cdb1efc6f7b73fbfce79e0fe7 /plugins/jqueryui/jqueryui.php
parentb03854de3a36a322bf98c733ed9b75d996694e38 (diff)
Copy plugins to release branch
Diffstat (limited to 'plugins/jqueryui/jqueryui.php')
-rw-r--r--plugins/jqueryui/jqueryui.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php
new file mode 100644
index 000000000..7ed201873
--- /dev/null
+++ b/plugins/jqueryui/jqueryui.php
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * jQuery UI
+ *
+ * Provide the jQuery UI library with according themes.
+ *
+ * @version 1.8.14
+ * @author Cor Bosman <roundcube@wa.ter.net>
+ * @author Thomas Bruederli <roundcube@gmail.com>
+ */
+class jqueryui extends rcube_plugin
+{
+ public $noajax = true;
+
+ public function init()
+ {
+ $version = '1.8.14';
+
+ $rcmail = rcmail::get_instance();
+ $this->load_config();
+
+ // include UI scripts
+ $this->include_script("js/jquery-ui-$version.custom.min.js");
+
+ // include UI stylesheet
+ $skin = $rcmail->config->get('skin', 'default');
+ $ui_map = $rcmail->config->get('jquery_ui_skin_map', array());
+ $ui_theme = $ui_map[$skin] ? $ui_map[$skin] : 'default';
+
+ if (file_exists($this->home . "/themes/$ui_theme/jquery-ui-$version.custom.css")) {
+ $this->include_stylesheet("themes/$ui_theme/jquery-ui-$version.custom.css");
+ }
+ else {
+ $this->include_stylesheet("themes/default/jquery-ui-$version.custom.css");
+ }
+
+ // jquery UI localization
+ $jquery_ui_i18n = $rcmail->config->get('jquery_ui_i18n', array());
+ if (count($jquery_ui_i18n) > 0) {
+ $lang_l = str_replace('_', '-', substr($_SESSION['language'], 0, 5));
+ $lang_s = substr($_SESSION['language'], 0, 2);
+ foreach($jquery_ui_i18n as $package) {
+ if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_l.js")) {
+ $this->include_script("js/i18n/jquery.ui.$package-$lang_l.js");
+ }
+ else if (file_exists($this->home . "/js/i18n/jquery.ui.$package-$lang_s.js")) {
+ $this->include_script("js/i18n/jquery.ui.$package-$lang_s.js");
+ }
+ }
+ }
+ }
+
+}