From a711a9e6ee5d6506bd7cb2fb75842b20bb4d9546 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 22 Feb 2017 13:02:20 +0100 Subject: [PATCH 1/2] set 'absbaseprefix' in view which holds the current absolute url prefix this is helpful in extension --- inc/inc.ClassUI.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/inc.ClassUI.php b/inc/inc.ClassUI.php index 557c1fd5b..7b786245e 100644 --- a/inc/inc.ClassUI.php +++ b/inc/inc.ClassUI.php @@ -56,16 +56,19 @@ class UI extends UI_Default { * to rootDir or an extension dir if it has set the include path */ $filename = ''; + $httpbasedir = ''; foreach($EXT_CONF as $extname=>$extconf) { if(!isset($extconf['disable']) || $extconf['disable'] == false) { $filename = $settings->_rootDir.'ext/'.$extname.'/views/'.$theme."/class.".$class.".php"; if(file_exists($filename)) { + $httpbasedir = 'ext/'.$extname.'/'; break; } $filename = ''; if(isset($extconf['views'][$class])) { $filename = $settings->_rootDir.'ext/'.$extname.'/views/'.$theme."/".$extconf['views'][$class]['file']; if(file_exists($filename)) { + $httpbasedir = 'ext/'.$extname.'/'; $classname = $extconf['views'][$class]['name']; break; } @@ -81,6 +84,7 @@ class UI extends UI_Default { $view = new $classname($params, $theme); /* Set some configuration parameters */ $view->setParam('refferer', $_SERVER['REQUEST_URI']); + $view->setParam('absbaseprefix', $settings->_httpRoot.$httpbasedir); $view->setParam('class', $class); $view->setParam('session', $session); $view->setParam('settings', $settings); From 92a483ac8b94088747acba4550817a5a48d160c2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 22 Feb 2017 13:22:08 +0100 Subject: [PATCH 2/2] include js in footer with absolute path --- views/bootstrap/class.Bootstrap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 55e8a374b..097c7d33f 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -149,12 +149,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);; parse_str($_SERVER['QUERY_STRING'], $tmp); $tmp['action'] = 'footerjs'; $tmp['hash'] = $hashjs; - echo ''."\n"; + echo ''."\n"; } if(method_exists($this, 'js')) { parse_str($_SERVER['QUERY_STRING'], $tmp); $tmp['action'] = 'js'; - echo ''."\n"; + echo ''."\n"; } echo "\n\n"; } /* }}} */