| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | add_action( 'wp_dashboard_setup', 'fca_eoi_remove_admin_bar_link', 50 ); |
| 19 | 19 | |
| 20 | 20 | function fca_eoi_get_error_texts($post_meta) { |
| 21 | 21 | |
| 22 | - $name_error = empty ( $post_meta[ 'error_text_field_required' ] ) ? "Please enter a valid email address. For example \"hi@fatcatapps.com\"." : $post_meta[ 'error_text_field_required' ]; | |
| 22 | + $name_error = empty ( $post_meta[ 'error_text_field_required' ] ) ? "Please enter a valid email address. For example \"example@example.com\"." : $post_meta[ 'error_text_field_required' ]; | |
| 23 | 23 | $email_error = empty ( $post_meta[ 'error_text_invalid_email' ] ) ? 'Please fill out this field to continue.' : $post_meta[ 'error_text_invalid_email' ]; |
| 24 | 24 | |
| 25 | 25 | $errorTexts = array( |
| 26 | 26 | 'field_required' => $name_error, |
| @@ -102,8 +102,10 @@ | ||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $sub_msg = htmlentities ( K::get_var( 'subscribing_message', $fca_eoi_meta, 'Subscribing...' ), ENT_QUOTES, "UTF-8"); |
| 105 | 105 | |
| 106 | + $cookie_dur = K::get_var( 'success_duration', $fca_eoi_meta['publish_lightbox'], 0 ); | |
| 107 | + | |
| 106 | 108 | $layout_helper = new EasyOptInsLayout( $selected_layout ); |
| 107 | 109 | $php_path = $layout_helper->path_to_resource( 'layout', 'php' ); |
| 108 | 110 | $html_path = $layout_helper->path_to_resource( 'layout', 'html' ); |
| 109 | 111 | $html_wrap_path = $layout_helper->path_to_html_wrapper(); |
| @@ -123,9 +125,9 @@ | ||
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | //SET UP TEMPLATE |
| 126 | 128 | |
| 127 | - $layout_html = str_replace('{{{layout}}}',file_get_contents( $html_path ),file_get_contents( $html_wrap_path )); | |
| 129 | + $layout_html = str_replace('{{{layout}}}', file_get_contents( $html_path ), file_get_contents( $html_wrap_path )); | |
| 128 | 130 | |
| 129 | 131 | global $dh_easy_opt_ins_plugin; |
| 130 | 132 | |
| 131 | 133 | if ( $dh_easy_opt_ins_plugin->post_type_obj->settings[ 'distribution' ] === 'free' ) { |
| @@ -134,12 +136,31 @@ | ||
| 134 | 136 | } else { |
| 135 | 137 | $banding = ''; |
| 136 | 138 | } |
| 137 | 139 | |
| 140 | + $animation = get_post_meta( $form_id, 'fca_eoi_animation', true ); | |
| 141 | + $animation_class = ( empty ( $animation ) || $animation == 'None' ) ? '' : "animated $animation"; | |
| 142 | + | |
| 143 | + | |
| 144 | + if ( $layout_helper->layout_type === 'banner' ) { | |
| 145 | + $push_page = K::get_var( 'push_page', $fca_eoi_meta, 'on' ); | |
| 146 | + $toggle_position = K::get_var( 'toggle_overlay_position', $fca_eoi_meta, 'off' ); | |
| 147 | + | |
| 148 | + if ( $push_page === 'on' && $toggle_position === 'off' ) { | |
| 149 | + $push_page = 'down'; | |
| 150 | + } | |
| 151 | + | |
| 152 | + if ( $push_page === 'on' && $toggle_position === 'on' ) { | |
| 153 | + $push_page = 'up'; | |
| 154 | + } | |
| 155 | + } else { | |
| 156 | + $push_page = ''; | |
| 157 | + } | |
| 158 | + | |
| 138 | 159 | $form_head = $form_wrapper; |
| 139 | 160 | $form_head .= "<div id='fca_eoi_form_$form_id' class='fca_eoi_form_content'>"; |
| 140 | - $form_head .= "<form method='post' action='#' class='fca_eoi_form fca_eoi_layout_$layout_helper->layout_number $layout_helper->layout_class' "; | |
| 141 | - $form_head .= "data-fca_eoi_list_id='$list_id' data-fca_eoi_thank_you_page='$thanks_page' data-fca_eoi_thank_you_mode='$thanks_mode' data-fca_eoi_sub_msg='$sub_msg' novalidate>"; | |
| 161 | + $form_head .= "<form method='post' action='#' class='fca_eoi_form fca_eoi_layout_$layout_helper->layout_number $layout_helper->layout_class $animation_class' "; | |
| 162 | + $form_head .= "data-fca_eoi_list_id='$list_id' data-fca_eoi_push_page='$push_page' data-fca_eoi_success_cookie_duration='$cookie_dur' data-fca_eoi_thank_you_page='$thanks_page' data-fca_eoi_thank_you_mode='$thanks_mode' data-fca_eoi_sub_msg='$sub_msg' novalidate>"; | |
| 142 | 163 | $form_head .= "<input type='hidden' id='fca_eoi_form_id' name='fca_eoi_form_id' value='$form_id'>"; |
| 143 | 164 | |
| 144 | 165 | //FILL TEMPLATE |
| 145 | 166 | $layout_html = str_replace( |
| @@ -159,9 +180,9 @@ | ||
| 159 | 180 | '<div>{{{description_copy}}}</div>', |
| 160 | 181 | '<div>{{{headline_copy}}}</div>', |
| 161 | 182 | "<input class='fca_eoi_form_input_element' type='text' name='name' placeholder='{{{name_placeholder}}}'>", |
| 162 | 183 | '<input class="fca_eoi_form_input_element" type="email" name="email" placeholder="{{{email_placeholder}}}">', |
| 163 | - '<div class="fca_eoi_spiner_div"><span class="fca_eoi_loading_spinner"></span></div><input class="fca_eoi_form_button_element" type="submit" value="{{{button_copy}}}">', | |
| 184 | + '<input class="fca_eoi_form_button_element" type="submit" value="{{{button_copy}}}">', | |
| 164 | 185 | '<div>{{{privacy_copy}}}</div>', |
| 165 | 186 | $banding, |
| 166 | 187 | '<input type="hidden" name="fca_eoi" value="1"> |
| 167 | 188 | <input type="hidden" name="fca_eoi_error_texts_email" class="fca_eoi_error_texts_email" value="' . htmlspecialchars ($errorTexts['invalid_email']) . '"> |