3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
13 * CiviCRM's Smarty edit-block plugin
15 * Template elements tagged {edit}...{/edit} are hidden unless action is create
16 * or update (this facilitates using form templates for read-only display).
19 * @author Piotr Szotkowski <shot@caltha.pl>
20 * @author Michal Mach <mover@artnet.org>
21 * @copyright CiviCRM LLC https://civicrm.org/licensing
26 * Smarty block function providing edit-only display support
28 * @param array $params
29 * Template call's parameters.
31 * {edit} block contents from the template.
32 * @param CRM_Core_Smarty $smarty
36 * the string, translated by gettext
38 function smarty_block_edit($params, $text, &$smarty) {
39 $action = $smarty->_tpl_vars
['action'];
40 return ($action & 3) ?
$text : NULL;