diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9325590cc13..42396174c27 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1803,9 +1803,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print '' . "\n"; } + // To fix old chrome bug + /* if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) { print ''."\n".''."\n"; } + */ // LEAFLET AND GEOMAN if (getDolGlobalString('MAIN_USE_GEOPHP')) { diff --git a/htdocs/public/webportal/index.php b/htdocs/public/webportal/index.php index 900b2896804..f1f387b48a4 100644 --- a/htdocs/public/webportal/index.php +++ b/htdocs/public/webportal/index.php @@ -42,4 +42,6 @@ $context->controllerInstance->action(); * View */ +// $context->controllerInstance can be LoginController, DefaultController, DocumentController... + $context->controllerInstance->display(); diff --git a/htdocs/public/webportal/tpl/header.tpl.php b/htdocs/public/webportal/tpl/header.tpl.php index 1bd3aa9bef5..82f7c26ae67 100644 --- a/htdocs/public/webportal/tpl/header.tpl.php +++ b/htdocs/public/webportal/tpl/header.tpl.php @@ -15,6 +15,10 @@ * along with this program. If not, see . */ +/** + * @var Context $context Object context for webportal + */ + // Protection to avoid direct call of template if (empty($context) || !is_object($context)) { print "Error, template page can't be called as URL"; diff --git a/htdocs/public/webportal/tpl/header_login.tpl.php b/htdocs/public/webportal/tpl/header_login.tpl.php index 4819d4202c3..26f99d46b39 100644 --- a/htdocs/public/webportal/tpl/header_login.tpl.php +++ b/htdocs/public/webportal/tpl/header_login.tpl.php @@ -1,5 +1,9 @@ defaultlang, 0, 2) . '">'."\n"; ?> diff --git a/htdocs/webportal/class/context.class.php b/htdocs/webportal/class/context.class.php index d7d2f2d6a36..9ec2093ed55 100644 --- a/htdocs/webportal/class/context.class.php +++ b/htdocs/webportal/class/context.class.php @@ -179,7 +179,7 @@ class Context */ private function __construct() { - global $conf, $db; + global $db; $this->db = $db; @@ -204,7 +204,7 @@ class Context $this->initController(); - // Init de l'url de base + // Init of base URL. Must be the public URL. $this->rootUrl = self::getRootConfigUrl(); @@ -306,16 +306,14 @@ class Context */ public static function getRootConfigUrl() { - global $conf; - - // Init de l'url de base + // Init of base URL if (getDolGlobalString('WEBPORTAL_ROOT_URL')) { $rootUrl = getDolGlobalString('WEBPORTAL_ROOT_URL'); if (substr($rootUrl, -1) !== '/') { $rootUrl .= '/'; } } else { - $rootUrl = dol_buildpath('/public/webportal/', 2); + $rootUrl = dol_buildpath('/public/webportal/', 3); // Return the public URL for external access } return $rootUrl; diff --git a/htdocs/webportal/class/controller.class.php b/htdocs/webportal/class/controller.class.php index 51827a62f1b..a4d19377946 100644 --- a/htdocs/webportal/class/controller.class.php +++ b/htdocs/webportal/class/controller.class.php @@ -205,7 +205,9 @@ class Controller { global $conf, $langs, $hookmanager, $db; // may be used into the tpl - $context = Context::getInstance(); // load for tpl + // load for tpl + // This set $context->rootUrl + $context = Context::getInstance(); if (!preg_match('/^[0-9\.A-ZaZ_\-]*$/ui', $templateName)) { return false; diff --git a/htdocs/webportal/controllers/login.controller.class.php b/htdocs/webportal/controllers/login.controller.class.php index e8edfdf4e0e..9098e332adf 100644 --- a/htdocs/webportal/controllers/login.controller.class.php +++ b/htdocs/webportal/controllers/login.controller.class.php @@ -63,7 +63,7 @@ class LoginController extends Controller } /** - * Display + * Display the login page * * @return void */