diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php index 2a908f4f5..e6f521c12 100644 --- a/classes/controller/Controller.php +++ b/classes/controller/Controller.php @@ -301,14 +301,15 @@ abstract class ControllerCore public function addJqueryUI($component, $theme = 'base', $check_dependencies = true) { $ui_path = array(); - if (is_array($component)) - foreach ($component as $ui) - $ui_path = Media::getJqueryUIPath($ui, $theme, $check_dependencies); - else - $ui_path = Media::getJqueryUIPath($component, $theme, $check_dependencies); + if (!is_array($component)) + $component = array($component); - $this->addCSS($ui_path['css']); - $this->addJS($ui_path['js']); + foreach ($component as $ui) + { + $ui_path = Media::getJqueryUIPath($ui, $theme, $check_dependencies); + $this->addCSS($ui_path['css']); + $this->addJS($ui_path['js']); + } } /** diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 129178a24..fdc681e43 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2131,10 +2131,6 @@ class AdminProductsControllerCore extends AdminController asort($this->available_tabs, SORT_NUMERIC); $this->tpl_form_vars['tabs_preloaded'] = $this->available_tabs; - $this->addJqueryUI('ui.datepicker'); - $this->addJqueryUI('ui.slider'); - $this->addJS(_PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'); - // getLanguages init this->_languages $this->getLanguages(); $languages = $this->_languages; @@ -3928,8 +3924,9 @@ class AdminProductsControllerCore extends AdminController $this->addJqueryUI(array( 'ui.core', 'ui.widget', - 'ui.accordion', - 'ui.slider' + 'ui.accordion', + 'ui.slider', + 'ui.datepicker' )); $this->addJS(array( @@ -3944,13 +3941,14 @@ class AdminProductsControllerCore extends AdminController _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.async.js', _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.edit.js', _PS_JS_DIR_.'admin-categories-tree.js', - _PS_JS_DIR_.'/jquery/ui/jquery.ui.progressbar.min.js' + _PS_JS_DIR_.'/jquery/ui/jquery.ui.progressbar.min.js', + _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js' )); $this->addCSS(array( - _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.css', - _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css', - )); + _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.css', + _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.css', + )); } }