<?php
/**
 * Displays WPAdverts Custom Fields - Create Form Page
 * 
 * This file is a template for wp-admin / Classifieds / Options / Custom Fields / Add New panel. 
 * 
 * It is being loaded by _wpadverts_custom_fields_page_add function.
 * 
 * @see _wpadverts_custom_fields_page_add()
 * @since 1.0.0
 */
?>
<div class="wrap">
    <h2 class="">
        <?php echo esc_html( $h2_title ) ?>
         <a class="add-new-h2" href="<?php echo esc_attr( remove_query_arg( array( 'add', 'clone' ) ) ) ?>"><?php _e("Go Back", "wpadverts-custom-fields") ?></a> </h1>
    </h2>
    
    <h2 class="nav-tab-wrapper">
        <a href="<?php echo esc_attr( remove_query_arg( array( 'cfpanel', 'add', 'clone' ) ) ) ?>" class="nav-tab  nav-tab-active"><?php _e("Form Schemes", "wpadverts-custom-fields") ?></a>
        <a href="<?php echo esc_attr( add_query_arg( array('cfpanel' => 'data-sources', 'add' => false ) ) ) ?>" class="nav-tab"><?php _e("Data Sources", "wpadverts-custom-fields") ?></a>
    </h2>
    
    <?php adverts_admin_flash() ?>

    <?php if( $soft_redirect ): ?>
    
    <script type="text/javascript">
        window.location.href = '<?php echo ($soft_redirect) ?>';
    </script>
    
    <?php else: ?>
    
    <style type="text/css">
        .wpadverts-cf-clone-info {
            font-size: 13px;
            border: 1px solid #ccd0d4;
            box-shadow: 0 1px 1px rgba(0,0,0,.04);
            margin: 5px 0 15px;
            padding: 1px 12px;
            height: 29px;
            line-height: 29px;
            border-left: 4px solid #007cba;
            background-color: white;
            width: 25em;
        }
    </style>
    <form action="" method="post" class="adverts-form">
        <table class="form-table">
            <tbody>
                <?php if( $can_clone ): ?>
                <tr valign="top">
                    <th>
                        &nbsp;
                    </th>
                    <td colspan="1" style="padding-bottom:0px">
                        <div class="">
                            <div class="wpadverts-cf-clone-info">
                                <p><?php echo sprintf( __( "Clone Form '%s'", "wpadverts-custom-fields" ), $clone->post_title ) ?></p>
                             
                            </div>
                            
                        </div>
                    </td>
                </tr>
                <?php endif; ?>
                <?php echo adverts_form_layout_config($form) ?>
            </tbody>
        </table>

        <p class="submit">
            <input type="submit" value="<?php esc_attr_e($button_text) ?>" class="button-primary" name="<?php _e("Submit") ?>" />
        </p>

    </form>
    
    <?php endif; ?>

</div>
