From 89c10092a99e225a60d2e56f69c4fa1dcdecd965 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Thu, 16 Dec 2021 21:08:34 -0500 Subject: [PATCH] Standalone: fix url() fragment, and implement theme() for maintenance mode --- CRM/Utils/System/Standalone.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/System/Standalone.php b/CRM/Utils/System/Standalone.php index 24c9898ab9..c973ac8381 100644 --- a/CRM/Utils/System/Standalone.php +++ b/CRM/Utils/System/Standalone.php @@ -150,7 +150,8 @@ class CRM_Utils_System_Standalone extends CRM_Utils_System_Base { $htmlize = TRUE ) { // @todo Implement absolute etc - $url = "/{$path}?{$query}"; + $fragment = $fragment ? ('#' . $fragment) : ''; + $url = "/{$path}?{$query}$fragment"; return $url; } @@ -214,12 +215,27 @@ class CRM_Utils_System_Standalone extends CRM_Utils_System_Base { } /** - * + * @inheritDoc */ public function logout() { // @todo } + /** + * @inheritDoc + */ + public function theme(&$content, $print = FALSE, $maintenance = FALSE) { + if ($maintenance) { + $smarty = CRM_Core_Smarty::singleton(); + echo implode('', $smarty->_tpl_vars['pageHTMLHead']); + } + + // @todo Add variables from the body tag? (for Shoreditch) + + print $content; + return NULL; + } + /** * Load drupal bootstrap. * -- 2.25.1