From 840e4558a73effadea54e39e4a89dccae0267003 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Dec 2023 12:31:46 +0100 Subject: [PATCH] Fix display for PWA --- htdocs/theme/eldy/manifest.json.php | 8 ++++---- htdocs/theme/md/manifest.json.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index 7ec2e7e4b22..2cae631d25b 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -73,14 +73,14 @@ $manifest->manifest_version = 3; $manifest->name = constant('DOL_APPLICATION_TITLE'); if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { - $manifest->name = $conf->global->MAIN_APPLICATION_TITLE; + $manifest->name = getDolGlobalString('MAIN_APPLICATION_TITLE'); } $manifest->short_name = $manifest->name; -$manifest->theme_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR') ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR; -$manifest->background_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR') ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR; -$manifest->display = "standalone"; +$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40')); +$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff"); +$manifest->display = getDolGlobalString('MAIN_MANIFEST_DISPLAY', "minimal-ui"); $manifest->splash_pages = null; $manifest->icons = array(); $manifest->start_url = constant('DOL_MAIN_URL_ROOT'); diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php index cef3eac9236..dc327ddf9dc 100644 --- a/htdocs/theme/md/manifest.json.php +++ b/htdocs/theme/md/manifest.json.php @@ -72,13 +72,13 @@ $manifest->manifest_version = 3; $manifest->name = constant('DOL_APPLICATION_TITLE'); if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { - $manifest->name = $conf->global->MAIN_APPLICATION_TITLE; + $manifest->name = getDolGlobalString('MAIN_APPLICATION_TITLE'); } $manifest->short_name = $manifest->name; -$manifest->theme_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR') ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR; -$manifest->background_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR') ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR; -$manifest->display = "standalone"; +$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40')); +$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff"); +$manifest->display = getDolGlobalString('MAIN_MANIFEST_DISPLAY', "minimal-ui"); $manifest->splash_pages = null; $manifest->icons = array(); $manifest->start_url = constant('DOL_MAIN_URL_ROOT'); @@ -86,8 +86,8 @@ $manifest->id = constant('DOL_MAIN_URL_ROOT'); if (getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL')) { $icon = new stdClass(); - $icon->src = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL; - if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) { + $icon->src = getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL'); + if (getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE')) { $icon->sizes = getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE') . "x" . getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE'); } else { $icon->sizes = "512x512";