Merge pull request #23702 from colemanw/loadingPlaceholders
[civicrm-core.git] / CRM / Core / Smarty / plugins / block.htxt.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * CiviCRM's Smarty gettext plugin
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 */
18
19 /**
20 * Smarty block function providing support for
21 * CiviCRM's helptext mechanism
22 *
23 * @param array $params
24 * Template call's parameters.
25 * @param string $text
26 * {ts} block contents from the template.
27 * @param CRM_Core_Smarty $smarty
28 * The Smarty object.
29 *
30 * @return string
31 * the string, translated by gettext
32 */
33 function smarty_block_htxt($params, $text, &$smarty) {
34 if ($params['id'] == $smarty->_tpl_vars['id']) {
35 $smarty->assign('override_help_text', !empty($params['override']));
36 return $text;
37 }
38 else {
39 return NULL;
40 }
41 }