Merge pull request #22449 from mattwire/phpnotices
[civicrm-core.git] / templates / CRM / common / WizardHeader.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 {if count( $wizard.steps ) > 1}
11 {* wizard.style variable is passed by some Wizards to allow alternate styling for progress "bar". *}
12 <div id="wizard-steps">
13 <ul class="wizard-bar{if $wizard.style.barClass}-{$wizard.style.barClass}{/if}">
14 {section name=step loop=$wizard.steps}
15 {if count ( $wizard.steps ) > 5 }
16 {* truncate step titles so header isn't too wide *}
17 {assign var="title" value=$wizard.steps[step].title|crmFirstWord}
18 {else}
19 {assign var="title" value=$wizard.steps[step].title}
20 {/if}
21 {* Show each wizard link unless collapsed value is true. Also excluding quest app submit steps. Should create separate WizardHeader for Quest at some point.*}
22 {if !$wizard.steps[step].collapsed && $wizard.steps[step].name && $wizard.steps[step].name NEQ 'Submit' && $wizard.steps[step].name NEQ 'PartnerSubmit'}
23 {assign var=i value=$smarty.section.step.iteration}
24 {if $wizard.currentStepNumber > $wizard.steps[step].stepNumber}
25 {if $wizard.steps[step].step}
26 {assign var="stepClass" value="past-step"}
27 {else} {* This is a sub-step *}
28 {assign var="stepClass" value="past-sub-step"}
29 {/if}
30 {assign var="stepPrefix" value=$wizard.style.stepPrefixPast|cat:$wizard.steps[step].stepNumber|cat:". "}
31 {elseif $wizard.currentStepNumber == $wizard.steps[step].stepNumber}
32 {if $wizard.steps[step].step}
33 {assign var="stepClass" value="current-step"}
34 {else}
35 {assign var="stepClass" value="current-sub-step"}
36 {/if}
37 {assign var="stepPrefix" value=$wizard.style.stepPrefixCurrent|cat:$wizard.steps[step].stepNumber|cat:". "}
38 {else}
39 {if $wizard.steps[step].step}
40 {assign var="stepClass" value="future-step"}
41 {else}
42 {assign var="stepClass" value="future-sub-step"}
43 {/if}
44 {assign var="stepPrefix" value=$wizard.style.stepPrefixFuture|cat:$wizard.steps[step].stepNumber|cat:". "}
45 {/if}
46 {if !$wizard.steps[step].valid}
47 {assign var="stepClass" value="$stepClass not-valid"}
48 {/if}
49 {* wizard.steps[step].link value is passed for wizards/steps which allow clickable navigation *}
50 <li class="{$stepClass}">{$stepPrefix}{if $wizard.steps[step].link}<a href="{$wizard.steps[step].link}">{/if}{$title}{if $wizard.steps[step].link}</a>{/if}</li>
51 {/if}
52 {/section}
53 </ul>
54 </div>
55 {if !empty($wizard.style.showTitle)}
56 <h2>{$wizard.currentStepTitle} {ts 1=$wizard.currentStepNumber 2=$wizard.stepCount}(step %1 of %2){/ts}</h2>
57 {/if}
58 {/if}
59