| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div> |
| 7 |
<p class="howto"> |
| 8 |
<?php esc_html_e( 'Easily change which style your forms are using by making changes below.', 'formidable' ); ?> |
| 9 |
</p> |
| 10 |
|
| 11 |
<?php include FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php'; ?> |
| 12 |
|
| 13 |
<table class="widefat fixed striped"> |
| 14 |
<thead> |
| 15 |
<tr> |
| 16 |
<th scope="col" class="column-locations"> |
| 17 |
<?php esc_html_e( 'Form Title', 'formidable' ); ?> |
| 18 |
</th> |
| 19 |
<th scope="col"> |
| 20 |
<?php esc_html_e( 'Assigned Style Templates', 'formidable' ); ?> |
| 21 |
</th> |
| 22 |
</tr> |
| 23 |
</thead> |
| 24 |
<tbody> |
| 25 |
<?php |
| 26 |
if ( $forms ) { |
| 27 |
$row_view_file_path = FrmAppHelper::plugin_path() . '/classes/views/styles/_manage-styles-row.php'; |
| 28 |
array_walk( |
| 29 |
$forms, |
| 30 |
/** |
| 31 |
* @param stdClass $form |
| 32 |
* @param array<WP_Post> $styles |
| 33 |
* @param WP_Post $default_style |
| 34 |
* @param string $row_view_file_path |
| 35 |
* @return void |
| 36 |
*/ |
| 37 |
function( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
| 38 |
$active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 39 |
if ( 1 === $active_style_id ) { |
| 40 |
// use the default style |
| 41 |
$active_style_id = $default_style->ID; |
| 42 |
} |
| 43 |
|
| 44 |
include $row_view_file_path; |
| 45 |
} |
| 46 |
); |
| 47 |
} else { |
| 48 |
?> |
| 49 |
<tr> |
| 50 |
<td><?php esc_html_e( 'No Forms Found', 'formidable' ); ?></td> |
| 51 |
</tr> |
| 52 |
<?php |
| 53 |
}//end if |
| 54 |
?> |
| 55 |
</tbody> |
| 56 |
</table> |
| 57 |
</div> |
| 58 |
|