<?php
defined('ABSPATH') or die('No script kiddies please!!');
$form_details = maybe_unserialize($form_row->form_details);
$preview_url = home_url() . '?std_preview=true&form_alias=' . esc_attr($form_row->form_alias) . '&_wpnonce=' . wp_create_nonce('std_form_preview_nonce');
?>
<div class="wrap std-wrap">
    <div class="std-header std-clearfix">
        <h1 class="std-floatLeft">
            <img src="<?php echo STD_URL . 'images/logo.png' ?>" class="std-plugin-logo" />
            <span class="std-sub-header"><?php esc_html_e('Edit Subscription Form', 'subscribe-to-download'); ?></span>
        </h1>
        <div class="std-add-wrap">
            <a href="javascript:void(0);" class="std-form-save-trigger"><input type="button" class="std-button-white" value="<?php esc_html_e('Save', 'subscribe-to-download'); ?>"></a>
            <a href="<?php echo esc_url($preview_url); ?>" target="_blank"><input type="button" class="std-button-orange" value="<?php esc_html_e('Preview', 'subscribe-to-download'); ?>"></a>
            <a href="<?php echo admin_url('admin.php?page=subscribe-to-download'); ?>"><input type="button" class="std-button-red" value="<?php esc_html_e('Cancel', 'subscribe-to-download'); ?>"></a>
        </div>
    </div>
    <div class="std-form-wrap std-form-add-block std-clearfix">
        <form method="post" action="" class="std-subscription-form">
            <input type="hidden" name="form_id" value="<?php echo intval($form_row->form_id); ?>" />
            <?php
            /**
             * Navigation Menu
             */
            include(STD_PATH . 'inc/views/backend/form-sections/navigation.php');
            ?>
            <div class="std-settings-section-wrap">
                <div class="std-field-wrap">
                    <label><?php esc_html_e('Shortcode', 'subscribe-to-download') ?></label>
                    <div class="std-field">
                        <span class="std-shortcode-preview">[std alias="<?php echo esc_attr($form_row->form_alias); ?>"]</span>
                        <span class="std-clipboard-copy"><i class="fas fa-clipboard-list"></i></span>
                    </div>
                </div>

                <?php
                /**
                 * Layout Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/layout-settings.php');
                ?>
                <?php
                /**
                 * Form Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/form-settings.php');
                ?>

                <?php
                /**
                 * General Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/general-settings.php');
                ?>
                <?php
                /**
                 * Email Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/email-settings.php');
                ?>
                <?php
                /**
                 * Captcha Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/captcha-settings.php');
                ?>
                <?php
                /**
                 * Custom Settings
                 */
                include(STD_PATH . 'inc/views/backend/form-sections/custom-settings.php');
                ?>
            </div>

        </form>
    </div>
</div>
<div class="std-form-message"></div>