| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
// This is the main view file used in the visual styler. It is used for both the "list" and "edit" view types. |
| 6 |
// It is accessed from /wp-admin/admin.php?page=formidable-styles&frm_action=edit&form=782 |
| 7 |
|
| 8 |
?> |
| 9 |
<div class="frm_page_container"> |
| 10 |
<?php |
| 11 |
// The embed button expects that the form ID is available as a #form_id field. |
| 12 |
?> |
| 13 |
<input type="hidden" id="form_id" value="<?php echo absint( $form->id ); ?>" /> |
| 14 |
|
| 15 |
<?php |
| 16 |
// Wrap the header in a .frm_wrap element so the h1 tag gets styled properly. |
| 17 |
// We want to avoid putting .frm_wrap on the whole page container to avoid back end styling in the visual styler preview. |
| 18 |
?> |
| 19 |
<div class="frm_wrap"> |
| 20 |
<?php |
| 21 |
FrmAppHelper::get_admin_header( |
| 22 |
array( |
| 23 |
'form' => $form, |
| 24 |
'hide_title' => true, |
| 25 |
'publish' => array( |
| 26 |
'FrmFormsController::form_publish_button', |
| 27 |
array( |
| 28 |
'values' => array( |
| 29 |
// Pass this so that the Preview dropdown works. |
| 30 |
'form_key' => $form->form_key, |
| 31 |
), |
| 32 |
), |
| 33 |
), |
| 34 |
) |
| 35 |
); |
| 36 |
?> |
| 37 |
</div> |
| 38 |
<div id="frm_styler_wrapper" class="columns-2"> |
| 39 |
<?php |
| 40 |
$view_file = 'list' === $view ? 'list' : 'edit'; |
| 41 |
// Render view based on type (either _styles-list.php or _styles-edit.php). |
| 42 |
require $style_views_path . '_styles-' . $view_file . '.php'; |
| 43 |
|
| 44 |
// Render preview container. |
| 45 |
require $style_views_path . '_style-preview-container.php'; |
| 46 |
?> |
| 47 |
</div> |
| 48 |
</div> |
| 49 |
|