From: Coleman Watts Date: Tue, 20 Jan 2015 19:05:04 +0000 (-0500) Subject: CRM-15789 - Add helper function for button markup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c74548483d8f3abed985d774a96fa1ca49bc7954;p=civicrm-core.git CRM-15789 - Add helper function for button markup ---------------------------------------- * CRM-15789: Add icons to submit buttons https://issues.civicrm.org/jira/browse/CRM-15789 --- diff --git a/CRM/Core/Smarty/plugins/block.crmButton.php b/CRM/Core/Smarty/plugins/block.crmButton.php new file mode 100644 index 0000000000..55cb32ed6e --- /dev/null +++ b/CRM/Core/Smarty/plugins/block.crmButton.php @@ -0,0 +1,62 @@ + FALSE)); + // Always add class 'button' - fixme probably should be crm-button + $params['class'] = 'button ' . CRM_Utils_Array::value('class', $params, ''); + // Any jQuery-UI icon works + $icon = CRM_Utils_Array::value('icon', $params, 'pencil'); + // All other params are treated as html attributes + CRM_Utils_Array::remove($params, 'icon', 'p', 'q', 'a', 'f', 'h', 'fb', 'fe'); + $attributes = smarty_function_crmAttributes(array('a' => $params), CRM_Core_DAO::$_nullObject); + return " $text"; +}