diff options
author | Aleksander Machniak <alec@alec.pl> | 2019-08-30 13:08:48 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2019-08-30 13:08:48 +0300 |
commit | 40967393226ba41e4e0cc4a1ce9022d3fcb99a3f (patch) | |
tree | fd602c507dc648903dd357df9bfdbec5433d3356 /plugins | |
parent | bdd1b2054f4410fc8b7c3263467c25131c8b9659 (diff) |
Fix including assets that exist only in minified version
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/jqueryui/jqueryui.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php index 6e68a241c..3a1e7e97d 100644 --- a/plugins/jqueryui/jqueryui.php +++ b/plugins/jqueryui/jqueryui.php @@ -55,10 +55,10 @@ class jqueryui extends rcube_plugin $lang_s = substr($_SESSION['language'], 0, 2); foreach ($jquery_ui_i18n as $package) { - if (self::asset_exists("js/i18n/jquery.ui.$package-$lang_l.js")) { + if (self::asset_exists("js/i18n/jquery.ui.$package-$lang_l.js", false)) { $this->include_script("js/i18n/jquery.ui.$package-$lang_l.js"); } - else if (self::asset_exists("js/i18n/jquery.ui.$package-$lang_s.js")) { + else if ($lang_s != 'en' && self::asset_exists("js/i18n/jquery.ui.$package-$lang_s.js", false)) { $this->include_script("js/i18n/jquery.ui.$package-$lang_s.js"); } } @@ -143,12 +143,10 @@ class jqueryui extends rcube_plugin /** * Checks if an asset file exists in specified location (with assets_dir support) */ - protected static function asset_exists($path) + protected static function asset_exists($path, $minified = true) { - $rcube = rcube::get_instance(); - $assets_dir = $rcube->config->get('assets_dir'); - $full_path = unslashify($assets_dir ?: INSTALL_PATH) . '/plugins/jqueryui/' . $path; + $rcube = rcube::get_instance(); - return file_exists($full_path); + return $rcube->find_asset('/plugins/jqueryui/' . $path, $minified) !== null; } } |