diff --git a/classes/Controller.php b/classes/Controller.php index d5ce80cfe..477f73a84 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -106,6 +106,7 @@ abstract class ControllerCore $this->display_footer = true; $this->context = Context::getContext(); + $this->context->controller = $this; $this->ajax = Tools::getValue('ajax') || Tools::isSubmit('ajax'); } @@ -185,7 +186,7 @@ abstract class ControllerCore if ($css_path) $this->css_files = array_merge($css_path, $this->css_files); } - else + else { $css_path = Media::getCSSPath($media, $css_media_type); if ($css_path) @@ -222,7 +223,7 @@ abstract class ControllerCore $this->js_files[] = $js_path; } } - + /** * Add a new javascript file in page header. * @@ -233,7 +234,7 @@ abstract class ControllerCore { $this->addJS(Media::getJqueryPath($version, $folder, $minifier)); } - + /** * Add a new javascript file in page header. * @@ -252,7 +253,7 @@ abstract class ControllerCore $this->addCSS($ui_path['css']); $this->addJS($ui_path['js']); } - + /** * Add a new javascript file in page header. * @@ -268,12 +269,12 @@ abstract class ControllerCore { $plugin_path = Media::getJqueryPluginPath($plugin); $this->addJS($plugin_path['js']); - $this->addCSS($plugin_path['css']); + $this->addCSS($plugin_path['css']); } } else $plugin_path = Media::getJqueryPluginPath($name); - + $this->addCSS($plugin_path['css']); $this->addJS($plugin_path['js']); } diff --git a/classes/FrontController.php b/classes/FrontController.php index 919115204..cc86d0137 100755 --- a/classes/FrontController.php +++ b/classes/FrontController.php @@ -338,7 +338,6 @@ class FrontControllerCore extends Controller $this->context->cart = $cart; $this->context->currency = $currency; - $this->context->controller = $this; } public function postProcess() @@ -498,10 +497,10 @@ class FrontControllerCore extends Controller public function setMedia() { $this->addCSS(_THEME_CSS_DIR_.'global.css', 'all'); - $this->addjquery(); + $this->addjquery(); $this->addjqueryPlugin('easing'); $this->addJS(_PS_JS_DIR_.'tools.js'); - + if (Tools::isSubmit('live_edit') AND Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))) { $this->addJqueryUI('ui.sortable');