<?php

/**
 * Provide a public-facing view for the plugin
 *
 * This file is used to markup the public-facing aspects of the plugin.
 *
 * @link       https://envytheme.com
 * @since      1.0.0
 *
 * @package    Envy_Chimp
 * @subpackage Envy_Chimp/public/partials
 */  

/* ----------------------------------------------------------------------------- */
/* Subscribe form */
/* ----------------------------------------------------------------------------- */ 

function envy_chimp_subscribe_form_shortcode() { 
    $option_subscribe_style = (array)get_option('new_settings1');
    if( isset( $option_subscribe_style['option_subscribe_style'] ) ) :
        $option_subscribe_style_new = $option_subscribe_style['option_subscribe_style'];
    else: $option_subscribe_style_new = '';
    endif;

    $form_action_url = (array)get_option('new_settings1');
    if( isset($form_action_url['form_action_url']) ) :
        $form_action_url_new = $form_action_url['form_action_url'];
    else: $form_action_url_new = '';
    endif;

    $page_redirect_url = (array)get_option('new_settings1');
    if( isset($page_redirect_url['page_redirect_url']) ) :
        $page_redirect_url_new = $page_redirect_url['page_redirect_url'];
    else: $page_redirect_url_new = '';
    endif; 

    $envy_chimp_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_title['option_title']) ) :
        $envy_chimp_title_new = $envy_chimp_title['option_title'];
    else: $envy_chimp_title_new = '';
    endif;

    $envy_chimp_desc  = (array)get_option('new_settings2');
    if( isset($envy_chimp_desc['option_desc']) ) :
        $envy_chimp_desc_new = $envy_chimp_desc['option_desc'];
    else: $envy_chimp_desc_new = '';
    endif;

    $envy_chimp_heading = (array)get_option('new_settings2');
    if( isset($envy_chimp_heading['option_heading']) ) :
        $envy_chimp_heading_new = $envy_chimp_heading['option_heading'];
    else: $envy_chimp_heading_new = '';
    endif;

    $envy_chimp_email_address_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_email_address_field['option_email_address_field_text']) ) :
        $envy_chimp_email_address_field_new = $envy_chimp_email_address_field['option_email_address_field_text'];
    else: $envy_chimp_email_address_field_new = '';
    endif;

    $envy_chimp_subscribe_btn_text = (array)get_option('new_settings2');
    if( isset($envy_chimp_subscribe_btn_text['option_subscribe_btn_text']) ) :
        $envy_chimp_subscribe_btn_text_new = $envy_chimp_subscribe_btn_text['option_subscribe_btn_text'];
    else: $envy_chimp_subscribe_btn_text_new = '';
    endif; 

    $option_subscribe_success_msg = (array)get_option('new_settings2');
    if( isset($option_subscribe_success_msg['option_subscribe_success_msg']) ) :
        $option_subscribe_success_msg_new = $option_subscribe_success_msg['option_subscribe_success_msg'];
    else: $option_subscribe_success_msg_new = '';
    endif; 

    $bg_image_hide = (array)get_option('new_settings');
    if( isset( $bg_image_hide['bg_image_hide'] ) ) :
        $bg_image_hide_new = $bg_image_hide['bg_image_hide'];
    else:
        $bg_image_hide_new = '';
    endif;

    $option_social_enable = (array)get_option('new_settings4');
    if( isset( $option_social_enable['option_social_enable'] ) ) :
        $option_social_enable_new = $option_social_enable['option_social_enable'];
    else: $option_social_enable_new = '';
    endif;

    $envy_chimp_social_title = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_title['option_social_title']) ) :
        $envy_chimp_social_title_new = $envy_chimp_social_title['option_social_title'];
    else: $envy_chimp_social_title_new = '';
    endif;

    $envy_chimp_social_fb = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_fb['option_social_fb']) ) :
        $envy_chimp_social_fb_new = $envy_chimp_social_fb['option_social_fb'];
    else: $envy_chimp_social_fb_new = '';
    endif;

    $envy_chimp_social_tw = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_tw['option_social_tw']) ) :
        $envy_chimp_social_tw_new = $envy_chimp_social_tw['option_social_tw'];
    else: $envy_chimp_social_tw_new = '';
    endif;

    $envy_chimp_social_li = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_li['option_social_li']) ) :
        $envy_chimp_social_li_new = $envy_chimp_social_li['option_social_li'];
    else: $envy_chimp_social_li_new = '';
    endif;

    $envy_chimp_social_pi = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_pi['option_social_pi']) ) :
        $envy_chimp_social_pi_new = $envy_chimp_social_pi['option_social_pi'];
    else: $envy_chimp_social_pi_new = '';
    endif;

    $envy_chimp_social_yt = (array)get_option('new_settings4');
    if( isset($envy_chimp_social_yt['option_social_yt']) ) :
        $envy_chimp_social_yt_new = $envy_chimp_social_yt['option_social_yt'];
    else: $envy_chimp_social_yt_new = '';
    endif;

    $option_subscribe_area = (array)get_option('new_settings1');
    if( isset( $option_subscribe_area['option_subscribe_area'] ) ) :
        $option_subscribe_area_new = $option_subscribe_area['option_subscribe_area'];
    else:
        $option_subscribe_area_new = '';
    endif;

    ob_start();

    if( $option_subscribe_style_new == 'style-1' ) :
        require plugin_dir_path( __FILE__ ) . 'subscribe/subscribe-style-1.php';
    elseif( $option_subscribe_style_new == 'style-2' ) :
        require plugin_dir_path( __FILE__ ) . 'subscribe/subscribe-style-2.php';
    elseif( $option_subscribe_style_new == 'style-3' ) :
        require plugin_dir_path( __FILE__ ) . 'subscribe/subscribe-style-3.php';
    elseif( $option_subscribe_style_new == 'style-4' ) :
        require plugin_dir_path( __FILE__ ) . 'subscribe/subscribe-style-4.php';
    endif; 

    require plugin_dir_path( __FILE__ ) . 'subscribe/subscribe-js.php';

    return ob_get_clean();
}

add_shortcode('envy_chimp_subscribe_form', 'envy_chimp_subscribe_form_shortcode');

/* ----------------------------------------------------------------------------- */
/* Login & Signup form */
/* ----------------------------------------------------------------------------- */ 

function envy_chimp_login_signup_form_shortcode() { 
    $option_signup_style = (array)get_option('new_settings1');
    if( isset( $option_signup_style['option_signup_style'] ) ) :
        $option_signup_style_new = $option_signup_style['option_signup_style'];
    else: $option_signup_style_new = '';
    endif;

    $envy_chimp_signup_heading = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_heading['option_signup_heading']) ) :
        $envy_chimp_signup_heading_new = $envy_chimp_signup_heading['option_signup_heading'];
    else: $envy_chimp_signup_heading_new = '';
    endif;

    $envy_chimp_signup_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_title['option_signup_title']) ) :
        $envy_chimp_signup_title_new = $envy_chimp_signup_title['option_signup_title'];
    else: $envy_chimp_signup_title_new = '';
    endif;

    $envy_chimp_login_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_login_title['option_login_title']) ) :
        $envy_chimp_login_title_new = $envy_chimp_login_title['option_login_title'];
    else: $envy_chimp_login_title_new = '';
    endif;

    $envy_chimp_user_name_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_user_name_field['option_user_name_field_text']) ) :
        $envy_chimp_user_name_field_new = $envy_chimp_user_name_field['option_user_name_field_text'];
    else: $envy_chimp_user_name_field_new = '';
    endif;

    $envy_chimp_email_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_email_field['option_email_field_text']) ) :
        $envy_chimp_email_field_new = $envy_chimp_email_field['option_email_field_text'];
    else: $envy_chimp_email_field_new = '';
    endif;

    $envy_chimp_password_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_password_field['option_password_field_text']) ) :
        $envy_chimp_password_field_new = $envy_chimp_password_field['option_password_field_text'];
    else: $envy_chimp_password_field_new = '';
    endif;

    $bg_image_two_hide = (array)get_option('new_settings_two');
    if( isset( $bg_image_two_hide['bg_image_two_hide'] ) ) :
        $bg_image_two_hide_new = $bg_image_two_hide['bg_image_two_hide'];
    else:
        $bg_image_two_hide_new = '';
    endif;

    $privacy_policy_page_url = (array)get_option('new_settings1');
    if( isset($privacy_policy_page_url['privacy_policy_page_url']) ) :
        $privacy_policy_page_url_new = $privacy_policy_page_url['privacy_policy_page_url'];
    else: $privacy_policy_page_url_new = '';
    endif;

    $terms_conditions_page_url = (array)get_option('new_settings1');
    if( isset($terms_conditions_page_url['terms_conditions_page_url']) ) :
        $terms_conditions_page_url_new = $terms_conditions_page_url['terms_conditions_page_url'];
    else: $terms_conditions_page_url_new = '';
    endif;

    $option_signup_area = (array)get_option('new_settings1');
    if( isset( $option_signup_area['option_signup_area'] ) ) :
        $option_signup_area_new = $option_signup_area['option_signup_area'];
    else:
        $option_signup_area_new = '';
    endif;

    ob_start();

    if( $option_signup_style_new == 'style-1' ) :
        require plugin_dir_path( __FILE__ ) . 'login-signup/login-signup-style-1.php';
    elseif( $option_signup_style_new == 'style-2' ) :
        require plugin_dir_path( __FILE__ ) . 'login-signup/login-signup-style-2.php';
    elseif( $option_signup_style_new == 'style-3' ) :
        require plugin_dir_path( __FILE__ ) . 'login-signup/login-signup-style-3.php';
    elseif( $option_signup_style_new == 'style-4' ) :
        require plugin_dir_path( __FILE__ ) . 'login-signup/login-signup-style-4.php';
    endif;

    return ob_get_clean();

}

add_shortcode('envy_chimp_login_signup_form', 'envy_chimp_login_signup_form_shortcode');

/* ----------------------------------------------------------------------------- */
/* Login form */
/* ----------------------------------------------------------------------------- */ 

function envy_chimp_login_form_shortcode() { 
    $option_signup_style = (array)get_option('new_settings1');
    if( isset( $option_signup_style['option_signup_style'] ) ) :
        $option_signup_style_new = $option_signup_style['option_signup_style'];
    else: $option_signup_style_new = '';
    endif;

    $envy_chimp_signup_heading = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_heading['option_signup_heading']) ) :
        $envy_chimp_signup_heading_new = $envy_chimp_signup_heading['option_signup_heading'];
    else: $envy_chimp_signup_heading_new = '';
    endif;

    $envy_chimp_signup_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_title['option_signup_title']) ) :
        $envy_chimp_signup_title_new = $envy_chimp_signup_title['option_signup_title'];
    else: $envy_chimp_signup_title_new = '';
    endif;

    $envy_chimp_login_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_login_title['option_login_title']) ) :
        $envy_chimp_login_title_new = $envy_chimp_login_title['option_login_title'];
    else: $envy_chimp_login_title_new = '';
    endif;

    $envy_chimp_user_name_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_user_name_field['option_user_name_field_text']) ) :
        $envy_chimp_user_name_field_new = $envy_chimp_user_name_field['option_user_name_field_text'];
    else: $envy_chimp_user_name_field_new = '';
    endif;

    $envy_chimp_email_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_email_field['option_email_field_text']) ) :
        $envy_chimp_email_field_new = $envy_chimp_email_field['option_email_field_text'];
    else: $envy_chimp_email_field_new = '';
    endif;

    $envy_chimp_password_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_password_field['option_password_field_text']) ) :
        $envy_chimp_password_field_new = $envy_chimp_password_field['option_password_field_text'];
    else: $envy_chimp_password_field_new = '';
    endif;

    $bg_image_two_hide = (array)get_option('new_settings_two');
    if( isset( $bg_image_two_hide['bg_image_two_hide'] ) ) :
        $bg_image_two_hide_new = $bg_image_two_hide['bg_image_two_hide'];
    else:
        $bg_image_two_hide_new = '';
    endif;

    $privacy_policy_page_url = (array)get_option('new_settings1');
    if( isset($privacy_policy_page_url['privacy_policy_page_url']) ) :
        $privacy_policy_page_url_new = $privacy_policy_page_url['privacy_policy_page_url'];
    else: $privacy_policy_page_url_new = '';
    endif;

    $terms_conditions_page_url = (array)get_option('new_settings1');
    if( isset($terms_conditions_page_url['terms_conditions_page_url']) ) :
        $terms_conditions_page_url_new = $terms_conditions_page_url['terms_conditions_page_url'];
    else: $terms_conditions_page_url_new = '';
    endif;

    $option_signup_area = (array)get_option('new_settings1');
    if( isset( $option_signup_area['option_signup_area'] ) ) :
        $option_signup_area_new = $option_signup_area['option_signup_area'];
    else:
        $option_signup_area_new = '';
    endif;

    ob_start();

    if( $option_signup_style_new == 'style-1' ) :
        require plugin_dir_path( __FILE__ ) . 'login/login-style-1.php';
    elseif( $option_signup_style_new == 'style-2' ) :
        require plugin_dir_path( __FILE__ ) . 'login/login-style-2.php';
    elseif( $option_signup_style_new == 'style-3' ) :
        require plugin_dir_path( __FILE__ ) . 'login/login-style-3.php';
    elseif( $option_signup_style_new == 'style-4' ) :
        require plugin_dir_path( __FILE__ ) . 'login/login-style-4.php';
    endif;

    return ob_get_clean();

}

add_shortcode('envy_chimp_login_form', 'envy_chimp_login_form_shortcode');

/* ----------------------------------------------------------------------------- */
/* Signup form */
/* ----------------------------------------------------------------------------- */ 

function envy_chimp_signup_form_shortcode() { 
    $option_signup_style = (array)get_option('new_settings1');
    if( isset( $option_signup_style['option_signup_style'] ) ) :
        $option_signup_style_new = $option_signup_style['option_signup_style'];
    else: $option_signup_style_new = '';
    endif;

    $envy_chimp_signup_heading = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_heading['option_signup_heading']) ) :
        $envy_chimp_signup_heading_new = $envy_chimp_signup_heading['option_signup_heading'];
    else: $envy_chimp_signup_heading_new = '';
    endif;

    $envy_chimp_signup_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_signup_title['option_signup_title']) ) :
        $envy_chimp_signup_title_new = $envy_chimp_signup_title['option_signup_title'];
    else: $envy_chimp_signup_title_new = '';
    endif;

    $envy_chimp_login_title = (array)get_option('new_settings2');
    if( isset($envy_chimp_login_title['option_login_title']) ) :
        $envy_chimp_login_title_new = $envy_chimp_login_title['option_login_title'];
    else: $envy_chimp_login_title_new = '';
    endif;

    $envy_chimp_user_name_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_user_name_field['option_user_name_field_text']) ) :
        $envy_chimp_user_name_field_new = $envy_chimp_user_name_field['option_user_name_field_text'];
    else: $envy_chimp_user_name_field_new = '';
    endif;

    $envy_chimp_email_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_email_field['option_email_field_text']) ) :
        $envy_chimp_email_field_new = $envy_chimp_email_field['option_email_field_text'];
    else: $envy_chimp_email_field_new = '';
    endif;

    $envy_chimp_password_field = (array)get_option('new_settings2');
    if( isset($envy_chimp_password_field['option_password_field_text']) ) :
        $envy_chimp_password_field_new = $envy_chimp_password_field['option_password_field_text'];
    else: $envy_chimp_password_field_new = '';
    endif;

    $bg_image_two_hide = (array)get_option('new_settings_two');
    if( isset( $bg_image_two_hide['bg_image_two_hide'] ) ) :
        $bg_image_two_hide_new = $bg_image_two_hide['bg_image_two_hide'];
    else:
        $bg_image_two_hide_new = '';
    endif;

    $privacy_policy_page_url = (array)get_option('new_settings1');
    if( isset($privacy_policy_page_url['privacy_policy_page_url']) ) :
        $privacy_policy_page_url_new = $privacy_policy_page_url['privacy_policy_page_url'];
    else: $privacy_policy_page_url_new = '';
    endif;

    $terms_conditions_page_url = (array)get_option('new_settings1');
    if( isset($terms_conditions_page_url['terms_conditions_page_url']) ) :
        $terms_conditions_page_url_new = $terms_conditions_page_url['terms_conditions_page_url'];
    else: $terms_conditions_page_url_new = '';
    endif;

    $option_signup_area = (array)get_option('new_settings1');
    if( isset( $option_signup_area['option_signup_area'] ) ) :
        $option_signup_area_new = $option_signup_area['option_signup_area'];
    else:
        $option_signup_area_new = '';
    endif;

    ob_start();

    if( $option_signup_style_new == 'style-1' ) :
        require plugin_dir_path( __FILE__ ) . 'signup/signup-style-1.php';
    elseif( $option_signup_style_new == 'style-2' ) :
        require plugin_dir_path( __FILE__ ) . 'signup/signup-style-2.php';
    elseif( $option_signup_style_new == 'style-3' ) :
        require plugin_dir_path( __FILE__ ) . 'signup/signup-style-3.php';
    elseif( $option_signup_style_new == 'style-4' ) :
        require plugin_dir_path( __FILE__ ) . 'signup/signup-style-4.php';
    endif;

    return ob_get_clean();

}

add_shortcode('envy_chimp_signup_form', 'envy_chimp_signup_form_shortcode');
