[-] BO : #PSFV-600 - Fix bug with Controller::addJqueryUI

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13805 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-03-01 17:05:49 +00:00
parent 7ee4d89401
commit fac7db1502
2 changed files with 16 additions and 17 deletions
+6 -5
View File
@@ -301,15 +301,16 @@ abstract class ControllerCore
public function addJqueryUI($component, $theme = 'base', $check_dependencies = true) public function addJqueryUI($component, $theme = 'base', $check_dependencies = true)
{ {
$ui_path = array(); $ui_path = array();
if (is_array($component)) if (!is_array($component))
foreach ($component as $ui) $component = array($component);
$ui_path = Media::getJqueryUIPath($ui, $theme, $check_dependencies);
else
$ui_path = Media::getJqueryUIPath($component, $theme, $check_dependencies);
foreach ($component as $ui)
{
$ui_path = Media::getJqueryUIPath($ui, $theme, $check_dependencies);
$this->addCSS($ui_path['css']); $this->addCSS($ui_path['css']);
$this->addJS($ui_path['js']); $this->addJS($ui_path['js']);
} }
}
/** /**
* Add a new javascript file in page header. * Add a new javascript file in page header.
@@ -2131,10 +2131,6 @@ class AdminProductsControllerCore extends AdminController
asort($this->available_tabs, SORT_NUMERIC); asort($this->available_tabs, SORT_NUMERIC);
$this->tpl_form_vars['tabs_preloaded'] = $this->available_tabs; $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 // getLanguages init this->_languages
$this->getLanguages(); $this->getLanguages();
$languages = $this->_languages; $languages = $this->_languages;
@@ -3929,7 +3925,8 @@ class AdminProductsControllerCore extends AdminController
'ui.core', 'ui.core',
'ui.widget', 'ui.widget',
'ui.accordion', 'ui.accordion',
'ui.slider' 'ui.slider',
'ui.datepicker'
)); ));
$this->addJS(array( $this->addJS(array(
@@ -3944,7 +3941,8 @@ class AdminProductsControllerCore extends AdminController
_PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.async.js', _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.async.js',
_PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.edit.js', _PS_JS_DIR_.'jquery/plugins/treeview/jquery.treeview.edit.js',
_PS_JS_DIR_.'admin-categories-tree.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( $this->addCSS(array(