|
|
|
@ -18,6 +18,7 @@ class jqueryui extends rcube_plugin
|
|
|
|
|
|
|
|
|
|
private static $features = array();
|
|
|
|
|
private static $ui_theme;
|
|
|
|
|
private static $css_path;
|
|
|
|
|
private static $skin_map = array(
|
|
|
|
|
'larry' => 'larry',
|
|
|
|
|
'default' => 'elastic',
|
|
|
|
@ -45,9 +46,11 @@ class jqueryui extends rcube_plugin
|
|
|
|
|
|
|
|
|
|
foreach ($skins as $skin) {
|
|
|
|
|
self::$ui_theme = $ui_theme = $ui_map[$skin] ?: $skin;
|
|
|
|
|
self::$css_path = $this->local_skin_path('themes', $ui_theme);
|
|
|
|
|
|
|
|
|
|
if (self::asset_exists("themes/$ui_theme/jquery-ui.css")) {
|
|
|
|
|
$this->include_stylesheet("themes/$ui_theme/jquery-ui.css");
|
|
|
|
|
$css = self::$css_path . '/jquery-ui.css';
|
|
|
|
|
if (self::asset_exists($css)) {
|
|
|
|
|
$this->include_stylesheet($css);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -104,17 +107,17 @@ class jqueryui extends rcube_plugin
|
|
|
|
|
$ui_theme = self::$ui_theme;
|
|
|
|
|
$rcube = rcube::get_instance();
|
|
|
|
|
$script = 'plugins/jqueryui/js/jquery.minicolors.min.js';
|
|
|
|
|
$css = "themes/$ui_theme/jquery.minicolors.css";
|
|
|
|
|
$css = self::$css_path . "/jquery.minicolors.css";
|
|
|
|
|
|
|
|
|
|
if (!self::asset_exists($css)) {
|
|
|
|
|
$css = "themes/larry/jquery.minicolors.css";
|
|
|
|
|
$css = "plugins/jqueryui/themes/larry/jquery.minicolors.css";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$colors_theme = $rcube->config->get('jquery_ui_colors_theme', 'default');
|
|
|
|
|
$config = array('theme' => $colors_theme);
|
|
|
|
|
$config_str = rcube_output::json_serialize($config);
|
|
|
|
|
|
|
|
|
|
$rcube->output->include_css('plugins/jqueryui/' . $css);
|
|
|
|
|
$rcube->output->include_css($css);
|
|
|
|
|
$rcube->output->include_script($script, 'head', false);
|
|
|
|
|
$rcube->output->add_script('$.fn.miniColors = $.fn.minicolors; $("input.colors").minicolors(' . $config_str . ')', 'docready');
|
|
|
|
|
$rcube->output->set_env('minicolors_config', $config);
|
|
|
|
@ -131,14 +134,14 @@ class jqueryui extends rcube_plugin
|
|
|
|
|
$script = 'plugins/jqueryui/js/jquery.tagedit.js';
|
|
|
|
|
$rcube = rcube::get_instance();
|
|
|
|
|
$ui_theme = self::$ui_theme;
|
|
|
|
|
$css = "themes/$ui_theme/tagedit.css";
|
|
|
|
|
$css = self::$css_path. "/tagedit.css";
|
|
|
|
|
|
|
|
|
|
if (!array_key_exists('elastic', (array) $rcube->output->skins)) {
|
|
|
|
|
if (!self::asset_exists($css)) {
|
|
|
|
|
$css = "themes/larry/tagedit.css";
|
|
|
|
|
$css = "plugins/jqueryui/themes/larry/tagedit.css";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$rcube->output->include_css('plugins/jqueryui/' . $css);
|
|
|
|
|
$rcube->output->include_css($css);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$rcube->output->include_script($script, 'head', false);
|
|
|
|
@ -150,7 +153,8 @@ class jqueryui extends rcube_plugin
|
|
|
|
|
protected static function asset_exists($path, $minified = true)
|
|
|
|
|
{
|
|
|
|
|
$rcube = rcube::get_instance();
|
|
|
|
|
$path = (strpos($path, 'plugins/') !== false ? '/' : '/plugins/jqueryui/') . $path;
|
|
|
|
|
|
|
|
|
|
return $rcube->find_asset('/plugins/jqueryui/' . $path, $minified) !== null;
|
|
|
|
|
return $rcube->find_asset($path, $minified) !== null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|