From 9bb4065755e00ed1c2ff01296673bad86cd3678c Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Mon, 6 Apr 2020 14:59:40 -0400 Subject: [PATCH] dev/core#1693 inline text title override --- CRM/Core/Smarty/plugins/function.help.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Smarty/plugins/function.help.php b/CRM/Core/Smarty/plugins/function.help.php index 8a2ba27e08a1..84a397024525 100644 --- a/CRM/Core/Smarty/plugins/function.help.php +++ b/CRM/Core/Smarty/plugins/function.help.php @@ -45,11 +45,19 @@ function smarty_function_help($params, &$smarty) { if (empty($params['title'])) { $vars = $smarty->get_template_vars(); $smarty->assign('id', $params['id'] . '-title'); + $name = trim($smarty->fetch($params['file'] . '.hlp')); + $extraoutput = ''; $additionalTPLFile = $params['file'] . '.extra.hlp'; if ($smarty->template_exists($additionalTPLFile)) { - $name .= trim($smarty->fetch($additionalTPLFile)); + $extraoutput .= trim($smarty->fetch($additionalTPLFile)); + // Allow override param to replace default text e.g. {hlp id='foo' override=1} + if ($smarty->get_template_vars('override_help_text')) { + $name = ''; + } } + $name .= $extraoutput; + // Ensure we didn't change any existing vars CRM-11900 foreach ($vars as $key => $value) { if ($smarty->get_template_vars($key) !== $value) {