| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div> |
| 7 |
<p class="frm_grid_container"> |
| 8 |
<label class="frm4 frm_form_field" for="frm_load_style"> |
| 9 |
<?php esc_html_e( 'Load form styling', 'formidable' ); ?> |
| 10 |
</label> |
| 11 |
<select id="frm_load_style" name="frm_load_style" class="frm8 frm_form_field"> |
| 12 |
<option value="all" <?php selected( $frm_settings->load_style, 'all' ); ?>> |
| 13 |
<?php esc_html_e( 'on every page of my site', 'formidable' ); ?> |
| 14 |
</option> |
| 15 |
<option value="dynamic" <?php selected( $frm_settings->load_style, 'dynamic' ); ?>> |
| 16 |
<?php esc_html_e( 'only on applicable pages', 'formidable' ); ?> |
| 17 |
</option> |
| 18 |
<option value="none" <?php selected( $frm_settings->load_style, 'none' ); ?>> |
| 19 |
<?php esc_html_e( 'Don\'t use form styling on any page', 'formidable' ); ?> |
| 20 |
</option> |
| 21 |
</select> |
| 22 |
</p> |
| 23 |
|
| 24 |
<?php do_action( 'frm_style_general_settings', $frm_settings ); ?> |
| 25 |
|
| 26 |
<p class="howto"> |
| 27 |
<?php esc_html_e( 'Easily change which style your forms are using by making changes below.', 'formidable' ); ?> |
| 28 |
</p> |
| 29 |
|
| 30 |
<?php require FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; ?> |
| 31 |
|
| 32 |
<table class="widefat fixed striped"> |
| 33 |
<thead> |
| 34 |
<tr> |
| 35 |
<th scope="col" class="column-locations"> |
| 36 |
<?php esc_html_e( 'Form Title', 'formidable' ); ?> |
| 37 |
</th> |
| 38 |
<th scope="col"> |
| 39 |
<?php esc_html_e( 'Assigned Style Templates', 'formidable' ); ?> |
| 40 |
</th> |
| 41 |
</tr> |
| 42 |
</thead> |
| 43 |
<tbody> |
| 44 |
<?php |
| 45 |
if ( $forms ) { |
| 46 |
$row_view_file_path = FrmAppHelper::plugin_path() . '/classes/views/styles/_manage-styles-row.php'; |
| 47 |
array_walk( |
| 48 |
$forms, |
| 49 |
/** |
| 50 |
* @param stdClass $form |
| 51 |
* @param array<WP_Post> $styles |
| 52 |
* @param WP_Post $default_style |
| 53 |
* @param string $row_view_file_path |
| 54 |
* |
| 55 |
* @return void |
| 56 |
*/ |
| 57 |
function ( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
| 58 |
$active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 59 |
|
| 60 |
if ( 1 === $active_style_id ) { |
| 61 |
// Use the default style |
| 62 |
$active_style_id = $default_style->ID; |
| 63 |
} |
| 64 |
|
| 65 |
include $row_view_file_path; |
| 66 |
} |
| 67 |
); |
| 68 |
} else { |
| 69 |
?> |
| 70 |
<tr> |
| 71 |
<td><?php esc_html_e( 'No Forms Found', 'formidable' ); ?></td> |
| 72 |
</tr> |
| 73 |
<?php |
| 74 |
}//end if |
| 75 |
?> |
| 76 |
</tbody> |
| 77 |
</table> |
| 78 |
</div> |
| 79 |
|