diff --git a/admin-dev/themes/default/template/controllers/home/content.tpl b/admin-dev/themes/default/template/controllers/home/content.tpl index 2eedbf1fd..25e145cf8 100644 --- a/admin-dev/themes/default/template/controllers/home/content.tpl +++ b/admin-dev/themes/default/template/controllers/home/content.tpl @@ -121,7 +121,7 @@ $(document).ready(function() {

{l s='Loading...'}

{hook h="displayAdminHomeInfos"} - {hook h="displayBackOfficeHome"} //old name of the hook + {hook h="displayBackOfficeHome"} {*old name of the hook*} diff --git a/classes/ImageManager.php b/classes/ImageManager.php index a59738938..c7a5ecb83 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -75,7 +75,11 @@ class ImageManagerCore ImageManager::resize($image, _PS_TMP_IMG_DIR_.$cache_image, $ratio_x, $size, $image_type); } } - return ''; + // Relative link will always work, whatever the base uri set in the admin + if (Context::getContext()->controller->controller_type == 'admin') + return ''; + else + return ''; } /** diff --git a/classes/Media.php b/classes/Media.php index f340b79f4..440818ad9 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -221,7 +221,12 @@ class MediaCore if (!preg_match('/^http(s?):\/\//i', $file_uri) && !@filemtime($file_uri)) return false; - // adding file to the big array...; + if (Context::getContext()->controller->controller_type == 'admin') + { + $js_uri = preg_replace('/^'.preg_quote(__PS_BASE_URI__, '/').'/', '/', $js_uri); + $js_uri = dirname($_SERVER['REQUEST_URI'].'a').'/..'.$js_uri; + } + return $js_uri; } @@ -243,9 +248,12 @@ class MediaCore if (!@filemtime($file_uri)) return false; - // adding file to the big array... - if (is_array($css_uri)) - return $css_uri; + if (Context::getContext()->controller->controller_type == 'admin') + { + $css_uri = preg_replace('/^'.preg_quote(__PS_BASE_URI__, '/').'/', '/', $css_uri); + $css_uri = dirname($_SERVER['REQUEST_URI'].'a').'/..'.$css_uri; + } + return array($css_uri => $css_media_type); } @@ -269,6 +277,7 @@ class MediaCore $folder = _PS_JS_DIR_.'jquery/'; //set default folder //check if file exist $file = $folder.'jquery-'.$version.($minifier ? '.min.js' : '.js'); + // remove PS_BASE_URI on _PS_ROOT_DIR_ for the following $url_data = parse_url($file); $file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']); diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index feb5f5e9d..6acb4f6f3 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1239,13 +1239,15 @@ class AdminControllerCore extends Controller else { $path_img = _PS_IMG_DIR_.'t/'.$tab['class_name'].'.png'; - $img = _PS_IMG_.'t/'.$tab['class_name'].'.png'; + // Relative link will always work, whatever the base uri set in the admin + $img = '../img/t/'.$tab['class_name'].'.png'; } if (trim($tab['module']) != '') { $path_img = _PS_MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.png'; - $img = _MODULE_DIR_.$tab['module'].'/'.$tab['class_name'].'.png'; + // Relative link will always work, whatever the base uri set in the admin + $img = '../modules/'.$tab['module'].'/'.$tab['class_name'].'.png'; } // retrocompatibility @@ -1651,7 +1653,7 @@ class AdminControllerCore extends Controller Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').(!isset($_GET['logout']) ? '&redirect='.$this->controller_name : '')); // Set current index - $current_index = __PS_BASE_URI__.basename(_PS_ADMIN_DIR_).'/index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); + $current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); if ($back = Tools::getValue('back')) $current_index .= '&back='.urlencode($back); self::$currentIndex = $current_index;