From 6f35cc3df4e63ed0789972bf6cbac1183b1a963f Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Mon, 19 Nov 2012 18:23:21 +0100 Subject: [PATCH] [-] CORE : fixed bug #PSCFV-5400 - jquery.ui.core.css is never used --- classes/Media.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/classes/Media.php b/classes/Media.php index d772f7f7f..49e7f430c 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -28,7 +28,7 @@ class MediaCore { public static $jquery_ui_dependencies = array( - 'ui.core' => array('fileName' => 'jquery.ui.core.min.js', 'dependencies' => array(), 'theme' => false), + 'ui.core' => array('fileName' => 'jquery.ui.core.min.js', 'dependencies' => array(), 'theme' => true), 'ui.widget' => array('fileName' => 'jquery.ui.widget.min.js', 'dependencies' => array(), 'theme' => false), 'ui.mouse' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => false), 'ui.position' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), @@ -309,10 +309,6 @@ class MediaCore $url_data = parse_url($folder.$file); $file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); $ui_tmp = array(); - if ($check_dependencies && array_key_exists($component, self::$jquery_ui_dependencies)) - foreach (self::$jquery_ui_dependencies[$component]['dependencies'] as $dependency) - $ui_tmp[] = Media::getJqueryUIPath($dependency, $theme, false); - if (self::$jquery_ui_dependencies[$component]['theme'] && $check_dependencies) { $theme_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.ui.theme.css'); @@ -322,7 +318,17 @@ class MediaCore if (!empty($comp_css) || $comp_css) $ui_path['css'] = array_merge($ui_path['css'], $comp_css); } - + if ($check_dependencies && array_key_exists($component, self::$jquery_ui_dependencies)) + { + foreach (self::$jquery_ui_dependencies[$component]['dependencies'] as $dependency) + { + $ui_tmp[] = Media::getJqueryUIPath($dependency, $theme, false); + if (self::$jquery_ui_dependencies[$dependency]['theme']) + $dep_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.'.$dependency.'.css'); + if (!empty($dep_css) || $dep_css) + $ui_path['css'] = array_merge($ui_path['css'], $dep_css); + } + } if (@filemtime($file_uri)) { if (!empty($ui_tmp))