Replace all instances of check.gif appearing in listings
[civicrm-core.git] / CRM / Core / Smarty / plugins / block.icon.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 *
14 * @package CRM
15 * @author Andrew Hunt, AGH Strategies
16 * $Id$
17 *
18 */
19
20 /**
21 * Display an icon with some alternative text.
22 *
23 * This is a wrapper around CRM_Core_Page::icon().
24 *
25 * @param $params
26 * - condition: if present and falsey, return empty
27 * - icon: the icon class to display instead of fa-check
28 *
29 * @param $text
30 * The translated text to include in the icon's title and screen-reader text.
31 *
32 * @param $smarty
33 *
34 * @return string
35 */
36 function smarty_block_icon($params, $text, &$smarty) {
37 $condition = array_key_exists('condition', $params) ? $params['condition'] : 1;
38 $icon = $params['icon'] ?? 'fa-check';
39 return CRM_Core_Page::crmIcon($icon, $text, $condition);
40 }