root / drupal7 / sites / all / modules / webform / templates / webform-progressbar.tpl.php @ 8c72e82a
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* @file
|
4 |
* Display the progress bar for multipage forms
|
5 |
*
|
6 |
* Available variables:
|
7 |
* - $node: The webform node.
|
8 |
* - $progressbar_page_number: TRUE if the actual page number should be
|
9 |
* displayed.
|
10 |
* - $progressbar_percent: TRUE if the percentage complete should be displayed.
|
11 |
* - $progressbar_bar: TRUE if the bar should be displayed.
|
12 |
* - $progressbar_pagebreak_labels: TRUE if the page break labels shoud be
|
13 |
* displayed.
|
14 |
|
15 |
* - $page_num: The current page number.
|
16 |
* - $page_count: The total number of pages in this form.
|
17 |
* - $page_labels: The labels for the pages. This typically includes a label for
|
18 |
* the starting page (index 0), each page in the form based on page break
|
19 |
* labels, and then the confirmation page (index number of pages + 1).
|
20 |
* - $percent: The percentage complete.
|
21 |
*/
|
22 |
?>
|
23 |
<div class="webform-progressbar"> |
24 |
<?php if ($progressbar_bar): ?> |
25 |
<div class="webform-progressbar-outer"> |
26 |
<div class="webform-progressbar-inner" style="width: <?php print number_format($percent, 0); ?>%"> </div> |
27 |
<?php for ($n = 1; $n <= $page_count; $n++): ?> |
28 |
<span class="webform-progressbar-page<?php if ($n < $page_num): print ' completed'; endif; ?><?php if ($n == $page_num): print ' current'; endif; ?>" style="<?php print ($GLOBALS['language']->direction == 0) ? 'left' : 'right'; ?>: <?php print number_format(($n - 1) / ($page_count - 1), 4) * 100; ?>%"> |
29 |
<span class="webform-progressbar-page-number"><?php print $n; ?></span> |
30 |
<?php if ($progressbar_pagebreak_labels): ?> |
31 |
<span class="webform-progressbar-page-label"> |
32 |
<?php print check_plain($page_labels[$n - 1]); ?> |
33 |
</span>
|
34 |
<?php endif; ?> |
35 |
</span>
|
36 |
<?php endfor; ?> |
37 |
</div>
|
38 |
<?php endif; ?> |
39 |
|
40 |
|
41 |
<?php if ($progressbar_page_number): ?> |
42 |
<div class="webform-progressbar-number"> |
43 |
<?php print t('Page @start of @end', array('@start' => $page_num, '@end' => $page_count)); ?> |
44 |
<?php if ($progressbar_percent): ?> |
45 |
<span class="webform-progressbar-number"> |
46 |
(<?php print number_format($percent, 0); ?>%) |
47 |
</span>
|
48 |
<?php endif; ?> |
49 |
</div>
|
50 |
<?php endif; ?> |
51 |
|
52 |
<?php if (!$progressbar_page_number && $progressbar_percent): ?> |
53 |
<div class="webform-progressbar-number"> |
54 |
<?php print number_format($percent, 0); ?>% |
55 |
</div>
|
56 |
<?php endif; ?> |
57 |
</div>
|