| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 6 | +--------------------------------------------------------------------+ |
| 7 | | This file is a part of CiviCRM. | |
| 8 | | | |
| 9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
| 10 | | under the terms of the GNU Affero General Public License | |
| 11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
| 12 | | | |
| 13 | | CiviCRM is distributed in the hope that it will be useful, but | |
| 14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 16 | | See the GNU Affero General Public License for more details. | |
| 17 | | | |
| 18 | | You should have received a copy of the GNU Affero General Public | |
| 19 | | License and the CiviCRM Licensing Exception along | |
| 20 | | with this program; if not, contact CiviCRM LLC | |
| 21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
| 22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
| 23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
| 24 | +--------------------------------------------------------------------+ |
| 25 | *} |
| 26 | {if count( $wizard.steps ) > 1} |
| 27 | {* wizard.style variable is passed by some Wizards to allow alternate styling for progress "bar". *} |
| 28 | <div id="wizard-steps"> |
| 29 | <ul class="wizard-bar{if $wizard.style.barClass}-{$wizard.style.barClass}{/if}"> |
| 30 | {section name=step loop=$wizard.steps} |
| 31 | {if count ( $wizard.steps ) > 5 } |
| 32 | {* truncate step titles so header isn't too wide *} |
| 33 | {assign var="title" value=$wizard.steps[step].title|crmFirstWord} |
| 34 | {else} |
| 35 | {assign var="title" value=$wizard.steps[step].title} |
| 36 | {/if} |
| 37 | {* Show each wizard link unless collapsed value is true. Also excluding quest app submit steps. Should create separate WizardHeader for Quest at some point.*} |
| 38 | {if !$wizard.steps[step].collapsed && $wizard.steps[step].name NEQ 'Submit' && $wizard.steps[step].name NEQ 'PartnerSubmit'} |
| 39 | {assign var=i value=$smarty.section.step.iteration} |
| 40 | {if $wizard.currentStepNumber > $wizard.steps[step].stepNumber} |
| 41 | {if $wizard.steps[step].step} |
| 42 | {assign var="stepClass" value="past-step"} |
| 43 | {else} {* This is a sub-step *} |
| 44 | {assign var="stepClass" value="past-sub-step"} |
| 45 | {/if} |
| 46 | {if $wizard.style.hideStepNumbers} |
| 47 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixPast} |
| 48 | {else} |
| 49 | {assign var="stepPrefix" value=$wizard.style.stepPrefixPast|cat:$wizard.steps[step].stepNumber|cat:". "} |
| 50 | {/if} |
| 51 | {elseif $wizard.currentStepNumber == $wizard.steps[step].stepNumber} |
| 52 | {if $wizard.steps[step].step} |
| 53 | {assign var="stepClass" value="current-step"} |
| 54 | {else} |
| 55 | {assign var="stepClass" value="current-sub-step"} |
| 56 | {/if} |
| 57 | {if $wizard.style.hideStepNumbers} |
| 58 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixCurrent} |
| 59 | {else} |
| 60 | {assign var="stepPrefix" value=$wizard.style.stepPrefixCurrent|cat:$wizard.steps[step].stepNumber|cat:". "} |
| 61 | {/if} |
| 62 | {else} |
| 63 | {if $wizard.steps[step].step} |
| 64 | {assign var="stepClass" value="future-step"} |
| 65 | {else} |
| 66 | {assign var="stepClass" value="future-sub-step"} |
| 67 | {/if} |
| 68 | {if $wizard.style.hideStepNumbers} |
| 69 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixFuture} |
| 70 | {else} |
| 71 | {assign var="stepPrefix" value=$wizard.style.stepPrefixFuture|cat:$wizard.steps[step].stepNumber|cat:". "} |
| 72 | {/if} |
| 73 | {/if} |
| 74 | {if !$wizard.steps[step].valid} |
| 75 | {assign var="stepClass" value="$stepClass not-valid"} |
| 76 | {/if} |
| 77 | {* wizard.steps[step].link value is passed for wizards/steps which allow clickable navigation *} |
| 78 | <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> |
| 79 | {/if} |
| 80 | {/section} |
| 81 | </ul> |
| 82 | </div> |
| 83 | {if $wizard.style.showTitle} |
| 84 | <h2>{$wizard.currentStepTitle} {ts 1=$wizard.currentStepNumber 2=$wizard.stepCount}(step %1 of %2){/ts}</h2> |
| 85 | {/if} |
| 86 | {/if} |
| 87 | |