| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="frm_wrap"> |
| 7 |
<form method="post"> |
| 8 |
<div class="frm_page_container"> |
| 9 |
<?php |
| 10 |
FrmAppHelper::get_admin_header( |
| 11 |
array( |
| 12 |
'label' => __( 'Manage Styles', 'formidable' ), |
| 13 |
'hide_title' => true, |
| 14 |
'publish' => array( 'FrmStylesHelper::save_button', array() ), |
| 15 |
'nav' => FrmStylesHelper::get_style_menu( 'manage' ), |
| 16 |
) |
| 17 |
); |
| 18 |
?> |
| 19 |
|
| 20 |
<div class="columns-2"> |
| 21 |
<div id="post-body-content"> |
| 22 |
|
| 23 |
<div class="frm-inner-content"> |
| 24 |
|
| 25 |
<h2 class="frm-h2"> |
| 26 |
<?php esc_html_e( 'Manage Styles', 'formidable' ); ?> |
| 27 |
</h2> |
| 28 |
<p class="howto"> |
| 29 |
<?php printf( esc_html__( 'Easily change which style your forms are using by making changes below.', 'formidable' ), '<a href="?page=formidable-styles&frm_action=new_style">', '</a>' ); ?> |
| 30 |
</p> |
| 31 |
|
| 32 |
<?php include( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); ?> |
| 33 |
|
| 34 |
<input type="hidden" name="frm_action" value="manage_styles"/> |
| 35 |
<table class="widefat fixed striped"> |
| 36 |
<thead> |
| 37 |
<tr> |
| 38 |
<th scope="col" class="column-locations"> |
| 39 |
<?php esc_html_e( 'Form Title', 'formidable' ); ?> |
| 40 |
</th> |
| 41 |
<th scope="col"> |
| 42 |
<?php esc_html_e( 'Assigned Style Templates', 'formidable' ); ?> |
| 43 |
</th> |
| 44 |
</tr> |
| 45 |
</thead> |
| 46 |
|
| 47 |
<tbody> |
| 48 |
<?php |
| 49 |
if ( $forms ) { |
| 50 |
foreach ( $forms as $form ) { |
| 51 |
$this_style = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 52 |
if ( 1 === $this_style ) { |
| 53 |
// use the default style |
| 54 |
$this_style = $default_style->ID; |
| 55 |
} |
| 56 |
?> |
| 57 |
<tr> |
| 58 |
<td class="menu-location-title"> |
| 59 |
<strong><?php echo esc_html( empty( $form->name ) ? __( '(no title)', 'formidable' ) : $form->name ); ?></strong> |
| 60 |
</td> |
| 61 |
<td> |
| 62 |
<input type="hidden" name="prev_style[<?php echo esc_attr( $form->id ); ?>]" value="<?php echo esc_attr( $this_style ); ?>" /> |
| 63 |
<select name="style[<?php echo esc_attr( $form->id ); ?>]"> |
| 64 |
<?php foreach ( $styles as $s ) { ?> |
| 65 |
<option value="<?php echo esc_attr( $s->ID ); ?>" <?php selected( $s->ID, $this_style ); ?>> |
| 66 |
<?php echo esc_html( $s->post_title . ( empty( $s->menu_order ) ? '' : ' (' . __( 'default', 'formidable' ) . ')' ) ); ?> |
| 67 |
</option> |
| 68 |
<?php } ?> |
| 69 |
<option value="" <?php selected( 0, $this_style ); ?>> |
| 70 |
<?php esc_html_e( 'Styling disabled', 'formidable' ); ?> |
| 71 |
</option> |
| 72 |
</select> |
| 73 |
|
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
<?php |
| 77 |
} |
| 78 |
} else { |
| 79 |
?> |
| 80 |
<tr> |
| 81 |
<td><?php esc_html_e( 'No Forms Found', 'formidable' ); ?></td> |
| 82 |
</tr> |
| 83 |
<?php |
| 84 |
} |
| 85 |
?> |
| 86 |
</tbody> |
| 87 |
</table> |
| 88 |
<p> |
| 89 |
<input type="submit" name="submit" class="button button-primary frm-button-primary" value="<?php esc_attr_e( 'Update', 'formidable' ); ?>" /> |
| 90 |
</p> |
| 91 |
<?php wp_nonce_field( 'frm_manage_style_nonce', 'frm_manage_style' ); ?> |
| 92 |
|
| 93 |
</div> |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
</form> |
| 97 |
</div> |
| 98 |
|