<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals

if ( ! defined( 'ABSPATH' ) ) {
	 exit;
}

$dbhandler = new WPEFB_DBhandler();
?>

<div class="advrf-wrapper wrap wef-forms-modern wef-dashboard-modern wef-configure-modern">
    <div class="advrf-page-title">		 
        <h1 class="wpefb-page-heading">
             <?php esc_html_e( 'General Settings', 'vedrixa-forms-registration-builder' ); ?></h1>
        <ul class="advrf-nav">
            <li class="advrf-nav-item">
                <a href="<?php echo esc_url( admin_url( 'admin.php?page=wpefb_global_settings' ) ); ?>">
                    <span class="dashicons dashicons-admin-generic"></span>
                    <?php esc_html_e( 'Global Settings', 'vedrixa-forms-registration-builder' ); ?></a>
            </li>
            <li class="advrf-nav-item">
                <a href="<?php echo esc_url( admin_url( 'admin.php?page=wpefb_manage_forms' ) ); ?>">
                    <span class="dashicons dashicons-feedback"></span>
                    <?php esc_html_e( 'All Forms', 'vedrixa-forms-registration-builder' ); ?></a>
            </li>    
        </ul>

    </div>
    <div class="clearfix">
        <div class="advrf-form-conf-wrapper">
            <?php if ( absint( filter_input( INPUT_GET, 'updated', FILTER_SANITIZE_NUMBER_INT ) ) ) : ?>
                <div class="notice notice-success is-dismissible"><p><?php esc_html_e( 'General settings saved.', 'vedrixa-forms-registration-builder' ); ?></p></div>
            <?php endif; ?>
            <form action="" method="post" id="advrf_configuration_form">
                <fieldset class="advrf-config-wrap">
                    <div>

                        <div class="group-wrap">



                                
                            
                                
                            
							<?php do_action( 'wpefb_render_general_settings_extensions', $dbhandler ); ?>
                            
                            <div class="advrf-row">
                                <div class="advrf-control-label">
                                    <label><?php esc_html_e( 'Hide WordPress Toolbar', 'vedrixa-forms-registration-builder' ); ?></label>
                                </div>
                                <div class="advrf-control advrf-has-child">
                                    <input class="advrf_toggle"  type="checkbox" value="1" id="wpefb_hide_wordpress_toolbar" name="wpefb_hide_wordpress_toolbar" data-has-child="1" data-toggle-target="wpefb_hide_wordpress_toolbar_html" <?php checked( $dbhandler->get_global_option_value( 'wpefb_hide_wordpress_toolbar' ), '1' ); ?> />
                                    <label></label>
                                    <p class="description"><?php esc_html_e( 'Hides the top WordPress admin bar for logged in users.', 'vedrixa-forms-registration-builder' ); ?></p>
                                </div>  
                            </div>

                            <div class="advrf-child-rows advrf-child-options" id="wpefb_hide_wordpress_toolbar_html" style="<?php echo !empty( $dbhandler->get_global_option_value( 'wpefb_hide_wordpress_toolbar' ) ) ? '' : 'display:none'; ?>">

                                <div class="advrf-row">
                                <div class="advrf-control-label">
                                    <label><?php esc_html_e( 'Enable Toolbar for Admin(s)', 'vedrixa-forms-registration-builder' ); ?></label>
                                </div>
                                <div class="advrf-control advrf-has-child">
                                    <input class="advrf_toggle"  type="checkbox" value="1" id="wpefb_enable_admin_toolbar" name="wpefb_enable_admin_toolbar" data-has-child="1" <?php checked( $dbhandler->get_global_option_value( 'wpefb_enable_admin_toolbar' ), '1' ); ?> />
                                    <label></label>
                                    <p class="description"><?php esc_html_e( 'Allows administrator users to retain the WordPress admin bar', 'vedrixa-forms-registration-builder' ); ?></p>
                                </div>  
                            </div>


                            </div>

                            <div class="advrf-row">
                                <div class="advrf-control-label">
                                    <label><?php esc_html_e( 'Show Form Limits above the Form?', 'vedrixa-forms-registration-builder' ); ?></label>
                                </div>
                                <div class="advrf-control advrf-has-child">
                                    <input class="advrf_toggle"  type="checkbox" value="1" id="wpefb_show_limit_above_form" name="wpefb_show_limit_above_form" data-has-child="1" <?php checked( $dbhandler->get_global_option_value( 'wpefb_show_limit_above_form' ), '1' ); ?> />
                                    <label></label>
                                    <p class="description"><?php esc_html_e( 'Shows form filling status above the form when Limits are turned on. For example, "2 out 50 registrations complete" or "2 days to go before registration ends".', 'vedrixa-forms-registration-builder' ); ?></p>
                                </div>  
                            </div>
                            
        
                            
                            <div class="advrf-row">
                                <div class="advrf-control-label">
                                    <label><?php esc_html_e( 'Show Asterisk on Required Fields', 'vedrixa-forms-registration-builder' ); ?></label>
                                </div>
                                <div class="advrf-control advrf-has-child">
                                    <input class="advrf_toggle"  type="checkbox" value="1" id="wpefb_show_asterisk" name="wpefb_show_asterisk" data-has-child="1" <?php checked( $dbhandler->get_global_option_value( 'wpefb_show_asterisk' ), '1' ); ?> />
                                    <label></label>
                                    <p class="description"><?php esc_html_e( 'Show the red Asterisk(*) on top right side of the label. A common symbol for required fields.', 'vedrixa-forms-registration-builder' ); ?></p>
                                </div>  
                            </div>
                            </div>
                    </div>





                </fieldset>

                <p class="submit">
                    <?php wp_nonce_field( 'save_wpefb_global_settings' ); ?>
                    <input type="submit" value="<?php esc_attr_e( 'Save', 'vedrixa-forms-registration-builder' ); ?>" class="button button-primary" name="submit_settings" id="submit_settings" onClick="return advrf_global_settings_validation('security')"/>
                    <a class="button button-secondary" href="<?php echo esc_url( admin_url( 'admin.php?page=wpefb_global_settings' ) ); ?>"><?php esc_html_e( 'Cancel', 'vedrixa-forms-registration-builder' ); ?></a>
                    <div class="all_error_text" style="display:none;"></div>
                </p>
            </form>  
        </div>    

    </div>    
</div>
