From 26c817e6eda3edd1cad2a8413a4b8d22d7a06a84 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Mon, 10 Jul 2023 16:20:43 -0400 Subject: [PATCH] Standalone: implement basic breadcrumb --- CRM/Utils/System/Standalone.php | 17 +++++++++++++++++ css/menubar-standalone.css | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/CRM/Utils/System/Standalone.php b/CRM/Utils/System/Standalone.php index db53c0bb59..0fc6b54550 100644 --- a/CRM/Utils/System/Standalone.php +++ b/CRM/Utils/System/Standalone.php @@ -107,12 +107,17 @@ class CRM_Utils_System_Standalone extends CRM_Utils_System_Base { * @inheritDoc */ public function appendBreadCrumb($breadcrumbs) { + if (!isset(\Civi::$statics[__CLASS__]['breadcrumb'])) { + \Civi::$statics[__CLASS__]['breadcrumb'] = []; + } + \Civi::$statics[__CLASS__]['breadcrumb'][] = $breadcrumbs; } /** * @inheritDoc */ public function resetBreadCrumb() { + \Civi::$statics[__CLASS__]['breadcrumb'] = []; } /** @@ -259,6 +264,18 @@ class CRM_Utils_System_Standalone extends CRM_Utils_System_Base { echo implode('', $smarty->_tpl_vars['pageHTMLHead']); } + // Show the breadcrumb + if (!empty(\Civi::$statics[__CLASS__]['breadcrumb'])) { + print ''; + } + // @todo Add variables from the body tag? (for Shoreditch) print $content; return NULL; diff --git a/css/menubar-standalone.css b/css/menubar-standalone.css index 2aff8f0368..bcf1fb3343 100644 --- a/css/menubar-standalone.css +++ b/css/menubar-standalone.css @@ -22,3 +22,11 @@ } } + +.breadcrumb ol li { + display: inline; + list-style-type: none; +} +.breadcrumb ol li:not(:first-child)::before { + content: " \BB "; +} -- 2.25.1