diff --git a/CRM/Core/Page/Inline/Help.php b/CRM/Core/Page/Inline/Help.php index 23f9cf12120..ed2d57e68a7 100644 --- a/CRM/Core/Page/Inline/Help.php +++ b/CRM/Core/Page/Inline/Help.php @@ -49,14 +49,16 @@ public function run() { } $smarty->assign('params', $args); + $output = $smarty->fetch($file); $extraoutput = ''; if ($smarty->template_exists($additionalTPLFile)) { - //@todo hook has been put here as a conservative approach - // but probably should always run. It doesn't run otherwise because of the exit - CRM_Utils_Hook::pageRun($this); $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')) { + $output = ''; + } } - exit($smarty->fetch($file) . $extraoutput); + exit($output . $extraoutput); } } diff --git a/CRM/Core/Smarty/plugins/block.htxt.php b/CRM/Core/Smarty/plugins/block.htxt.php index f4ae2ea53d9..be78a1d86f0 100644 --- a/CRM/Core/Smarty/plugins/block.htxt.php +++ b/CRM/Core/Smarty/plugins/block.htxt.php @@ -48,8 +48,8 @@ * the string, translated by gettext */ function smarty_block_htxt($params, $text, &$smarty) { - $id = $params['id']; - if ($id == $smarty->_tpl_vars['id']) { + if ($params['id'] == $smarty->_tpl_vars['id']) { + $smarty->assign('override_help_text', !empty($params['override'])); return $text; } else {