Merge pull request #22449 from mattwire/phpnotices
[civicrm-core.git] / templates / CRM / common / formButtons.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10
11 {crmRegion name='form-buttons'}
12 {* Loops through $linkButtons and assigns html "a" (link) buttons to the template. Used for additional entity functions such as "Move to Case" or "Renew Membership" *}
13 {if $linkButtons}
14 {foreach from=$linkButtons item=linkButton}
15 {if $linkButton.accessKey}
16 {capture assign=accessKey}accesskey="{$linkButton.accessKey}"{/capture}
17 {else}{assign var="accessKey" value=""}
18 {/if}
19 {if $linkButton.icon}
20 {capture assign=icon}<i class="crm-i {$linkButton.icon}" aria-hidden="true"></i> {/capture}
21 {else}{assign var="icon" value=""}
22 {/if}
23 {if $linkButton.ref}
24 {capture assign=linkname}name="{$linkButton.ref}"{/capture}
25 {else}{capture assign=linkname}name="{$linkButton.name}"{/capture}
26 {/if}
27 <a class="button" {$linkname} href="{crmURL p=$linkButton.url q=$linkButton.qs}" {$accessKey} {$linkButton.extra}><span>{$icon|smarty:nodefaults}{$linkButton.title}</span></a>
28 {/foreach}
29 {/if}
30
31 {foreach from=$form.buttons item=button key=key name=btns}
32 {if $key|substring:0:4 EQ '_qf_'}
33 {if !empty($location)}
34 {$form.buttons.$key.html|crmReplace:id:"$key-$location"}
35 {else}
36 {$form.buttons.$key.html}
37 {/if}
38 {/if}
39 {/foreach}
40 {/crmRegion}