|
24 | 24 | ); |
25 | 25 | $iawmlf_progress_pc = ( $step_data['progress']['current'] / $step_data['progress']['total'] ) * 100; |
26 | 26 | $iawmlf_rerun_wizard = isset( $_GET['rerun-wizard'] ) && '1' === sanitize_text_field( $_GET['rerun-wizard'] ); // phpcs:ignore |
| 27 | + |
| 28 | +// Based on the current step, set the button labels. |
| 29 | +switch ( $step_data['step'] ) { |
| 30 | + case 'step-1': |
| 31 | + $iawmlf_next_label = esc_html__( 'Next Step: Configure the Link Fixer', 'internet-archive-wayback-machine-link-fixer' ); |
| 32 | + $iawmlf_previous_label = ''; |
| 33 | + break; |
| 34 | + case 'step-2': |
| 35 | + $iawmlf_next_label = esc_html__( 'Next Step: Configure the Auto Archiver', 'internet-archive-wayback-machine-link-fixer' ); |
| 36 | + $iawmlf_previous_label = esc_html__( 'Previous Step: About', 'internet-archive-wayback-machine-link-fixer' ); |
| 37 | + break; |
| 38 | + case 'step-3': |
| 39 | + $iawmlf_next_label = esc_html__( 'Finish Setup', 'internet-archive-wayback-machine-link-fixer' ); |
| 40 | + $iawmlf_previous_label = esc_html__( 'Previous Step: Configure the Link Fixer', 'internet-archive-wayback-machine-link-fixer' ); |
| 41 | + break; |
| 42 | + case 'complete': |
| 43 | + $iawmlf_next_label = ''; |
| 44 | + $iawmlf_previous_label = esc_html__( 'Previous Step: Configure the Auto Archiver', 'internet-archive-wayback-machine-link-fixer' ); |
| 45 | + break; |
| 46 | +} |
27 | 47 | ?> |
28 | 48 | </div> <!-- END Wizard content --> |
29 | 49 |
|
30 | 50 | <div id="iawmlf-wizard__footer"> |
31 | | - <div class="iawmlf-wizard__footer__previous"> |
32 | | - <?php if ( 'step-1' === $step_data['step'] ) : ?> |
33 | | - <button class="button button-primary" type="button" name="" disabled <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php esc_html_e( 'Previous Step', 'internet-archive-wayback-machine-link-fixer' ); ?></button> |
34 | | - <?php elseif ( 'complete' !== $step_data['step'] || $iawmlf_rerun_wizard ) : ?> |
35 | | - <button class="button button-primary" type="submit" name="iawmlf-previous-step" <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php esc_html_e( 'Previous Step', 'internet-archive-wayback-machine-link-fixer' ); ?></button> |
36 | | - <?php endif; ?> |
37 | | - </div> |
38 | 51 | <div class="iawmlf-wizard__footer__progress"> |
39 | 52 | <?php if ( 'complete' !== $step_data['step'] ) : ?> |
40 | 53 | <div class="iawmlf-wizard__footer__progress__bar"> |
|
43 | 56 | </div> |
44 | 57 | <?php endif; ?> |
45 | 58 | </div> |
46 | | - <div class="iawmlf-wizard__footer__next"> |
| 59 | + |
| 60 | + <div class="iawmlf-wizard__footer__actions"> |
| 61 | + <div class="iawmlf-wizard__footer__previous"> |
| 62 | + <?php if ( 'step-1' === $step_data['step'] ) : ?> |
| 63 | + <span></span> |
| 64 | + <?php elseif ( 'complete' !== $step_data['step'] || $iawmlf_rerun_wizard ) : ?> |
| 65 | + <button class="button button-primary" type="submit" name="iawmlf-previous-step" <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php echo esc_html( $iawmlf_previous_label ); ?></button> |
| 66 | + <?php endif; ?> |
| 67 | + </div> |
| 68 | + <div class="iawmlf-wizard__footer__next"> |
47 | 69 | <?php if ( 'complete' !== $step_data['step'] ) : ?> |
48 | 70 | <button class="button button-primary" type="submit" name="next-step" <?php echo esc_attr( $iawmlf_next_state ); ?>><?php echo esc_html( $iawmlf_next_label ); ?></button> |
49 | 71 | <?php endif; ?> |
50 | 72 | </div> |
| 73 | + </div> |
| 74 | + |
| 75 | + |
| 76 | + |
51 | 77 | </div> |
52 | 78 | </form> <!-- END Wizard form --> |
53 | 79 | </div> <!-- END Wizard container --> |
0 commit comments