Optin Forms - Version 1.2.1

Version Description

  • Fixed a bug that was throwing an error when no custom form designs were registered.
Download this release

Release Info

Developer FancyThemes
Plugin Icon 128x128 Optin Forms
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.1.9 to 1.2.1

includes/functions-forms.php CHANGED
@@ -124,7 +124,7 @@ function optinform_insert_form_second_paragraph_page($content) {
124
  }
125
  return $content;
126
  }
127
-
128
  // Help us insert form in between paragraphs
129
  function optinform_insert_form_after_paragraph($insertion, $paragraph_id, $content) {
130
  $closing_p = '</p>';
@@ -147,7 +147,7 @@ function optinforms_insert_form_after_post($content) {
147
  global $optinforms_form_placement_post, $optinforms_form_exclude_posts;
148
  $optinforms_get_excluded_posts = optinforms_get_excluded_posts(); // THIS ONE IS NEW !!!
149
  if($optinforms_form_placement_post == '3' || empty($optinforms_form_placement_post)) {
150
-
151
  if(empty($optinforms_form_exclude_posts) && is_single()) {
152
  $content .= optinforms_create_form();
153
  }
@@ -202,6 +202,7 @@ function optinforms_code_comment_end(){
202
  // Form 1
203
  function optinforms_create_form() {
204
  global $optinforms_form_design;
 
205
  if($optinforms_form_design == 'optinforms_form_design_option1') {
206
  return "" . optinforms_code_comment() . "<div id=\"optinforms-form1-container\" " . optinforms_form1_get_width() . "><form method=\"post\" " . optinforms_form_target_blank() . " action=\"" . optinforms_get_form_action() . "\">" . optinforms_get_form_identifiers() . "<div id=\"optinforms-form1\" style=\"background:" . optinforms_form1_default_background() . "; border-color:" . optinforms_form1_default_border() . "\"><p id=\"optinforms-form1-title\" style=\"font-family:" . optinforms_form1_default_title_font() . "; font-size:" . optinforms_form1_default_title_size() . "; line-height:" . optinforms_form1_default_title_size() . "; color:" . optinforms_form1_default_title_color() . "\">" . optinforms_form1_default_title() ."</p><p id=\"optinforms-form1-subtitle\" style=\"font-family:" . optinforms_form1_default_subtitle_font() . "; font-size:" . optinforms_form1_default_subtitle_size() . "; line-height:" . optinforms_form1_default_subtitle_size() . "; color:" . optinforms_form1_default_subtitle_color() . "\">" . optinforms_form1_default_subtitle() . "</p><div id=\"optinforms-form1-name-field-container\"> <input type=\"text\" id=\"optinforms-form1-name-field\" name=\"" . optinforms_get_name_field() . "\" placeholder=\"" . optinforms_form1_default_name_field() . "\" style=\"font-family:" . optinforms_form1_default_fields_font() . "; font-size:" . optinforms_form1_default_fields_size() . "; color:" . optinforms_form1_default_fields_color() . "\" /></div><!--optinforms-form1-name-field-container--><div id=\"optinforms-form1-email-field-container\"><input type=\"text\" id=\"optinforms-form1-email-field\" name=\"" . optinforms_get_email_field() . "\" placeholder=\"" . optinforms_form1_default_email_field() . "\" style=\"font-family:" . optinforms_form1_default_fields_font() . "; font-size:" . optinforms_form1_default_fields_size() . "; color:" . optinforms_form1_default_fields_color() . "\" /></div><!--optinforms-form1-email-field-container--><div id=\"optinforms-form1-button-container\"><input type=\"submit\" name=\"submit\" id=\"optinforms-form1-button\" value=\"" . optinforms_form1_default_button_text() . "\" style=\"font-family:" . optinforms_form1_default_button_text_font() . "; font-size:" . optinforms_form1_default_button_text_size() . "; color:" . optinforms_form1_default_button_text_color() . "; background-color:" . optinforms_form1_default_button_background() . "\" /></div><!--optinforms-form1-button-container--><div class=\"clear\"></div><p id=\"optinforms-form1-disclaimer\" style=\"font-family:" . optinforms_form1_default_disclaimer_font() . "; font-size:" . optinforms_form1_default_disclaimer_size() . "; line-height:" . optinforms_form1_default_disclaimer_size() . "; color:" . optinforms_form1_default_disclaimer_color() . "\">" . optinforms_form1_default_disclaimer() . "</p></div><!--optinforms-form1--><div class=\"clear\"></div>" . optinforms_powered_by() . "</form></div><!--optinforms-form1-container--><div class=\"clear\"></div>" . optinforms_code_comment_end() . optinforms_form1_add_custom_css() . "";
207
  }
@@ -217,6 +218,37 @@ function optinforms_create_form() {
217
  elseif($optinforms_form_design == 'optinforms_form_design_option5') {
218
  return "" . optinforms_code_comment() . "<div id=\"optinforms-form5-container\" " . optinforms_form5_get_width() . "><form method=\"post\" " . optinforms_form_target_blank() . " action=\"" . optinforms_get_form_action() . "\">" . optinforms_get_form_identifiers() . "<div id=\"optinforms-form5\" style=\"background:" . optinforms_form5_default_background() . ";\"><div id=\"optinforms-form5-container-left\"><div id=\"optinforms-form5-title\" style=\"font-family:" . optinforms_form5_default_title_font() . "; font-size:" . optinforms_form5_default_title_size() . "; line-height:" . optinforms_form5_default_title_size() . "; color:" . optinforms_form5_default_title_color() . "\">" . optinforms_form5_default_title() ."</div><!--optinforms-form5-title--><input type=\"text\" id=\"optinforms-form5-name-field\" name=\"" . optinforms_get_name_field() . "\" placeholder=\"" . optinforms_form5_default_name_field() . "\" style=\"font-family:" . optinforms_form5_default_fields_font() . "; font-size:" . optinforms_form5_default_fields_size() . "; color:" . optinforms_form5_default_fields_color() . "\" /><input type=\"text\" id=\"optinforms-form5-email-field\" name=\"" . optinforms_get_email_field() . "\" placeholder=\"" . optinforms_form5_default_email_field() . "\" style=\"font-family:" . optinforms_form5_default_fields_font() . "; font-size:" . optinforms_form5_default_fields_size() . "; color:" . optinforms_form5_default_fields_color() . "\" /><input type=\"submit\" name=\"submit\" id=\"optinforms-form5-button\" value=\"" . optinforms_form5_default_button_text() . "\" style=\"font-family:" . optinforms_form5_default_button_text_font() . "; font-size:" . optinforms_form5_default_button_text_size() . "; color:" . optinforms_form5_default_button_text_color() . "; background-color:" . optinforms_form5_default_button_background() . "\" /></div><!--optinforms-form5-container-left--><div id=\"optinforms-form5-container-right\"><div id=\"optinforms-form5-subtitle\" style=\"font-family:" . optinforms_form5_default_subtitle_font() . "; font-size:" . optinforms_form5_default_subtitle_size() . "; color:" . optinforms_form5_default_subtitle_color() . "\">" . optinforms_form5_default_subtitle() . "</div><!--optinforms-form5-subtitle--><div id=\"optinforms-form5-disclaimer\" style=\"font-family:" . optinforms_form5_default_disclaimer_font() . "; font-size:" . optinforms_form5_default_disclaimer_size() . "; color:" . optinforms_form5_default_disclaimer_color() . "\">" . optinforms_form5_default_disclaimer() . "</div><!--optinforms-form5-disclaimer--></div><!--optinforms-form5-container-right--><div class=\"clear\"></div></div><!--optinforms-form5--><div class=\"clear\"></div>" . optinforms_powered_by() . "</form></div><!--optinforms-form5-container--><div class=\"clear\"></div>" . optinforms_code_comment_end() . optinforms_form5_add_custom_css() . "";
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
 
222
- ?>
 
 
 
 
 
 
 
 
 
 
 
124
  }
125
  return $content;
126
  }
127
+
128
  // Help us insert form in between paragraphs
129
  function optinform_insert_form_after_paragraph($insertion, $paragraph_id, $content) {
130
  $closing_p = '</p>';
147
  global $optinforms_form_placement_post, $optinforms_form_exclude_posts;
148
  $optinforms_get_excluded_posts = optinforms_get_excluded_posts(); // THIS ONE IS NEW !!!
149
  if($optinforms_form_placement_post == '3' || empty($optinforms_form_placement_post)) {
150
+
151
  if(empty($optinforms_form_exclude_posts) && is_single()) {
152
  $content .= optinforms_create_form();
153
  }
202
  // Form 1
203
  function optinforms_create_form() {
204
  global $optinforms_form_design;
205
+ // echo $optinforms_form_design;
206
  if($optinforms_form_design == 'optinforms_form_design_option1') {
207
  return "" . optinforms_code_comment() . "<div id=\"optinforms-form1-container\" " . optinforms_form1_get_width() . "><form method=\"post\" " . optinforms_form_target_blank() . " action=\"" . optinforms_get_form_action() . "\">" . optinforms_get_form_identifiers() . "<div id=\"optinforms-form1\" style=\"background:" . optinforms_form1_default_background() . "; border-color:" . optinforms_form1_default_border() . "\"><p id=\"optinforms-form1-title\" style=\"font-family:" . optinforms_form1_default_title_font() . "; font-size:" . optinforms_form1_default_title_size() . "; line-height:" . optinforms_form1_default_title_size() . "; color:" . optinforms_form1_default_title_color() . "\">" . optinforms_form1_default_title() ."</p><p id=\"optinforms-form1-subtitle\" style=\"font-family:" . optinforms_form1_default_subtitle_font() . "; font-size:" . optinforms_form1_default_subtitle_size() . "; line-height:" . optinforms_form1_default_subtitle_size() . "; color:" . optinforms_form1_default_subtitle_color() . "\">" . optinforms_form1_default_subtitle() . "</p><div id=\"optinforms-form1-name-field-container\"> <input type=\"text\" id=\"optinforms-form1-name-field\" name=\"" . optinforms_get_name_field() . "\" placeholder=\"" . optinforms_form1_default_name_field() . "\" style=\"font-family:" . optinforms_form1_default_fields_font() . "; font-size:" . optinforms_form1_default_fields_size() . "; color:" . optinforms_form1_default_fields_color() . "\" /></div><!--optinforms-form1-name-field-container--><div id=\"optinforms-form1-email-field-container\"><input type=\"text\" id=\"optinforms-form1-email-field\" name=\"" . optinforms_get_email_field() . "\" placeholder=\"" . optinforms_form1_default_email_field() . "\" style=\"font-family:" . optinforms_form1_default_fields_font() . "; font-size:" . optinforms_form1_default_fields_size() . "; color:" . optinforms_form1_default_fields_color() . "\" /></div><!--optinforms-form1-email-field-container--><div id=\"optinforms-form1-button-container\"><input type=\"submit\" name=\"submit\" id=\"optinforms-form1-button\" value=\"" . optinforms_form1_default_button_text() . "\" style=\"font-family:" . optinforms_form1_default_button_text_font() . "; font-size:" . optinforms_form1_default_button_text_size() . "; color:" . optinforms_form1_default_button_text_color() . "; background-color:" . optinforms_form1_default_button_background() . "\" /></div><!--optinforms-form1-button-container--><div class=\"clear\"></div><p id=\"optinforms-form1-disclaimer\" style=\"font-family:" . optinforms_form1_default_disclaimer_font() . "; font-size:" . optinforms_form1_default_disclaimer_size() . "; line-height:" . optinforms_form1_default_disclaimer_size() . "; color:" . optinforms_form1_default_disclaimer_color() . "\">" . optinforms_form1_default_disclaimer() . "</p></div><!--optinforms-form1--><div class=\"clear\"></div>" . optinforms_powered_by() . "</form></div><!--optinforms-form1-container--><div class=\"clear\"></div>" . optinforms_code_comment_end() . optinforms_form1_add_custom_css() . "";
208
  }
218
  elseif($optinforms_form_design == 'optinforms_form_design_option5') {
219
  return "" . optinforms_code_comment() . "<div id=\"optinforms-form5-container\" " . optinforms_form5_get_width() . "><form method=\"post\" " . optinforms_form_target_blank() . " action=\"" . optinforms_get_form_action() . "\">" . optinforms_get_form_identifiers() . "<div id=\"optinforms-form5\" style=\"background:" . optinforms_form5_default_background() . ";\"><div id=\"optinforms-form5-container-left\"><div id=\"optinforms-form5-title\" style=\"font-family:" . optinforms_form5_default_title_font() . "; font-size:" . optinforms_form5_default_title_size() . "; line-height:" . optinforms_form5_default_title_size() . "; color:" . optinforms_form5_default_title_color() . "\">" . optinforms_form5_default_title() ."</div><!--optinforms-form5-title--><input type=\"text\" id=\"optinforms-form5-name-field\" name=\"" . optinforms_get_name_field() . "\" placeholder=\"" . optinforms_form5_default_name_field() . "\" style=\"font-family:" . optinforms_form5_default_fields_font() . "; font-size:" . optinforms_form5_default_fields_size() . "; color:" . optinforms_form5_default_fields_color() . "\" /><input type=\"text\" id=\"optinforms-form5-email-field\" name=\"" . optinforms_get_email_field() . "\" placeholder=\"" . optinforms_form5_default_email_field() . "\" style=\"font-family:" . optinforms_form5_default_fields_font() . "; font-size:" . optinforms_form5_default_fields_size() . "; color:" . optinforms_form5_default_fields_color() . "\" /><input type=\"submit\" name=\"submit\" id=\"optinforms-form5-button\" value=\"" . optinforms_form5_default_button_text() . "\" style=\"font-family:" . optinforms_form5_default_button_text_font() . "; font-size:" . optinforms_form5_default_button_text_size() . "; color:" . optinforms_form5_default_button_text_color() . "; background-color:" . optinforms_form5_default_button_background() . "\" /></div><!--optinforms-form5-container-left--><div id=\"optinforms-form5-container-right\"><div id=\"optinforms-form5-subtitle\" style=\"font-family:" . optinforms_form5_default_subtitle_font() . "; font-size:" . optinforms_form5_default_subtitle_size() . "; color:" . optinforms_form5_default_subtitle_color() . "\">" . optinforms_form5_default_subtitle() . "</div><!--optinforms-form5-subtitle--><div id=\"optinforms-form5-disclaimer\" style=\"font-family:" . optinforms_form5_default_disclaimer_font() . "; font-size:" . optinforms_form5_default_disclaimer_size() . "; color:" . optinforms_form5_default_disclaimer_color() . "\">" . optinforms_form5_default_disclaimer() . "</div><!--optinforms-form5-disclaimer--></div><!--optinforms-form5-container-right--><div class=\"clear\"></div></div><!--optinforms-form5--><div class=\"clear\"></div>" . optinforms_powered_by() . "</form></div><!--optinforms-form5-container--><div class=\"clear\"></div>" . optinforms_code_comment_end() . optinforms_form5_add_custom_css() . "";
220
  }
221
+ else {
222
+ global $optinforms_forms;
223
+
224
+ // Have any custom form designs been registered?
225
+ if ( is_array( $optinforms_forms ) ) {
226
+
227
+ // Loops through registered form designs
228
+ foreach ( $optinforms_forms as $id => $design ) {
229
+
230
+ // Does the current form ID match the saved form ID?
231
+ if ( $optinforms_form_design == $design->optinform['id'] ) {
232
+
233
+ // Does the method exist to output the form?
234
+ if ( method_exists( $design, 'get_optin_form' ) ) {
235
+ return optinforms_code_comment() . '<form method="post" ' . optinforms_form_target_blank() . ' action="' . optinforms_get_form_action() . '">' . optinforms_get_form_identifiers() . $design->get_optin_form() . '</form><div class="clear">';
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
  }
242
 
243
+ /**
244
+ * Removes filters from excerpts.
245
+ */
246
+ function optinforms_remove_from_excerpt() {
247
+ remove_filter( "the_content", "optinform_insert_form_first_paragraph_post" );
248
+ remove_filter( "the_content", "optinform_insert_form_first_paragraph_page" );
249
+ remove_filter( "the_content", "optinform_insert_form_second_paragraph_post" );
250
+ remove_filter( "the_content", "optinform_insert_form_second_paragraph_page" );
251
+ remove_filter( "the_content", "optinforms_insert_form_after_post" );
252
+ remove_filter( "the_content", "optinforms_insert_form_after_page" );
253
+ }
254
+ add_filter( 'get_the_excerpt', 'optinforms_remove_from_excerpt', 1 );
includes/functions.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  // Set global variables
4
  $optinforms_email_solution = get_option('optinforms_email_solution');
5
-
6
  $optinforms_form_action_mailchimp = get_option('optinforms_form_action_mailchimp');
7
  $optinforms_form_action_madmimi = get_option('optinforms_form_action_madmimi');
8
  $optinforms_form_action_interspire = get_option('optinforms_form_action_interspire');
9
-
10
  $optinforms_form_list_name_aweber = get_option('optinforms_form_list_name_aweber');
11
  $optinforms_form_redirect_aweber = get_option('optinforms_form_redirect_aweber');
12
  $optinforms_form_listid_icontact = get_option('optinforms_form_listid_icontact');
@@ -16,10 +16,10 @@
16
  $optinforms_form_error_icontact = get_option('optinforms_form_error_icontact');
17
  $optinforms_form_webformid_getresponse = get_option('optinforms_form_webformid_getresponse');
18
  $optinforms_form_name_field_interspire = get_option('optinforms_form_name_field_interspire');
19
-
20
  $optinforms_included_fonts = array ("Arial", "Baumans", "Belgrano", "Chewy", "Cinzel Decorative", "Coming Soon", "Contrail One", "Damion", "Dancing Script", "Droid Sans", "Droid Serif", "Englebert", "Fenix", "Flavors", "Fredoka One", "Georgia", "Gloria Hallelujah", "Gochi Hand", "Grand Hotel", "Helvetica", "Lobster", "Luckiest Guy", "Marcellus SC", "News Cycle", "Nixie One", "Oleo Script", "Open Sans", "Oswald", "Overlock SC", "Pacifico", "Parisienne", "Quicksand", "Racing Sans One", "Roboto Condensed", "Russo One", "Sanchez", "Shadows Into Light", "Share Tech", "Signika Negative", "Tahoma", "Times New Roman", "Titan One", "Unkempt", "Verdana", "Viga");
21
  $optinforms_included_fonts_simple = array ("Arial, Helvetica, sans-serif", "Times New Roman, Times, serif", "Tahoma, Geneva, sans-serif", "Courier New, Courier, monospace", "Georgia, Times New Roman, Times, serif", "Trebuchet MS, Arial, sans-serif", "Verdana, Geneva, sans-serif", "Palatino Linotype, Book Antiqua, serif");
22
-
23
  $optinforms_form_design = get_option('optinforms_form_design');
24
  $optinforms_form_placement_post = get_option('optinforms_form_placement_post');
25
  $optinforms_form_placement_page = get_option('optinforms_form_placement_page');
@@ -60,7 +60,7 @@ function optinforms_get_form_action() {
60
  elseif($optinforms_email_solution == 'optinforms_email_solution_option1') {
61
  return "https://www.aweber.com/scripts/addlead.pl";
62
  }
63
-
64
  // add iContact form action
65
  elseif($optinforms_email_solution == 'optinforms_email_solution_option2') {
66
  return "https://app.icontact.com/icp/signup.php";
@@ -367,7 +367,7 @@ function optinforms_configuration_message() {
367
  function optinforms_dismiss_admin_notice() {
368
  global $current_user;
369
  $userid = $current_user->ID;
370
-
371
  // If "Dismiss" link has been clicked, user meta field is added
372
  if ( isset( $_GET['optinforms_dismiss_ec'] ) && 'yes' == $_GET['optinforms_dismiss_ec'] ) {
373
  add_user_meta( $userid, 'optinforms_dismiss_email_configuration', 'yes', true );
@@ -408,18 +408,18 @@ function optinforms_get_used_fonts() {
408
  $optinforms_unsupported_fonts = array("Arial", "Georgia", "Helvetica", "Tahoma", "Times New Roman", "Verdana");
409
  if($optinforms_form_design == 'optinforms_form_design_option1' || empty($optinforms_form_design)) {
410
  global $optinforms_form1_title_font, $optinforms_form1_subtitle_font;
411
-
412
  // Strip unsupported fonts to prevent 'Forbidden' output
413
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form1_default_title_font());
414
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form1_default_subtitle_font());
415
-
416
  // Decide whether we need a delimiter
417
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
418
  $optinforms_font_delimiter = "";
419
  } else {
420
  $optinforms_font_delimiter = "%7C";
421
  }
422
-
423
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
424
  }
425
  elseif($optinforms_form_design == 'optinforms_form_design_option2') {
@@ -431,50 +431,50 @@ function optinforms_get_used_fonts() {
431
  }
432
  elseif($optinforms_form_design == 'optinforms_form_design_option3') {
433
  global $optinforms_form3_title_font, $optinforms_form3_subtitle_font;
434
-
435
  // Strip unsupported fonts to prevent 'Forbidden' output
436
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form3_default_title_font());
437
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form3_default_subtitle_font());
438
-
439
  // Decide whether we need a delimiter
440
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
441
  $optinforms_font_delimiter = "";
442
  } else {
443
  $optinforms_font_delimiter = "%7C";
444
  }
445
-
446
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
447
  }
448
  elseif($optinforms_form_design == 'optinforms_form_design_option4') {
449
  global $optinforms_form4_title_font, $optinforms_form4_subtitle_font;
450
-
451
  // Strip unsupported fonts to prevent 'Forbidden' output
452
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form4_default_title_font());
453
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form4_default_subtitle_font());
454
-
455
  // Decide whether we need a delimiter
456
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
457
  $optinforms_font_delimiter = "";
458
  } else {
459
  $optinforms_font_delimiter = "%7C";
460
  }
461
-
462
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
463
  }
464
  elseif($optinforms_form_design == 'optinforms_form_design_option5') {
465
  global $optinforms_form5_title_font, $optinforms_form5_subtitle_font;
466
-
467
  // Strip unsupported fonts to prevent 'Forbidden' output
468
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form5_default_title_font());
469
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form5_default_subtitle_font());
470
-
471
  // Decide whether we need a delimiter
472
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
473
  $optinforms_font_delimiter = "";
474
  } else {
475
  $optinforms_font_delimiter = "%7C";
476
  }
477
-
478
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
479
  }
480
  }
2
 
3
  // Set global variables
4
  $optinforms_email_solution = get_option('optinforms_email_solution');
5
+
6
  $optinforms_form_action_mailchimp = get_option('optinforms_form_action_mailchimp');
7
  $optinforms_form_action_madmimi = get_option('optinforms_form_action_madmimi');
8
  $optinforms_form_action_interspire = get_option('optinforms_form_action_interspire');
9
+
10
  $optinforms_form_list_name_aweber = get_option('optinforms_form_list_name_aweber');
11
  $optinforms_form_redirect_aweber = get_option('optinforms_form_redirect_aweber');
12
  $optinforms_form_listid_icontact = get_option('optinforms_form_listid_icontact');
16
  $optinforms_form_error_icontact = get_option('optinforms_form_error_icontact');
17
  $optinforms_form_webformid_getresponse = get_option('optinforms_form_webformid_getresponse');
18
  $optinforms_form_name_field_interspire = get_option('optinforms_form_name_field_interspire');
19
+
20
  $optinforms_included_fonts = array ("Arial", "Baumans", "Belgrano", "Chewy", "Cinzel Decorative", "Coming Soon", "Contrail One", "Damion", "Dancing Script", "Droid Sans", "Droid Serif", "Englebert", "Fenix", "Flavors", "Fredoka One", "Georgia", "Gloria Hallelujah", "Gochi Hand", "Grand Hotel", "Helvetica", "Lobster", "Luckiest Guy", "Marcellus SC", "News Cycle", "Nixie One", "Oleo Script", "Open Sans", "Oswald", "Overlock SC", "Pacifico", "Parisienne", "Quicksand", "Racing Sans One", "Roboto Condensed", "Russo One", "Sanchez", "Shadows Into Light", "Share Tech", "Signika Negative", "Tahoma", "Times New Roman", "Titan One", "Unkempt", "Verdana", "Viga");
21
  $optinforms_included_fonts_simple = array ("Arial, Helvetica, sans-serif", "Times New Roman, Times, serif", "Tahoma, Geneva, sans-serif", "Courier New, Courier, monospace", "Georgia, Times New Roman, Times, serif", "Trebuchet MS, Arial, sans-serif", "Verdana, Geneva, sans-serif", "Palatino Linotype, Book Antiqua, serif");
22
+
23
  $optinforms_form_design = get_option('optinforms_form_design');
24
  $optinforms_form_placement_post = get_option('optinforms_form_placement_post');
25
  $optinforms_form_placement_page = get_option('optinforms_form_placement_page');
60
  elseif($optinforms_email_solution == 'optinforms_email_solution_option1') {
61
  return "https://www.aweber.com/scripts/addlead.pl";
62
  }
63
+
64
  // add iContact form action
65
  elseif($optinforms_email_solution == 'optinforms_email_solution_option2') {
66
  return "https://app.icontact.com/icp/signup.php";
367
  function optinforms_dismiss_admin_notice() {
368
  global $current_user;
369
  $userid = $current_user->ID;
370
+
371
  // If "Dismiss" link has been clicked, user meta field is added
372
  if ( isset( $_GET['optinforms_dismiss_ec'] ) && 'yes' == $_GET['optinforms_dismiss_ec'] ) {
373
  add_user_meta( $userid, 'optinforms_dismiss_email_configuration', 'yes', true );
408
  $optinforms_unsupported_fonts = array("Arial", "Georgia", "Helvetica", "Tahoma", "Times New Roman", "Verdana");
409
  if($optinforms_form_design == 'optinforms_form_design_option1' || empty($optinforms_form_design)) {
410
  global $optinforms_form1_title_font, $optinforms_form1_subtitle_font;
411
+
412
  // Strip unsupported fonts to prevent 'Forbidden' output
413
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form1_default_title_font());
414
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form1_default_subtitle_font());
415
+
416
  // Decide whether we need a delimiter
417
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
418
  $optinforms_font_delimiter = "";
419
  } else {
420
  $optinforms_font_delimiter = "%7C";
421
  }
422
+
423
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
424
  }
425
  elseif($optinforms_form_design == 'optinforms_form_design_option2') {
431
  }
432
  elseif($optinforms_form_design == 'optinforms_form_design_option3') {
433
  global $optinforms_form3_title_font, $optinforms_form3_subtitle_font;
434
+
435
  // Strip unsupported fonts to prevent 'Forbidden' output
436
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form3_default_title_font());
437
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form3_default_subtitle_font());
438
+
439
  // Decide whether we need a delimiter
440
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
441
  $optinforms_font_delimiter = "";
442
  } else {
443
  $optinforms_font_delimiter = "%7C";
444
  }
445
+
446
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
447
  }
448
  elseif($optinforms_form_design == 'optinforms_form_design_option4') {
449
  global $optinforms_form4_title_font, $optinforms_form4_subtitle_font;
450
+
451
  // Strip unsupported fonts to prevent 'Forbidden' output
452
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form4_default_title_font());
453
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form4_default_subtitle_font());
454
+
455
  // Decide whether we need a delimiter
456
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
457
  $optinforms_font_delimiter = "";
458
  } else {
459
  $optinforms_font_delimiter = "%7C";
460
  }
461
+
462
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
463
  }
464
  elseif($optinforms_form_design == 'optinforms_form_design_option5') {
465
  global $optinforms_form5_title_font, $optinforms_form5_subtitle_font;
466
+
467
  // Strip unsupported fonts to prevent 'Forbidden' output
468
  $optinforms_first_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form5_default_title_font());
469
  $optinforms_second_used_font = str_replace($optinforms_unsupported_fonts, "", optinforms_form5_default_subtitle_font());
470
+
471
  // Decide whether we need a delimiter
472
  if($optinforms_first_used_font == "" || $optinforms_second_used_font == ""){
473
  $optinforms_font_delimiter = "";
474
  } else {
475
  $optinforms_font_delimiter = "%7C";
476
  }
477
+
478
  return $optinforms_first_used_font . $optinforms_font_delimiter . $optinforms_second_used_font;
479
  }
480
  }
includes/options-form-5.php CHANGED
@@ -3,7 +3,7 @@
3
  <span class="trigger">
4
  <a><?php echo __('Style Your Form', 'optin-forms'); ?></a>
5
  </span>
6
-
7
  <div class="toggle-container" style="display: none;">
8
  <div class="optiongroup">
9
  <div class="optionleft">
@@ -21,17 +21,17 @@
21
  $("#optinforms-form5").css( 'background-color', ui.color.toString());
22
  }
23
  });
24
- });
25
  </script>
26
  </div><!--optionmiddle-->
27
  <div class="optionlast">
28
-
29
  </div><!--optionlast-->
30
  <div class="clear"></div>
31
  </div><!--optiongroup-->
32
-
33
  <?php if (get_option('optinforms_form5_hide_title')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your title in Form Options', 'optin-forms') . '.</p></div>'; } ?>
34
-
35
  <div class="optiongroup">
36
  <div class="optionleft">
37
  <label for="optinforms_form5_title" class="nopointer"><?php echo __('Title', 'optin-forms'); ?></label>
@@ -45,11 +45,11 @@
45
  </script>
46
  </div><!--optionmiddle-->
47
  <div class="optionlast">
48
-
49
  </div><!--optionlast-->
50
  <div class="clear"></div>
51
  </div><!--optiongroup-->
52
-
53
  <div class="optiongroup">
54
  <div class="optionleft">
55
  <label for="optinforms_form5_title_font" class="nopointer"><?php echo __('Title font', 'optin-forms'); ?></label>
@@ -65,11 +65,11 @@
65
  </script>
66
  </div><!--optionmiddle-->
67
  <div class="optionlast">
68
-
69
  </div><!--optionlast-->
70
  <div class="clear"></div>
71
  </div><!--optiongroup-->
72
-
73
  <div class="optiongroup">
74
  <div class="optionleft">
75
  <label for="optinforms_form5_title_size" class="nopointer"><?php echo __('Title size', 'optin-forms'); ?></label>
@@ -86,11 +86,11 @@
86
  </script>
87
  </div><!--optionmiddle-->
88
  <div class="optionlast">
89
-
90
  </div><!--optionlast-->
91
  <div class="clear"></div>
92
  </div><!--optiongroup-->
93
-
94
  <div class="optiongroup">
95
  <div class="optionleft">
96
  <label for="optinforms_form5_title_color" class="nopointer"><?php echo __('Title color', 'optin-forms'); ?></label>
@@ -107,17 +107,17 @@
107
  $("#optinforms-form5-title").css( 'color', ui.color.toString());
108
  }
109
  });
110
- });
111
  </script>
112
  </div><!--optionmiddle-->
113
  <div class="optionlast">
114
-
115
  </div><!--optionlast-->
116
  <div class="clear"></div>
117
  </div><!--optiongroup-->
118
-
119
  <?php if (get_option('optinforms_form5_hide_subtitle')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your subtitle in Form Options', 'optin-forms') . '.</p></div>'; } ?>
120
-
121
  <div class="optiongroup">
122
  <div class="optionleft">
123
  <label for="optinforms_form5_subtitle" class="nopointer"><?php echo __('Subtitle', 'optin-forms'); ?></label>
@@ -131,11 +131,11 @@
131
  </script>
132
  </div><!--optionmiddle-->
133
  <div class="optionlast">
134
-
135
  </div><!--optionlast-->
136
  <div class="clear"></div>
137
  </div><!--optiongroup-->
138
-
139
  <div class="optiongroup">
140
  <div class="optionleft">
141
  <label for="optinforms_form5_subtitle_font" class="nopointer"><?php echo __('Subtitle font', 'optin-forms'); ?></label>
@@ -151,11 +151,11 @@
151
  </script>
152
  </div><!--optionmiddle-->
153
  <div class="optionlast">
154
-
155
  </div><!--optionlast-->
156
  <div class="clear"></div>
157
  </div><!--optiongroup-->
158
-
159
  <div class="optiongroup">
160
  <div class="optionleft">
161
  <label for="optinforms_form5_subtitle_size" class="nopointer"><?php echo __('Subtitle size', 'optin-forms'); ?></label>
@@ -171,11 +171,11 @@
171
  </script>
172
  </div><!--optionmiddle-->
173
  <div class="optionlast">
174
-
175
  </div><!--optionlast-->
176
  <div class="clear"></div>
177
  </div><!--optiongroup-->
178
-
179
  <div class="optiongroup">
180
  <div class="optionleft">
181
  <label for="optinforms_form5_subtitle_color" class="nopointer"><?php echo __('Subtitle color', 'optin-forms'); ?></label>
@@ -192,17 +192,17 @@
192
  $("#optinforms-form5-subtitle").css( 'color', ui.color.toString());
193
  }
194
  });
195
- });
196
  </script>
197
  </div><!--optionmiddle-->
198
  <div class="optionlast">
199
-
200
  </div><!--optionlast-->
201
  <div class="clear"></div>
202
  </div><!--optiongroup-->
203
-
204
  <?php if (get_option('optinforms_form5_hide_name_field')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your name field in Form Options', 'optin-forms') . '.</p></div>'; } ?>
205
-
206
  <div class="optiongroup">
207
  <div class="optionleft">
208
  <label for="optinforms_form5_name_field" class="nopointer"><?php echo __('Input field: name', 'optin-forms'); ?></label>
@@ -216,11 +216,11 @@
216
  </script>
217
  </div><!--optionmiddle-->
218
  <div class="optionlast">
219
-
220
  </div><!--optionlast-->
221
  <div class="clear"></div>
222
  </div><!--optiongroup-->
223
-
224
  <div class="optiongroup">
225
  <div class="optionleft">
226
  <label for="optinforms_form5_email_field" class="nopointer"><?php echo __('Input field: email', 'optin-forms'); ?></label>
@@ -234,11 +234,11 @@
234
  </script>
235
  </div><!--optionmiddle-->
236
  <div class="optionlast">
237
-
238
  </div><!--optionlast-->
239
  <div class="clear"></div>
240
  </div><!--optiongroup-->
241
-
242
  <div class="optiongroup">
243
  <div class="optionleft">
244
  <label for="optinforms_form5_fields_font" class="nopointer"><?php echo __('Input fields font', 'optin-forms'); ?></label>
@@ -255,11 +255,11 @@
255
  </script>
256
  </div><!--optionmiddle-->
257
  <div class="optionlast">
258
-
259
  </div><!--optionlast-->
260
  <div class="clear"></div>
261
  </div><!--optiongroup-->
262
-
263
  <div class="optiongroup">
264
  <div class="optionleft">
265
  <label for="optinforms_form5_fields_size" class="nopointer"><?php echo __('Input fields size', 'optin-forms'); ?></label>
@@ -276,11 +276,11 @@
276
  </script>
277
  </div><!--optionmiddle-->
278
  <div class="optionlast">
279
-
280
  </div><!--optionlast-->
281
  <div class="clear"></div>
282
  </div><!--optiongroup-->
283
-
284
  <div class="optiongroup">
285
  <div class="optionleft">
286
  <label for="optinforms_form5_fields_color" class="nopointer"><?php echo __('Input fields color', 'optin-forms'); ?></label>
@@ -298,15 +298,15 @@
298
  $("#optinforms-form5-email-field").css( 'color', ui.color.toString());
299
  }
300
  });
301
- });
302
  </script>
303
  </div><!--optionmiddle-->
304
  <div class="optionlast">
305
-
306
  </div><!--optionlast-->
307
  <div class="clear"></div>
308
  </div><!--optiongroup-->
309
-
310
  <div class="optiongroup">
311
  <div class="optionleft">
312
  <label for="optinforms_form5_button_text" class="nopointer"><?php echo __('Button text', 'optin-forms'); ?></label>
@@ -320,11 +320,11 @@
320
  </script>
321
  </div><!--optionmiddle-->
322
  <div class="optionlast">
323
-
324
  </div><!--optionlast-->
325
  <div class="clear"></div>
326
  </div><!--optiongroup-->
327
-
328
  <div class="optiongroup">
329
  <div class="optionleft">
330
  <label for="optinforms_form5_button_text_font" class="nopointer"><?php echo __('Button text font', 'optin-forms'); ?></label>
@@ -340,11 +340,11 @@
340
  </script>
341
  </div><!--optionmiddle-->
342
  <div class="optionlast">
343
-
344
  </div><!--optionlast-->
345
  <div class="clear"></div>
346
  </div><!--optiongroup-->
347
-
348
  <div class="optiongroup">
349
  <div class="optionleft">
350
  <label for="optinforms_form5_button_text_size" class="nopointer"><?php echo __('Button text size', 'optin-forms'); ?></label>
@@ -360,11 +360,11 @@
360
  </script>
361
  </div><!--optionmiddle-->
362
  <div class="optionlast">
363
-
364
  </div><!--optionlast-->
365
  <div class="clear"></div>
366
  </div><!--optiongroup-->
367
-
368
  <div class="optiongroup">
369
  <div class="optionleft">
370
  <label for="optinforms_form5_button_text_color" class="nopointer"><?php echo __('Button text color', 'optin-forms'); ?></label>
@@ -381,15 +381,15 @@
381
  $("#optinforms-form5-button").css( 'color', ui.color.toString());
382
  }
383
  });
384
- });
385
  </script>
386
  </div><!--optionmiddle-->
387
  <div class="optionlast">
388
-
389
  </div><!--optionlast-->
390
  <div class="clear"></div>
391
  </div><!--optiongroup-->
392
-
393
  <div class="optiongroup">
394
  <div class="optionleft">
395
  <label for="optinforms_form5_button_background" class="nopointer"><?php echo __('Button background color', 'optin-forms'); ?></label>
@@ -406,17 +406,17 @@
406
  $("#optinforms-form5-button").css( 'background-color', ui.color.toString());
407
  }
408
  });
409
- });
410
  </script>
411
  </div><!--optionmiddle-->
412
  <div class="optionlast">
413
-
414
  </div><!--optionlast-->
415
  <div class="clear"></div>
416
  </div><!--optiongroup-->
417
-
418
  <?php if (get_option('optinforms_form5_hide_disclaimer')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your disclaimer in Form Options', 'optin-forms') . '.</p></div>'; } ?>
419
-
420
  <div class="optiongroup">
421
  <div class="optionleft">
422
  <label for="optinforms_form5_disclaimer" class="nopointer"><?php echo __('Disclaimer text', 'optin-forms'); ?></label>
@@ -430,11 +430,11 @@
430
  </script>
431
  </div><!--optionmiddle-->
432
  <div class="optionlast">
433
-
434
  </div><!--optionlast-->
435
  <div class="clear"></div>
436
  </div><!--optiongroup-->
437
-
438
  <div class="optiongroup">
439
  <div class="optionleft">
440
  <label for="optinforms_form5_disclaimer_font" class="nopointer"><?php echo __('Disclaimer font', 'optin-forms'); ?></label>
@@ -450,11 +450,11 @@
450
  </script>
451
  </div><!--optionmiddle-->
452
  <div class="optionlast">
453
-
454
  </div><!--optionlast-->
455
  <div class="clear"></div>
456
  </div><!--optiongroup-->
457
-
458
  <div class="optiongroup">
459
  <div class="optionleft">
460
  <label for="optinforms_form5_disclaimer_size" class="nopointer"><?php echo __('Disclaimer size', 'optin-forms'); ?></label>
@@ -470,11 +470,11 @@
470
  </script>
471
  </div><!--optionmiddle-->
472
  <div class="optionlast">
473
-
474
  </div><!--optionlast-->
475
  <div class="clear"></div>
476
  </div><!--optiongroup-->
477
-
478
  <div class="optiongroup">
479
  <div class="optionleft">
480
  <label for="optinforms_form5_disclaimer_color" class="nopointer"><?php echo __('Disclaimer color', 'optin-forms'); ?></label>
@@ -491,15 +491,15 @@
491
  $("#optinforms-form5-disclaimer").css( 'color', ui.color.toString());
492
  }
493
  });
494
- });
495
  </script>
496
  </div><!--optionmiddle-->
497
  <div class="optionlast">
498
-
499
  </div><!--optionlast-->
500
  <div class="clear"></div>
501
  </div><!--optiongroup-->
502
-
503
  <div class="optiongroup">
504
  <div class="optionleft">
505
  <label for="optinforms_form5_width" class="nopointer"><?php echo __('Form width', 'optin-forms'); ?></label> <label><a onclick="optinforms_explain_width_5()"><span class="explain">?</span></a></label>
@@ -515,18 +515,18 @@
515
  <div class="clear"></div>
516
  </div><!--optionmiddle-->
517
  <div class="optionlast">
518
-
519
  </div><!--optionlast-->
520
  <div class="clear"></div>
521
  </div><!--optiongroup-->
522
-
523
  <script type="text/javascript">
524
  function optinforms_explain_width_5() {
525
  // Get the DOM reference
526
  var contentId = document.getElementById("optinforms-explain-width-5");
527
- // Toggle
528
- contentId.style.display == "block" ? contentId.style.display = "none" :
529
- contentId.style.display = "block";
530
  }
531
  </script>
532
  <div id="optinforms-explain-width-5" style="display:none;">
@@ -534,20 +534,20 @@
534
  <p><?php echo __('In most cases, you can leave the form width at 100%. This will ensure your form will align perfectly with any WordPress theme and act responsive when scaled on different devices. Please note that the form preview displayed in your WordPress administration panel will not be affected by changing this value.', 'optin-forms'); ?></p>
535
  </div><!--optinforms-help-->
536
  </div><!--optinforms-explain-width-5-->
537
-
538
  </div><!--toggle-container-->
539
  <div class="clear"></div>
540
-
541
  <div class="toggle-wrap">
542
  <span class="trigger">
543
  <a><?php echo __('Form Options', 'optin-forms'); ?></a>
544
  </span>
545
-
546
  <div class="toggle-container" style="display: none;">
547
-
548
  <div class="optiongroup">
549
  <div class="optionleft">
550
-
551
  </div><!--optionleft-->
552
  <div class="optionmiddle">
553
  <input type="checkbox" name="optinforms_form5_hide_title" value="1" id="optinforms_form5_hide_title" <?php if (get_option('optinforms_form5_hide_title')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_title_visibility(this.checked);" /> <label for="optinforms_form5_hide_title" class="nopointer"><?php echo __('Hide the title', 'optin-forms'); ?></label>
@@ -563,14 +563,14 @@
563
  </script>
564
  </div><!--optionmiddle-->
565
  <div class="optionlast">
566
-
567
  </div><!--optionlast-->
568
  <div class="clear"></div>
569
  </div><!--optiongroup-->
570
-
571
  <div class="optiongroup">
572
  <div class="optionleft">
573
-
574
  </div><!--optionleft-->
575
  <div class="optionmiddle">
576
  <input type="checkbox" name="optinforms_form5_hide_subtitle" value="1" id="optinforms_form5_hide_subtitle" <?php if (get_option('optinforms_form5_hide_subtitle')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_hide_subtitle_visibility(this.checked);optinforms_form5_hide_subtitle_disclaimer_visibility();" /> <label for="optinforms_form5_hide_subtitle" class="nopointer"><?php echo __('Hide the subtitle', 'optin-forms'); ?></label>
@@ -588,14 +588,14 @@
588
  </script>
589
  </div><!--optionmiddle-->
590
  <div class="optionlast">
591
-
592
  </div><!--optionlast-->
593
  <div class="clear"></div>
594
  </div><!--optiongroup-->
595
-
596
  <div class="optiongroup">
597
  <div class="optionleft">
598
-
599
  </div><!--optionleft-->
600
  <div class="optionmiddle">
601
  <input type="checkbox" name="optinforms_form5_hide_name_field" value="1" id="optinforms_form5_hide_name_field" <?php if (get_option('optinforms_form5_hide_name_field')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_name_field_visibility(this.checked);" /> <label for="optinforms_form5_hide_name_field" class="nopointer"><?php echo __('Hide the name field', 'optin-forms'); ?></label>
@@ -611,14 +611,14 @@
611
  </script>
612
  </div><!--optionmiddle-->
613
  <div class="optionlast">
614
-
615
  </div><!--optionlast-->
616
  <div class="clear"></div>
617
  </div><!--optiongroup-->
618
-
619
  <div class="optiongroup">
620
  <div class="optionleft">
621
-
622
  </div><!--optionleft-->
623
  <div class="optionmiddle">
624
  <input type="checkbox" name="optinforms_form5_hide_disclaimer" value="1" id="optinforms_form5_hide_disclaimer" <?php if (get_option('optinforms_form5_hide_disclaimer')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_disclaimer_visibility(this.checked);optinforms_form5_hide_subtitle_disclaimer_visibility();" /> <label for="optinforms_form5_hide_disclaimer" class="nopointer"><?php echo __('Hide the disclaimer', 'optin-forms'); ?></label>
@@ -653,31 +653,31 @@
653
  </script>
654
  </div><!--optionmiddle-->
655
  <div class="optionlast">
656
-
657
  </div><!--optionlast-->
658
  <div class="clear"></div>
659
  </div><!--optiongroup-->
660
-
661
  <div class="optiongroup">
662
  <div class="optionleft">
663
- <label for="optinforms_form5_css" class="nopointer"><?php echo __('Custom CSS', 'optin-forms'); ?></label> <label><a onclick="optinforms_explain_css_5()"><span class="explain">?</span></a></label>
664
  </div><!--optionleft-->
665
  <div class="optionmiddle">
666
  <textarea id="optinforms_form5_css" name="optinforms_form5_css"><?php echo optinforms_form5_css(); ?></textarea>
667
  </div><!--optionmiddle-->
668
  <div class="optionlast">
669
-
670
  </div><!--optionlast-->
671
  <div class="clear"></div>
672
  </div><!--optiongroup-->
673
-
674
  <script type="text/javascript">
675
  function optinforms_explain_css_5() {
676
  // Get the DOM reference
677
  var contentId = document.getElementById("optinforms-explain-css-5");
678
- // Toggle
679
- contentId.style.display == "block" ? contentId.style.display = "none" :
680
- contentId.style.display = "block";
681
  }
682
  </script>
683
  <div id="optinforms-explain-css-5" style="display:none;">
@@ -685,7 +685,7 @@
685
  <p><?php echo __('Override the plugin\'s CSS values by entering your own custom CSS.', 'optin-forms'); ?></p>
686
  </div><!--optinforms-help-->
687
  </div><!--optinforms-explain-css-5-->
688
-
689
  </div><!--toggle-container-->
690
  <div class="clear"></div>
691
  </div><!--toggle-wrap-->
3
  <span class="trigger">
4
  <a><?php echo __('Style Your Form', 'optin-forms'); ?></a>
5
  </span>
6
+
7
  <div class="toggle-container" style="display: none;">
8
  <div class="optiongroup">
9
  <div class="optionleft">
21
  $("#optinforms-form5").css( 'background-color', ui.color.toString());
22
  }
23
  });
24
+ });
25
  </script>
26
  </div><!--optionmiddle-->
27
  <div class="optionlast">
28
+
29
  </div><!--optionlast-->
30
  <div class="clear"></div>
31
  </div><!--optiongroup-->
32
+
33
  <?php if (get_option('optinforms_form5_hide_title')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your title in Form Options', 'optin-forms') . '.</p></div>'; } ?>
34
+
35
  <div class="optiongroup">
36
  <div class="optionleft">
37
  <label for="optinforms_form5_title" class="nopointer"><?php echo __('Title', 'optin-forms'); ?></label>
45
  </script>
46
  </div><!--optionmiddle-->
47
  <div class="optionlast">
48
+
49
  </div><!--optionlast-->
50
  <div class="clear"></div>
51
  </div><!--optiongroup-->
52
+
53
  <div class="optiongroup">
54
  <div class="optionleft">
55
  <label for="optinforms_form5_title_font" class="nopointer"><?php echo __('Title font', 'optin-forms'); ?></label>
65
  </script>
66
  </div><!--optionmiddle-->
67
  <div class="optionlast">
68
+
69
  </div><!--optionlast-->
70
  <div class="clear"></div>
71
  </div><!--optiongroup-->
72
+
73
  <div class="optiongroup">
74
  <div class="optionleft">
75
  <label for="optinforms_form5_title_size" class="nopointer"><?php echo __('Title size', 'optin-forms'); ?></label>
86
  </script>
87
  </div><!--optionmiddle-->
88
  <div class="optionlast">
89
+
90
  </div><!--optionlast-->
91
  <div class="clear"></div>
92
  </div><!--optiongroup-->
93
+
94
  <div class="optiongroup">
95
  <div class="optionleft">
96
  <label for="optinforms_form5_title_color" class="nopointer"><?php echo __('Title color', 'optin-forms'); ?></label>
107
  $("#optinforms-form5-title").css( 'color', ui.color.toString());
108
  }
109
  });
110
+ });
111
  </script>
112
  </div><!--optionmiddle-->
113
  <div class="optionlast">
114
+
115
  </div><!--optionlast-->
116
  <div class="clear"></div>
117
  </div><!--optiongroup-->
118
+
119
  <?php if (get_option('optinforms_form5_hide_subtitle')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your subtitle in Form Options', 'optin-forms') . '.</p></div>'; } ?>
120
+
121
  <div class="optiongroup">
122
  <div class="optionleft">
123
  <label for="optinforms_form5_subtitle" class="nopointer"><?php echo __('Subtitle', 'optin-forms'); ?></label>
131
  </script>
132
  </div><!--optionmiddle-->
133
  <div class="optionlast">
134
+
135
  </div><!--optionlast-->
136
  <div class="clear"></div>
137
  </div><!--optiongroup-->
138
+
139
  <div class="optiongroup">
140
  <div class="optionleft">
141
  <label for="optinforms_form5_subtitle_font" class="nopointer"><?php echo __('Subtitle font', 'optin-forms'); ?></label>
151
  </script>
152
  </div><!--optionmiddle-->
153
  <div class="optionlast">
154
+
155
  </div><!--optionlast-->
156
  <div class="clear"></div>
157
  </div><!--optiongroup-->
158
+
159
  <div class="optiongroup">
160
  <div class="optionleft">
161
  <label for="optinforms_form5_subtitle_size" class="nopointer"><?php echo __('Subtitle size', 'optin-forms'); ?></label>
171
  </script>
172
  </div><!--optionmiddle-->
173
  <div class="optionlast">
174
+
175
  </div><!--optionlast-->
176
  <div class="clear"></div>
177
  </div><!--optiongroup-->
178
+
179
  <div class="optiongroup">
180
  <div class="optionleft">
181
  <label for="optinforms_form5_subtitle_color" class="nopointer"><?php echo __('Subtitle color', 'optin-forms'); ?></label>
192
  $("#optinforms-form5-subtitle").css( 'color', ui.color.toString());
193
  }
194
  });
195
+ });
196
  </script>
197
  </div><!--optionmiddle-->
198
  <div class="optionlast">
199
+
200
  </div><!--optionlast-->
201
  <div class="clear"></div>
202
  </div><!--optiongroup-->
203
+
204
  <?php if (get_option('optinforms_form5_hide_name_field')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your name field in Form Options', 'optin-forms') . '.</p></div>'; } ?>
205
+
206
  <div class="optiongroup">
207
  <div class="optionleft">
208
  <label for="optinforms_form5_name_field" class="nopointer"><?php echo __('Input field: name', 'optin-forms'); ?></label>
216
  </script>
217
  </div><!--optionmiddle-->
218
  <div class="optionlast">
219
+
220
  </div><!--optionlast-->
221
  <div class="clear"></div>
222
  </div><!--optiongroup-->
223
+
224
  <div class="optiongroup">
225
  <div class="optionleft">
226
  <label for="optinforms_form5_email_field" class="nopointer"><?php echo __('Input field: email', 'optin-forms'); ?></label>
234
  </script>
235
  </div><!--optionmiddle-->
236
  <div class="optionlast">
237
+
238
  </div><!--optionlast-->
239
  <div class="clear"></div>
240
  </div><!--optiongroup-->
241
+
242
  <div class="optiongroup">
243
  <div class="optionleft">
244
  <label for="optinforms_form5_fields_font" class="nopointer"><?php echo __('Input fields font', 'optin-forms'); ?></label>
255
  </script>
256
  </div><!--optionmiddle-->
257
  <div class="optionlast">
258
+
259
  </div><!--optionlast-->
260
  <div class="clear"></div>
261
  </div><!--optiongroup-->
262
+
263
  <div class="optiongroup">
264
  <div class="optionleft">
265
  <label for="optinforms_form5_fields_size" class="nopointer"><?php echo __('Input fields size', 'optin-forms'); ?></label>
276
  </script>
277
  </div><!--optionmiddle-->
278
  <div class="optionlast">
279
+
280
  </div><!--optionlast-->
281
  <div class="clear"></div>
282
  </div><!--optiongroup-->
283
+
284
  <div class="optiongroup">
285
  <div class="optionleft">
286
  <label for="optinforms_form5_fields_color" class="nopointer"><?php echo __('Input fields color', 'optin-forms'); ?></label>
298
  $("#optinforms-form5-email-field").css( 'color', ui.color.toString());
299
  }
300
  });
301
+ });
302
  </script>
303
  </div><!--optionmiddle-->
304
  <div class="optionlast">
305
+
306
  </div><!--optionlast-->
307
  <div class="clear"></div>
308
  </div><!--optiongroup-->
309
+
310
  <div class="optiongroup">
311
  <div class="optionleft">
312
  <label for="optinforms_form5_button_text" class="nopointer"><?php echo __('Button text', 'optin-forms'); ?></label>
320
  </script>
321
  </div><!--optionmiddle-->
322
  <div class="optionlast">
323
+
324
  </div><!--optionlast-->
325
  <div class="clear"></div>
326
  </div><!--optiongroup-->
327
+
328
  <div class="optiongroup">
329
  <div class="optionleft">
330
  <label for="optinforms_form5_button_text_font" class="nopointer"><?php echo __('Button text font', 'optin-forms'); ?></label>
340
  </script>
341
  </div><!--optionmiddle-->
342
  <div class="optionlast">
343
+
344
  </div><!--optionlast-->
345
  <div class="clear"></div>
346
  </div><!--optiongroup-->
347
+
348
  <div class="optiongroup">
349
  <div class="optionleft">
350
  <label for="optinforms_form5_button_text_size" class="nopointer"><?php echo __('Button text size', 'optin-forms'); ?></label>
360
  </script>
361
  </div><!--optionmiddle-->
362
  <div class="optionlast">
363
+
364
  </div><!--optionlast-->
365
  <div class="clear"></div>
366
  </div><!--optiongroup-->
367
+
368
  <div class="optiongroup">
369
  <div class="optionleft">
370
  <label for="optinforms_form5_button_text_color" class="nopointer"><?php echo __('Button text color', 'optin-forms'); ?></label>
381
  $("#optinforms-form5-button").css( 'color', ui.color.toString());
382
  }
383
  });
384
+ });
385
  </script>
386
  </div><!--optionmiddle-->
387
  <div class="optionlast">
388
+
389
  </div><!--optionlast-->
390
  <div class="clear"></div>
391
  </div><!--optiongroup-->
392
+
393
  <div class="optiongroup">
394
  <div class="optionleft">
395
  <label for="optinforms_form5_button_background" class="nopointer"><?php echo __('Button background color', 'optin-forms'); ?></label>
406
  $("#optinforms-form5-button").css( 'background-color', ui.color.toString());
407
  }
408
  });
409
+ });
410
  </script>
411
  </div><!--optionmiddle-->
412
  <div class="optionlast">
413
+
414
  </div><!--optionlast-->
415
  <div class="clear"></div>
416
  </div><!--optiongroup-->
417
+
418
  <?php if (get_option('optinforms_form5_hide_disclaimer')== '1') { echo '<div class="optionsgroup"><p class="hidden-warning">' . __('You\'ve hidden your disclaimer in Form Options', 'optin-forms') . '.</p></div>'; } ?>
419
+
420
  <div class="optiongroup">
421
  <div class="optionleft">
422
  <label for="optinforms_form5_disclaimer" class="nopointer"><?php echo __('Disclaimer text', 'optin-forms'); ?></label>
430
  </script>
431
  </div><!--optionmiddle-->
432
  <div class="optionlast">
433
+
434
  </div><!--optionlast-->
435
  <div class="clear"></div>
436
  </div><!--optiongroup-->
437
+
438
  <div class="optiongroup">
439
  <div class="optionleft">
440
  <label for="optinforms_form5_disclaimer_font" class="nopointer"><?php echo __('Disclaimer font', 'optin-forms'); ?></label>
450
  </script>
451
  </div><!--optionmiddle-->
452
  <div class="optionlast">
453
+
454
  </div><!--optionlast-->
455
  <div class="clear"></div>
456
  </div><!--optiongroup-->
457
+
458
  <div class="optiongroup">
459
  <div class="optionleft">
460
  <label for="optinforms_form5_disclaimer_size" class="nopointer"><?php echo __('Disclaimer size', 'optin-forms'); ?></label>
470
  </script>
471
  </div><!--optionmiddle-->
472
  <div class="optionlast">
473
+
474
  </div><!--optionlast-->
475
  <div class="clear"></div>
476
  </div><!--optiongroup-->
477
+
478
  <div class="optiongroup">
479
  <div class="optionleft">
480
  <label for="optinforms_form5_disclaimer_color" class="nopointer"><?php echo __('Disclaimer color', 'optin-forms'); ?></label>
491
  $("#optinforms-form5-disclaimer").css( 'color', ui.color.toString());
492
  }
493
  });
494
+ });
495
  </script>
496
  </div><!--optionmiddle-->
497
  <div class="optionlast">
498
+
499
  </div><!--optionlast-->
500
  <div class="clear"></div>
501
  </div><!--optiongroup-->
502
+
503
  <div class="optiongroup">
504
  <div class="optionleft">
505
  <label for="optinforms_form5_width" class="nopointer"><?php echo __('Form width', 'optin-forms'); ?></label> <label><a onclick="optinforms_explain_width_5()"><span class="explain">?</span></a></label>
515
  <div class="clear"></div>
516
  </div><!--optionmiddle-->
517
  <div class="optionlast">
518
+
519
  </div><!--optionlast-->
520
  <div class="clear"></div>
521
  </div><!--optiongroup-->
522
+
523
  <script type="text/javascript">
524
  function optinforms_explain_width_5() {
525
  // Get the DOM reference
526
  var contentId = document.getElementById("optinforms-explain-width-5");
527
+ // Toggle
528
+ contentId.style.display == "block" ? contentId.style.display = "none" :
529
+ contentId.style.display = "block";
530
  }
531
  </script>
532
  <div id="optinforms-explain-width-5" style="display:none;">
534
  <p><?php echo __('In most cases, you can leave the form width at 100%. This will ensure your form will align perfectly with any WordPress theme and act responsive when scaled on different devices. Please note that the form preview displayed in your WordPress administration panel will not be affected by changing this value.', 'optin-forms'); ?></p>
535
  </div><!--optinforms-help-->
536
  </div><!--optinforms-explain-width-5-->
537
+
538
  </div><!--toggle-container-->
539
  <div class="clear"></div>
540
+
541
  <div class="toggle-wrap">
542
  <span class="trigger">
543
  <a><?php echo __('Form Options', 'optin-forms'); ?></a>
544
  </span>
545
+
546
  <div class="toggle-container" style="display: none;">
547
+
548
  <div class="optiongroup">
549
  <div class="optionleft">
550
+
551
  </div><!--optionleft-->
552
  <div class="optionmiddle">
553
  <input type="checkbox" name="optinforms_form5_hide_title" value="1" id="optinforms_form5_hide_title" <?php if (get_option('optinforms_form5_hide_title')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_title_visibility(this.checked);" /> <label for="optinforms_form5_hide_title" class="nopointer"><?php echo __('Hide the title', 'optin-forms'); ?></label>
563
  </script>
564
  </div><!--optionmiddle-->
565
  <div class="optionlast">
566
+
567
  </div><!--optionlast-->
568
  <div class="clear"></div>
569
  </div><!--optiongroup-->
570
+
571
  <div class="optiongroup">
572
  <div class="optionleft">
573
+
574
  </div><!--optionleft-->
575
  <div class="optionmiddle">
576
  <input type="checkbox" name="optinforms_form5_hide_subtitle" value="1" id="optinforms_form5_hide_subtitle" <?php if (get_option('optinforms_form5_hide_subtitle')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_hide_subtitle_visibility(this.checked);optinforms_form5_hide_subtitle_disclaimer_visibility();" /> <label for="optinforms_form5_hide_subtitle" class="nopointer"><?php echo __('Hide the subtitle', 'optin-forms'); ?></label>
588
  </script>
589
  </div><!--optionmiddle-->
590
  <div class="optionlast">
591
+
592
  </div><!--optionlast-->
593
  <div class="clear"></div>
594
  </div><!--optiongroup-->
595
+
596
  <div class="optiongroup">
597
  <div class="optionleft">
598
+
599
  </div><!--optionleft-->
600
  <div class="optionmiddle">
601
  <input type="checkbox" name="optinforms_form5_hide_name_field" value="1" id="optinforms_form5_hide_name_field" <?php if (get_option('optinforms_form5_hide_name_field')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_name_field_visibility(this.checked);" /> <label for="optinforms_form5_hide_name_field" class="nopointer"><?php echo __('Hide the name field', 'optin-forms'); ?></label>
611
  </script>
612
  </div><!--optionmiddle-->
613
  <div class="optionlast">
614
+
615
  </div><!--optionlast-->
616
  <div class="clear"></div>
617
  </div><!--optiongroup-->
618
+
619
  <div class="optiongroup">
620
  <div class="optionleft">
621
+
622
  </div><!--optionleft-->
623
  <div class="optionmiddle">
624
  <input type="checkbox" name="optinforms_form5_hide_disclaimer" value="1" id="optinforms_form5_hide_disclaimer" <?php if (get_option('optinforms_form5_hide_disclaimer')== '1') { echo 'checked="checked"'; } ?> onclick="optinforms_form5_disclaimer_visibility(this.checked);optinforms_form5_hide_subtitle_disclaimer_visibility();" /> <label for="optinforms_form5_hide_disclaimer" class="nopointer"><?php echo __('Hide the disclaimer', 'optin-forms'); ?></label>
653
  </script>
654
  </div><!--optionmiddle-->
655
  <div class="optionlast">
656
+
657
  </div><!--optionlast-->
658
  <div class="clear"></div>
659
  </div><!--optiongroup-->
660
+
661
  <div class="optiongroup">
662
  <div class="optionleft">
663
+ <label for="optinforms_form5_css" class="nopointer"><?php echo __('Custom CSS', 'optin-forms'); ?></label> <label><a onclick="optinforms_explain_css_5()"><span class="explain">?</span></a></label>
664
  </div><!--optionleft-->
665
  <div class="optionmiddle">
666
  <textarea id="optinforms_form5_css" name="optinforms_form5_css"><?php echo optinforms_form5_css(); ?></textarea>
667
  </div><!--optionmiddle-->
668
  <div class="optionlast">
669
+
670
  </div><!--optionlast-->
671
  <div class="clear"></div>
672
  </div><!--optiongroup-->
673
+
674
  <script type="text/javascript">
675
  function optinforms_explain_css_5() {
676
  // Get the DOM reference
677
  var contentId = document.getElementById("optinforms-explain-css-5");
678
+ // Toggle
679
+ contentId.style.display == "block" ? contentId.style.display = "none" :
680
+ contentId.style.display = "block";
681
  }
682
  </script>
683
  <div id="optinforms-explain-css-5" style="display:none;">
685
  <p><?php echo __('Override the plugin\'s CSS values by entering your own custom CSS.', 'optin-forms'); ?></p>
686
  </div><!--optinforms-help-->
687
  </div><!--optinforms-explain-css-5-->
688
+
689
  </div><!--toggle-container-->
690
  <div class="clear"></div>
691
  </div><!--toggle-wrap-->
includes/options-form-functionality.php CHANGED
@@ -3,24 +3,24 @@
3
  <span class="trigger">
4
  <a><?php echo __('Form Functionality', 'optin-forms'); ?></a>
5
  </span>
6
-
7
  <div class="toggle-container" style="display: none;">
8
 
9
  <div class="optiongroup">
10
  <div class="optionleft">
11
-
12
  </div><!--optionleft-->
13
  <div class="optionmiddle">
14
  <input type="checkbox" name="optinforms_form_target" value="1" id="optinforms_form_target" <?php if (get_option('optinforms_form_target')== '1') { echo 'checked="checked"'; } ?> /> <label for="optinforms_form_target" class="nopointer"><?php echo __('Open form submission in a new window', 'optin-forms'); ?></label>
15
  </div><!--optionmiddle-->
16
  <div class="optionlast">
17
-
18
  </div><!--optionlast-->
19
  <div class="clear"></div>
20
  </div><!--optiongroup-->
21
-
22
  </div><!--toggle-container-->
23
-
24
  </div><!--toggle-wrap-->
25
 
26
  <?php ?>
3
  <span class="trigger">
4
  <a><?php echo __('Form Functionality', 'optin-forms'); ?></a>
5
  </span>
6
+
7
  <div class="toggle-container" style="display: none;">
8
 
9
  <div class="optiongroup">
10
  <div class="optionleft">
11
+
12
  </div><!--optionleft-->
13
  <div class="optionmiddle">
14
  <input type="checkbox" name="optinforms_form_target" value="1" id="optinforms_form_target" <?php if (get_option('optinforms_form_target')== '1') { echo 'checked="checked"'; } ?> /> <label for="optinforms_form_target" class="nopointer"><?php echo __('Open form submission in a new window', 'optin-forms'); ?></label>
15
  </div><!--optionmiddle-->
16
  <div class="optionlast">
17
+
18
  </div><!--optionlast-->
19
  <div class="clear"></div>
20
  </div><!--optiongroup-->
21
+
22
  </div><!--toggle-container-->
23
+
24
  </div><!--toggle-wrap-->
25
 
26
  <?php ?>
includes/register-settings.php CHANGED
@@ -1,17 +1,37 @@
1
- <?php
2
 
3
  add_action( 'admin_init', 'optinforms_register_settings' );
4
 
5
  // Register Optin Forms settings
6
- function optinforms_register_settings()
7
  {
8
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  register_setting( 'optinforms-settings-group', 'optinforms_email_solution' );
10
  register_setting( 'optinforms-settings-group', 'optinforms_form_action' );
11
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_mailchimp' );
12
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_madmimi' );
13
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_interspire' );
14
-
15
  register_setting( 'optinforms-settings-group', 'optinforms_form_list_name_aweber' );
16
  register_setting( 'optinforms-settings-group', 'optinforms_form_redirect_aweber' );
17
  register_setting( 'optinforms-settings-group', 'optinforms_form_listid_icontact' );
@@ -21,7 +41,7 @@ function optinforms_register_settings()
21
  register_setting( 'optinforms-settings-group', 'optinforms_form_error_icontact' );
22
  register_setting( 'optinforms-settings-group', 'optinforms_form_webformid_getresponse' );
23
  register_setting( 'optinforms-settings-group', 'optinforms_form_name_field_interspire' );
24
-
25
  register_setting( 'optinforms-settings-group', 'optinforms_form_design' );
26
  register_setting( 'optinforms-settings-group', 'optinforms_form_placement_post' );
27
  register_setting( 'optinforms-settings-group', 'optinforms_form_placement_page' );
@@ -32,7 +52,7 @@ function optinforms_register_settings()
32
  register_setting( 'optinforms-settings-group', 'optinforms_form_exclude_pages' );
33
  register_setting( 'optinforms-settings-group', 'optinforms_powered_by' );
34
  register_setting( 'optinforms-settings-group', 'optinforms_form_target' );
35
-
36
  register_setting( 'optinforms-settings-group', 'optinforms_form1_background' );
37
  register_setting( 'optinforms-settings-group', 'optinforms_form1_border' );
38
  register_setting( 'optinforms-settings-group', 'optinforms_form1_title' );
@@ -64,7 +84,7 @@ function optinforms_register_settings()
64
  register_setting( 'optinforms-settings-group', 'optinforms_form1_hide_name_field' );
65
  register_setting( 'optinforms-settings-group', 'optinforms_form1_hide_disclaimer' );
66
  register_setting( 'optinforms-settings-group', 'optinforms_form1_css' );
67
-
68
  register_setting( 'optinforms-settings-group', 'optinforms_form2_background' );
69
  register_setting( 'optinforms-settings-group', 'optinforms_form2_title' );
70
  register_setting( 'optinforms-settings-group', 'optinforms_form2_title_font' );
@@ -88,7 +108,7 @@ function optinforms_register_settings()
88
  register_setting( 'optinforms-settings-group', 'optinforms_form2_hide_title' );
89
  register_setting( 'optinforms-settings-group', 'optinforms_form2_hide_disclaimer' );
90
  register_setting( 'optinforms-settings-group', 'optinforms_form2_css' );
91
-
92
  register_setting( 'optinforms-settings-group', 'optinforms_form3_background' );
93
  register_setting( 'optinforms-settings-group', 'optinforms_form3_title' );
94
  register_setting( 'optinforms-settings-group', 'optinforms_form3_title_font' );
@@ -114,7 +134,7 @@ function optinforms_register_settings()
114
  register_setting( 'optinforms-settings-group', 'optinforms_form3_hide_subtitle' );
115
  register_setting( 'optinforms-settings-group', 'optinforms_form3_hide_name_field' );
116
  register_setting( 'optinforms-settings-group', 'optinforms_form3_css' );
117
-
118
  register_setting( 'optinforms-settings-group', 'optinforms_form4_background' );
119
  register_setting( 'optinforms-settings-group', 'optinforms_form4_border' );
120
  register_setting( 'optinforms-settings-group', 'optinforms_form4_title' );
@@ -144,7 +164,7 @@ function optinforms_register_settings()
144
  register_setting( 'optinforms-settings-group', 'optinforms_form4_hide_subtitle' );
145
  register_setting( 'optinforms-settings-group', 'optinforms_form4_hide_disclaimer' );
146
  register_setting( 'optinforms-settings-group', 'optinforms_form4_css' );
147
-
148
  register_setting( 'optinforms-settings-group', 'optinforms_form5_background' );
149
  register_setting( 'optinforms-settings-group', 'optinforms_form5_title' );
150
  register_setting( 'optinforms-settings-group', 'optinforms_form5_title_font' );
@@ -175,5 +195,6 @@ function optinforms_register_settings()
175
  register_setting( 'optinforms-settings-group', 'optinforms_form5_hide_name_field' );
176
  register_setting( 'optinforms-settings-group', 'optinforms_form5_hide_disclaimer' );
177
  register_setting( 'optinforms-settings-group', 'optinforms_form5_css' );
 
178
  }
179
  ?>
1
+ <?php
2
 
3
  add_action( 'admin_init', 'optinforms_register_settings' );
4
 
5
  // Register Optin Forms settings
6
+ function optinforms_register_settings()
7
  {
8
+ global $optinforms_forms;
9
+
10
+ // Are there any custom optin form designs registered?
11
+ if ( is_array( $optinforms_forms ) ) {
12
+
13
+ // Loop through registered optin form designs.
14
+ foreach ( $optinforms_forms as $id => $design ) {
15
+
16
+ // Are the default settings provided?
17
+ if ( is_array( $design->defaults ) ) {
18
+
19
+ // Loop through each default setting.
20
+ foreach ( $design->defaults as $setting_id => $setting_default ) {
21
+
22
+ // Register a WordPress setting to store the setting value.
23
+ register_setting( 'optinforms-settings-group', $setting_id );
24
+ }
25
+ }
26
+ }
27
+ }
28
+
29
  register_setting( 'optinforms-settings-group', 'optinforms_email_solution' );
30
  register_setting( 'optinforms-settings-group', 'optinforms_form_action' );
31
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_mailchimp' );
32
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_madmimi' );
33
  register_setting( 'optinforms-settings-group', 'optinforms_form_action_interspire' );
34
+
35
  register_setting( 'optinforms-settings-group', 'optinforms_form_list_name_aweber' );
36
  register_setting( 'optinforms-settings-group', 'optinforms_form_redirect_aweber' );
37
  register_setting( 'optinforms-settings-group', 'optinforms_form_listid_icontact' );
41
  register_setting( 'optinforms-settings-group', 'optinforms_form_error_icontact' );
42
  register_setting( 'optinforms-settings-group', 'optinforms_form_webformid_getresponse' );
43
  register_setting( 'optinforms-settings-group', 'optinforms_form_name_field_interspire' );
44
+
45
  register_setting( 'optinforms-settings-group', 'optinforms_form_design' );
46
  register_setting( 'optinforms-settings-group', 'optinforms_form_placement_post' );
47
  register_setting( 'optinforms-settings-group', 'optinforms_form_placement_page' );
52
  register_setting( 'optinforms-settings-group', 'optinforms_form_exclude_pages' );
53
  register_setting( 'optinforms-settings-group', 'optinforms_powered_by' );
54
  register_setting( 'optinforms-settings-group', 'optinforms_form_target' );
55
+
56
  register_setting( 'optinforms-settings-group', 'optinforms_form1_background' );
57
  register_setting( 'optinforms-settings-group', 'optinforms_form1_border' );
58
  register_setting( 'optinforms-settings-group', 'optinforms_form1_title' );
84
  register_setting( 'optinforms-settings-group', 'optinforms_form1_hide_name_field' );
85
  register_setting( 'optinforms-settings-group', 'optinforms_form1_hide_disclaimer' );
86
  register_setting( 'optinforms-settings-group', 'optinforms_form1_css' );
87
+
88
  register_setting( 'optinforms-settings-group', 'optinforms_form2_background' );
89
  register_setting( 'optinforms-settings-group', 'optinforms_form2_title' );
90
  register_setting( 'optinforms-settings-group', 'optinforms_form2_title_font' );
108
  register_setting( 'optinforms-settings-group', 'optinforms_form2_hide_title' );
109
  register_setting( 'optinforms-settings-group', 'optinforms_form2_hide_disclaimer' );
110
  register_setting( 'optinforms-settings-group', 'optinforms_form2_css' );
111
+
112
  register_setting( 'optinforms-settings-group', 'optinforms_form3_background' );
113
  register_setting( 'optinforms-settings-group', 'optinforms_form3_title' );
114
  register_setting( 'optinforms-settings-group', 'optinforms_form3_title_font' );
134
  register_setting( 'optinforms-settings-group', 'optinforms_form3_hide_subtitle' );
135
  register_setting( 'optinforms-settings-group', 'optinforms_form3_hide_name_field' );
136
  register_setting( 'optinforms-settings-group', 'optinforms_form3_css' );
137
+
138
  register_setting( 'optinforms-settings-group', 'optinforms_form4_background' );
139
  register_setting( 'optinforms-settings-group', 'optinforms_form4_border' );
140
  register_setting( 'optinforms-settings-group', 'optinforms_form4_title' );
164
  register_setting( 'optinforms-settings-group', 'optinforms_form4_hide_subtitle' );
165
  register_setting( 'optinforms-settings-group', 'optinforms_form4_hide_disclaimer' );
166
  register_setting( 'optinforms-settings-group', 'optinforms_form4_css' );
167
+
168
  register_setting( 'optinforms-settings-group', 'optinforms_form5_background' );
169
  register_setting( 'optinforms-settings-group', 'optinforms_form5_title' );
170
  register_setting( 'optinforms-settings-group', 'optinforms_form5_title_font' );
195
  register_setting( 'optinforms-settings-group', 'optinforms_form5_hide_name_field' );
196
  register_setting( 'optinforms-settings-group', 'optinforms_form5_hide_disclaimer' );
197
  register_setting( 'optinforms-settings-group', 'optinforms_form5_css' );
198
+
199
  }
200
  ?>
js/custom.js CHANGED
@@ -1,5 +1,5 @@
1
  var root_path_url = "http";
2
- jQuery(document).ready(function($) {
3
  root_path_url = $('link[rel="start"]').attr("href") + "/";
4
  });
5
 
@@ -8,12 +8,30 @@ function is_touch_device() {
8
  }
9
 
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  /***************************************************
12
  TOGGLE STYLE
13
  ***************************************************/
14
  jQuery(document).ready(function($) {
15
-
16
- $(".toggle-container").hide();
17
  $(".trigger").toggle(function(){
18
  $(this).addClass("active");
19
  }, function () {
@@ -27,14 +45,14 @@ jQuery(document).ready(function($) {
27
  /***************************************************
28
  ACCORDION
29
  ***************************************************/
30
- jQuery(document).ready(function($){
31
  $('.trigger-button').click(function() {
32
  $(".trigger-button").removeClass("active")
33
  $('.accordion').slideUp('normal');
34
  if($(this).next().is(':hidden') == true) {
35
  $(this).next().slideDown('normal');
36
  $(this).addClass("active");
37
- }
38
  });
39
  $('.accordion').hide();
40
  });
@@ -45,7 +63,7 @@ jQuery(document).ready(function($){
45
  ***************************************************/
46
 
47
  jQuery(document).ready(function($){
48
-
49
  $('.check_path').each(function(){
50
  var icon_path = $(this).attr("src");
51
  if (icon_path.substr(0, 10) == "wp-content") {
1
  var root_path_url = "http";
2
+ jQuery(document).ready(function($) {
3
  root_path_url = $('link[rel="start"]').attr("href") + "/";
4
  });
5
 
8
  }
9
 
10
 
11
+ /**
12
+ * Switches backend forms based on drop down selection.
13
+ */
14
+ jQuery(document).ready(function($) {
15
+
16
+ // Runs when form design select list changes.
17
+ $("#optinforms_form_design").change(function() {
18
+
19
+ // Hides all design specific options.
20
+ $('#optinforms-design-backend-wrap > div').css('display', 'none');
21
+
22
+ // Displays only the options corresponding with the chosen form.
23
+ $('#' + this.value).css('display', 'block');
24
+ });
25
+ });
26
+
27
+
28
+
29
  /***************************************************
30
  TOGGLE STYLE
31
  ***************************************************/
32
  jQuery(document).ready(function($) {
33
+
34
+ $(".toggle-container").hide();
35
  $(".trigger").toggle(function(){
36
  $(this).addClass("active");
37
  }, function () {
45
  /***************************************************
46
  ACCORDION
47
  ***************************************************/
48
+ jQuery(document).ready(function($){
49
  $('.trigger-button').click(function() {
50
  $(".trigger-button").removeClass("active")
51
  $('.accordion').slideUp('normal');
52
  if($(this).next().is(':hidden') == true) {
53
  $(this).next().slideDown('normal');
54
  $(this).addClass("active");
55
+ }
56
  });
57
  $('.accordion').hide();
58
  });
63
  ***************************************************/
64
 
65
  jQuery(document).ready(function($){
66
+
67
  $('.check_path').each(function(){
68
  var icon_path = $(this).attr("src");
69
  if (icon_path.substr(0, 10) == "wp-content") {
optin-forms.php CHANGED
@@ -1,30 +1,45 @@
1
- <?php
2
  /*
3
  Plugin Name: Optin Forms
4
  Plugin URI: http://fancythemes.com/plugins/optin-forms/
5
  Description: Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
6
  Author: FancyThemes
7
- Version: 1.1.9
8
  Author URI: http://www.fancythemes.com
9
  Text Domain: optin-forms
10
  Domain Path: /languages/
11
  License:
12
  Copyright 2016 FancyThemes.com
13
-
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
16
  published by the Free Software Foundation.
17
-
18
  This program is distributed in the hope that it will be useful,
19
  but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
  GNU General Public License for more details.
22
-
23
  You should have received a copy of the GNU General Public License
24
  along with this program; if not, write to the Free Software
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  // Add translation to plugin
29
  function optinforms_init() {
30
  $plugin_dir = basename(dirname(__FILE__));
@@ -34,18 +49,18 @@ add_action('plugins_loaded', 'optinforms_init');
34
 
35
  // Allow for translation of plugin description
36
  $plugin_header_translate = array(
37
- __('Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.', 'optin-forms'),
38
  );
39
 
40
  // Add our menu to WordPress
41
  add_action( 'admin_menu', 'optinforms_menu' );
42
 
43
- function optinforms_menu()
44
  {
45
  // Since 1.1.2 added a menu position decimal fix to prevent conflict with other themes using 31, such as Thesis Theme
46
  // @http://gabrielharper.com/blog/2012/08/wordpress-admin-menu-positioning-conflicts/
47
  $submenu = add_menu_page(__('Optin Forms','optin-forms'), __('Optin Forms','optin-forms'), 'manage_options', 'optinforms', 'optinforms_main_page', plugins_url('optin-forms/images/icon.png'), '30.1');
48
-
49
  // We want our JS and CSS loaded on our admin pages only, so let's just load them for now
50
  add_action( 'load-' . $submenu, 'load_optinforms_admin_scripts' );
51
  }
@@ -79,6 +94,21 @@ function optinforms_admin_scripts()
79
  wp_enqueue_script('toggle', plugins_url('/js/custom.js', __FILE__ ));
80
  wp_enqueue_script('jquery-ui-slider');
81
  wp_register_style('optinforms-googleFont', '//fonts.googleapis.com/css?family=Share+Tech|Droid+Sans|Lobster|Fenix|Unkempt|Flavors|Viga|Damion|Oleo+Script|Racing+Sans+One|Nixie+One|Fredoka+One|Open+Sans|Overlock+SC|Bubbler+One|Contrail+One|Gochi+Hand|Roboto+Condensed|Russo+One|Cinzel+Decorative|News+Cycle|Marcellus+SC|Chewy|Quicksand|Sanchez|Signika+Negative|Gloria+Hallelujah|Grand+Hotel|Droid+Serif|Englebert|Oswald|Pacifico|Titan+One|Shadows+Into+Light|Dancing+Script|Luckiest+Guy|Parisienne|Coming+Soon|Baumans|Belgrano');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
 
84
  // Enqueue our form CSS on front end
@@ -88,11 +118,25 @@ function optinforms_admin_scripts()
88
  // Add our CSS and JS to admin head, but just for our pages (see load_optinforms_admin_scripts above!)
89
  function optinforms_scripts()
90
  {
91
- global $optinforms_form_design;
92
  wp_enqueue_script('jquery');
93
  wp_enqueue_style('optinforms-stylesheet', plugins_url('/css/optinforms.css', __FILE__ ), array('optinforms-googleFont'));
94
  wp_enqueue_script('placeholder', plugins_url('/js/placeholder.js', __FILE__ ));
95
  wp_register_style('optinforms-googleFont', optinforms_used_fonts());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
 
98
  // Add additional scripts to admin head on all admin pages (so supportbox slider will work on all pages!)
@@ -107,128 +151,222 @@ function optinforms_options() {
107
  if ( !current_user_can( 'manage_options' ) ) {
108
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
109
  }
110
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
- <?php }
113
  function optinforms_main_page() {
114
-
 
115
  { ?>
116
- <div class="wrap">
117
- <h2><?php echo __('Optin Forms', 'optin-forms'); ?></h2>
118
- <div id="icon-optinforms" class="icon32">
119
- </div><!--icon-32-->
120
  <h3 class="title"><?php echo optinforms_menu_tabs(); ?></h3>
121
- </div><!--wrap-->
122
-
123
  <?php echo optinforms_configuration(); ?>
124
 
125
- <?php if( isset($_GET['settings-updated']) ) { ?>
126
- <div id="message" class="updated">
127
- <p><strong><?php _e('Settings updated') ?></strong></p>
128
- </div>
129
  <?php } ?>
130
-
131
- <div id="optinforms">
132
- <form method="post" action="options.php" id="frm1">
133
- <?php settings_fields( 'optinforms-settings-group' ); ?>
134
-
135
- <div id="optinforms-email-solution-tab" class="tabcontent">
136
- <div class="optinforms-container-left">
137
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-email-solution.php'); ?>
138
- </div><!--optinforms-container-left-->
139
- <div class="optinforms-container-right">
140
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/sidebar.php'); ?>
141
- </div><!--optinforms-container-right-->
142
- <div class="clear"></div>
143
- </div><!--optinforms-email-solution-tab-->
144
-
145
- <div id="optinforms-posts-tab" class="tabcontent">
146
- <div class="optinforms-container-left">
147
- <div class="optiongroup">
148
- <p><?php echo __('Add a beautiful optin form to your posts, custom post types and pages. Include the form on your website with a simple mouse-click, or use the shortcode to add it to specific posts and pages.', 'optin-forms'); ?></p>
149
- <div class="optionleft">
150
- <label for="optinforms_form_design" class="nopointer"><?php echo __('Form design', 'optin-forms'); ?></label>
151
- </div><!--optionleft-->
152
- <div class="optionmiddle">
153
- <select name="optinforms_form_design" id="optinforms_form_design">
154
- <option value="optinforms_form_design_option1" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option1') { echo 'selected="selected"'; } ?>>01</option>
155
- <option value="optinforms_form_design_option2" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option2') { echo 'selected="selected"'; } ?>>02</option>
156
- <option value="optinforms_form_design_option3" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option3') { echo 'selected="selected"'; } ?>>03</option>
157
- <option value="optinforms_form_design_option4" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option4') { echo 'selected="selected"'; } ?>>04</option>
158
- <option value="optinforms_form_design_option5" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option5') { echo 'selected="selected"'; } ?>>05</option>
159
- </select>
160
- <script type="text/javascript">
161
- document.getElementById('optinforms_form_design').onchange = function() {
162
- var i = 1;
163
- var myDiv = document.getElementById("optinforms_form_design_option" + i);
164
- while(myDiv) {
165
- myDiv.style.display = 'none';
166
- myDiv = document.getElementById("optinforms_form_design_option" + ++i);
167
- }
168
- document.getElementById(this.value).style.display = 'block';
169
- };
170
- </script>
171
- </div><!--optionmiddle-->
172
- <div class="optionlast">
173
-
174
- </div><!--optionlast-->
175
- <div class="clear"></div>
176
-
177
- </div><!--optiongroup-->
178
-
179
- <div class="optiongroup">
180
- <div id="optinforms_form_design_option1" <?php if (get_option('optinforms_form_design')== '' || get_option('optinforms_form_design')== 'optinforms_form_design_option1') { echo 'style="display:block;"'; } ?>>
181
-
182
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-1.php'); ?>
183
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-1.php'); ?>
184
-
185
- </div><!--optinforms_form_design_option1-->
186
- <div id="optinforms_form_design_option2" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option2') { echo 'style="display:block;"'; } ?>>
187
-
188
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-2.php'); ?>
189
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-2.php'); ?>
190
-
191
- </div><!--optinforms_form_design_option2-->
192
- <div id="optinforms_form_design_option3" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option3') { echo 'style="display:block;"'; } ?>>
193
-
194
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-3.php'); ?>
195
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-3.php'); ?>
196
-
197
- </div><!--optinforms_form_design_option3-->
198
- <div id="optinforms_form_design_option4" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option4') { echo 'style="display:block;"'; } ?>>
199
-
200
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-4.php'); ?>
201
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-4.php'); ?>
202
-
203
- </div><!--optinforms_form_design_option4-->
204
- <div id="optinforms_form_design_option5" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option5') { echo 'style="display:block;"'; } ?>>
205
-
206
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-5.php'); ?>
207
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-5.php'); ?>
208
-
209
- </div><!--optinforms_form_design_option5-->
210
- </div><!--optiongroup-->
211
-
212
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-functionality.php'); ?>
213
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-placement.php'); ?>
214
-
215
- </div><!--optinforms-container-left-->
216
- <div class="optinforms-container-right">
217
- <?php include( plugin_dir_path( __FILE__ ) . 'includes/sidebar.php'); ?>
218
- </div><!--optinforms-container-right-->
219
- <div class="clear"></div>
220
- </div><!--optinforms-posts-tab-->
221
-
222
- <script type="text/javascript">
223
- var wpthumbs=new ddtabcontent("optinforms-menu-tabs") //enter ID of Tab Container
224
- wpthumbs.setpersist(true) //toogle persistence of the tabs' state
225
- wpthumbs.setselectedClassTarget("link") //"link" or "linkparent"
226
- wpthumbs.init()
227
- </script>
228
-
229
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
230
- </form>
231
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  </div><!--optinforms-->
233
 
234
  <?php }
1
+ <?php
2
  /*
3
  Plugin Name: Optin Forms
4
  Plugin URI: http://fancythemes.com/plugins/optin-forms/
5
  Description: Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
6
  Author: FancyThemes
7
+ Version: 1.2.1
8
  Author URI: http://www.fancythemes.com
9
  Text Domain: optin-forms
10
  Domain Path: /languages/
11
  License:
12
  Copyright 2016 FancyThemes.com
13
+
14
  This program is free software; you can redistribute it and/or modify
15
  it under the terms of the GNU General Public License, version 2, as
16
  published by the Free Software Foundation.
17
+
18
  This program is distributed in the hope that it will be useful,
19
  but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
  GNU General Public License for more details.
22
+
23
  You should have received a copy of the GNU General Public License
24
  along with this program; if not, write to the Free Software
25
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26
  */
27
 
28
+
29
+ /**
30
+ * Registers optin forms
31
+ *
32
+ * Adds new forms to the $optinforms_forms array.
33
+ *
34
+ * @param $class_name string Name of the form class being registered.
35
+ */
36
+ function register_optin_form( $class_name ) {
37
+ global $optinforms_forms;
38
+
39
+ // Adds form to global forms array.
40
+ $optinforms_forms[$class_name] = new $class_name;
41
+ }
42
+
43
  // Add translation to plugin
44
  function optinforms_init() {
45
  $plugin_dir = basename(dirname(__FILE__));
49
 
50
  // Allow for translation of plugin description
51
  $plugin_header_translate = array(
52
+ __( 'Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.', 'optin-forms' ),
53
  );
54
 
55
  // Add our menu to WordPress
56
  add_action( 'admin_menu', 'optinforms_menu' );
57
 
58
+ function optinforms_menu()
59
  {
60
  // Since 1.1.2 added a menu position decimal fix to prevent conflict with other themes using 31, such as Thesis Theme
61
  // @http://gabrielharper.com/blog/2012/08/wordpress-admin-menu-positioning-conflicts/
62
  $submenu = add_menu_page(__('Optin Forms','optin-forms'), __('Optin Forms','optin-forms'), 'manage_options', 'optinforms', 'optinforms_main_page', plugins_url('optin-forms/images/icon.png'), '30.1');
63
+
64
  // We want our JS and CSS loaded on our admin pages only, so let's just load them for now
65
  add_action( 'load-' . $submenu, 'load_optinforms_admin_scripts' );
66
  }
94
  wp_enqueue_script('toggle', plugins_url('/js/custom.js', __FILE__ ));
95
  wp_enqueue_script('jquery-ui-slider');
96
  wp_register_style('optinforms-googleFont', '//fonts.googleapis.com/css?family=Share+Tech|Droid+Sans|Lobster|Fenix|Unkempt|Flavors|Viga|Damion|Oleo+Script|Racing+Sans+One|Nixie+One|Fredoka+One|Open+Sans|Overlock+SC|Bubbler+One|Contrail+One|Gochi+Hand|Roboto+Condensed|Russo+One|Cinzel+Decorative|News+Cycle|Marcellus+SC|Chewy|Quicksand|Sanchez|Signika+Negative|Gloria+Hallelujah|Grand+Hotel|Droid+Serif|Englebert|Oswald|Pacifico|Titan+One|Shadows+Into+Light|Dancing+Script|Luckiest+Guy|Parisienne|Coming+Soon|Baumans|Belgrano');
97
+
98
+ global $optinforms_forms;
99
+
100
+ // Have any custom form designs been registered?
101
+ if ( is_array( $optinforms_forms ) ) {
102
+
103
+ // Loops through registered form designs.
104
+ foreach ( $optinforms_forms as $class_name => $design ) {
105
+
106
+ // Does the form have an stylesheet URL specified?
107
+ if ( !empty( $design->optinform['stylesheet_url'] ) ) {
108
+ wp_enqueue_style( $class_name, $design->optinform['stylesheet_url'] );
109
+ }
110
+ }
111
+ }
112
  }
113
 
114
  // Enqueue our form CSS on front end
118
  // Add our CSS and JS to admin head, but just for our pages (see load_optinforms_admin_scripts above!)
119
  function optinforms_scripts()
120
  {
 
121
  wp_enqueue_script('jquery');
122
  wp_enqueue_style('optinforms-stylesheet', plugins_url('/css/optinforms.css', __FILE__ ), array('optinforms-googleFont'));
123
  wp_enqueue_script('placeholder', plugins_url('/js/placeholder.js', __FILE__ ));
124
  wp_register_style('optinforms-googleFont', optinforms_used_fonts());
125
+
126
+ global $optinforms_forms;
127
+
128
+ // Have any custom form designs been registered?
129
+ if ( is_array( $optinforms_forms ) ) {
130
+
131
+ // Loops through registered form designs.
132
+ foreach ( $optinforms_forms as $class_name => $design ) {
133
+
134
+ // Does the form have an stylesheet URL specified?
135
+ if ( !empty( $design->optinform['stylesheet_url'] ) ) {
136
+ wp_enqueue_style( $class_name, $design->optinform['stylesheet_url'] );
137
+ }
138
+ }
139
+ }
140
  }
141
 
142
  // Add additional scripts to admin head on all admin pages (so supportbox slider will work on all pages!)
151
  if ( !current_user_can( 'manage_options' ) ) {
152
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
153
  }
154
+ }
155
+
156
+ /**
157
+ * Gets saved form setting
158
+ *
159
+ * Falls back on default form setting if there is no saved value.
160
+ *
161
+ * @param string $setting_id The ID of the setting to retrieve.
162
+ * @param string $design_class The class name of the design class that holds the default setting.
163
+ * @return string $setting The saved setting (or the default, if no setting is saved).
164
+ */
165
+ function optinforms_get_setting( $setting_id, $design_class = '' ) {
166
+
167
+ // Gets the saved setting from the database.
168
+ $setting = get_option( $setting_id );
169
+
170
+ // Is there no saved setting, and was a design class name provided?
171
+ if ( empty( $setting ) && !empty( $design_class ) ) {
172
+ $setting = optinforms_get_default_setting( $setting_id, $design_class );
173
+ }
174
+
175
+ return $setting;
176
+ }
177
+
178
+ /**
179
+ * Gets default form setting
180
+ *
181
+ * @param string $setting_id The ID of the setting to retrieve.
182
+ * @param string $design_class The class name of the design class that holds the default setting.
183
+ * @return string $setting The saved setting (or the default, if no setting is saved).
184
+ */
185
+ function optinforms_get_default_setting( $setting_id, $design_class = '' ) {
186
+
187
+ global $optinforms_forms;
188
+ $setting = '';
189
+
190
+ // Is there a default setting stored in the design class?
191
+ if ( !empty( $optinforms_forms[$design_class]->defaults[$setting_id] ) ) {
192
+ $setting = $optinforms_forms[$design_class]->defaults[$setting_id];
193
+ }
194
+
195
+ return $setting;
196
+ }
197
 
 
198
  function optinforms_main_page() {
199
+ global $optinforms_forms;
200
+
201
  { ?>
202
+ <div class="wrap">
203
+ <h2><?php echo __('Optin Forms', 'optin-forms'); ?></h2>
204
+ <div id="icon-optinforms" class="icon32">
205
+ </div><!--icon-32-->
206
  <h3 class="title"><?php echo optinforms_menu_tabs(); ?></h3>
207
+ </div><!--wrap-->
208
+
209
  <?php echo optinforms_configuration(); ?>
210
 
211
+ <?php if( isset($_GET['settings-updated']) ) { ?>
212
+ <div id="message" class="updated">
213
+ <p><strong><?php _e('Settings updated') ?></strong></p>
214
+ </div>
215
  <?php } ?>
216
+
217
+ <div id="optinforms">
218
+ <form method="post" action="options.php" id="frm1">
219
+ <?php settings_fields( 'optinforms-settings-group' ); ?>
220
+
221
+ <div id="optinforms-email-solution-tab" class="tabcontent">
222
+ <div class="optinforms-container-left">
223
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-email-solution.php'); ?>
224
+ </div><!--optinforms-container-left-->
225
+ <div class="optinforms-container-right">
226
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/sidebar.php'); ?>
227
+ </div><!--optinforms-container-right-->
228
+ <div class="clear"></div>
229
+ </div><!--optinforms-email-solution-tab-->
230
+
231
+ <div id="optinforms-posts-tab" class="tabcontent">
232
+ <div class="optinforms-container-left">
233
+ <div class="optiongroup">
234
+ <?php
235
+
236
+ ?>
237
+ <p><?php echo __('Add a beautiful optin form to your posts, custom post types and pages. Include the form on your website with a simple mouse-click, or use the shortcode to add it to specific posts and pages.', 'optin-forms'); ?></p>
238
+ <div class="optionleft">
239
+ <label for="optinforms_form_design" class="nopointer"><?php echo __('Form design', 'optin-forms'); ?></label>
240
+ </div><!--optionleft-->
241
+ <div class="optionmiddle">
242
+ <select name="optinforms_form_design" id="optinforms_form_design">
243
+ <option value="optinforms_form_design_option1" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option1') { echo 'selected="selected"'; } ?>>01</option>
244
+ <option value="optinforms_form_design_option2" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option2') { echo 'selected="selected"'; } ?>>02</option>
245
+ <option value="optinforms_form_design_option3" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option3') { echo 'selected="selected"'; } ?>>03</option>
246
+ <option value="optinforms_form_design_option4" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option4') { echo 'selected="selected"'; } ?>>04</option>
247
+ <option value="optinforms_form_design_option5" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option5') { echo 'selected="selected"'; } ?>>05</option>
248
+ <?php
249
+
250
+ // Have any custom form designs been registered?
251
+ if ( is_array( $optinforms_forms ) ) {
252
+
253
+ // Gets the saved form design ID.
254
+ $saved_design = get_option( 'optinforms_form_design' );
255
+
256
+ // Loops through registered form designs.
257
+ foreach ( $optinforms_forms as $class_name => $design ) {
258
+
259
+ // Does the form have an ID and a title?
260
+ if ( !empty( $design->optinform['id'] ) && !empty( $design->optinform['title'] ) ) {
261
+ echo '<option value="' . $design->optinform['id'] . '" ' . selected( $saved_design, $design->optinform['id'], false ) . '>' . $design->optinform['title'] . '</option>';
262
+
263
+ }
264
+ }
265
+ }
266
+ ?>
267
+ </select>
268
+ <script type="text/javascript">
269
+ // document.getElementById('optinforms_form_design').onchange = function() {
270
+ // var i = 1;
271
+ // var myDiv = document.getElementById("optinforms_form_design_option" + i);
272
+ // while(myDiv) {
273
+ // myDiv.style.display = 'none';
274
+ // myDiv = document.getElementById("optinforms_form_design_option" + ++i);
275
+ // }
276
+ // document.getElementById(this.value).style.display = 'block';
277
+ // };
278
+ </script>
279
+ </div><!--optionmiddle-->
280
+ <div class="optionlast">
281
+
282
+ </div><!--optionlast-->
283
+ <div class="clear"></div>
284
+
285
+ </div><!--optiongroup-->
286
+
287
+ <div id="optinforms-design-backend-wrap" class="optiongroup">
288
+ <div id="optinforms_form_design_option1" <?php if (get_option('optinforms_form_design')== '' || get_option('optinforms_form_design')== 'optinforms_form_design_option1') { echo 'style="display:block;"'; } ?>>
289
+
290
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-1.php'); ?>
291
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-1.php'); ?>
292
+
293
+ </div><!--optinforms_form_design_option1-->
294
+ <div id="optinforms_form_design_option2" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option2') { echo 'style="display:block;"'; } ?>>
295
+
296
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-2.php'); ?>
297
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-2.php'); ?>
298
+
299
+ </div><!--optinforms_form_design_option2-->
300
+ <div id="optinforms_form_design_option3" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option3') { echo 'style="display:block;"'; } ?>>
301
+
302
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-3.php'); ?>
303
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-3.php'); ?>
304
+
305
+ </div><!--optinforms_form_design_option3-->
306
+ <div id="optinforms_form_design_option4" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option4') { echo 'style="display:block;"'; } ?>>
307
+
308
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-4.php'); ?>
309
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-4.php'); ?>
310
+
311
+ </div><!--optinforms_form_design_option4-->
312
+ <div id="optinforms_form_design_option5" <?php if (get_option('optinforms_form_design')== 'optinforms_form_design_option5') { echo 'style="display:block;"'; } ?>>
313
+
314
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/preview-form-5.php'); ?>
315
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-5.php'); ?>
316
+
317
+ </div><!--optinforms_form_design_option5-->
318
+ <?php
319
+
320
+ // Have any custom form designs been registered?
321
+ if ( is_array( $optinforms_forms ) ) {
322
+
323
+ // Loops through registered form designs.
324
+ foreach ( $optinforms_forms as $class_name => $design ) {
325
+
326
+ // Does the form have an ID and a title?
327
+ if ( !empty( $design->optinform['id'] ) && !empty( $design->optinform['title'] ) ) {
328
+ $display = $saved_design == $design->optinform['id'] ? 'style="display:block;"' : 'style="display:none;"';
329
+ echo '<div id="' . $design->optinform['id'] . '" ' . $display . '>';
330
+
331
+ // Displays the form preview if available.
332
+ if ( method_exists( $design, 'get_optin_form' ) ) {
333
+ echo $design->get_optin_form();
334
+ }
335
+
336
+ // Displays the form options if available.
337
+ if ( file_exists( $design->optinform['options_url'] ) ) {
338
+ include( $design->optinform['options_url'] );
339
+ }
340
+
341
+ echo '</div>';
342
+
343
+
344
+ }
345
+ }
346
+ }
347
+ ?>
348
+ </div><!--optiongroup-->
349
+
350
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-functionality.php'); ?>
351
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/options-form-placement.php'); ?>
352
+
353
+ </div><!--optinforms-container-left-->
354
+ <div class="optinforms-container-right">
355
+ <?php include( plugin_dir_path( __FILE__ ) . 'includes/sidebar.php'); ?>
356
+ </div><!--optinforms-container-right-->
357
+ <div class="clear"></div>
358
+ </div><!--optinforms-posts-tab-->
359
+
360
+ <script type="text/javascript">
361
+ var wpthumbs=new ddtabcontent("optinforms-menu-tabs") //enter ID of Tab Container
362
+ wpthumbs.setpersist(true) //toogle persistence of the tabs' state
363
+ wpthumbs.setselectedClassTarget("link") //"link" or "linkparent"
364
+ wpthumbs.init()
365
+ </script>
366
+
367
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
368
+ </form>
369
+
370
  </div><!--optinforms-->
371
 
372
  <?php }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: brs, FancyThemes
3
  Tags: optin, form, forms, aweber, email subscriber, icontact, mailchimp, getresponse, mad mimi, newsletter, mailchimp forms, mailchimp integrations, mailchimp plugin, getresponse forms, subscribe, aweber forms, after post optin form, after post optin form plugin, lead generation, mobile optin forms, mobile optins, sidebar form, sidebar optin form, wordpress after post optin form, wordpress lead generation, wordpress popups, optin locker, social locker, enter email to download, interspire, email marketer, email marketing, email, e-mail, list, list building, opt-in, newsletter, email list, autoresponder, popup, pop-up, mailing, mailing list, mail, webform, newsletter plugin, optin plugin, opt-in plugin, conversion, design
4
  Requires at least: 3.2
5
- Tested up to: 4.4.2
6
- Stable tag: 1.1.9
7
 
8
  Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
9
 
@@ -42,7 +42,7 @@ If are you looking for other alternatives check-out our article on <a href="http
42
  == Frequently Asked Questions ==
43
 
44
  = How can I get support? =
45
-
46
  Having trouble with the plugin? Simply post your question to the [support forum](http://wordpress.org/support/plugin/optin-forms) and we'll help you out.
47
 
48
  == Screenshots ==
@@ -53,6 +53,12 @@ Having trouble with the plugin? Simply post your question to the [support forum]
53
  3. Add your form to your website with a simple mouse-click.
54
 
55
  == Changelog ==
 
 
 
 
 
 
56
  = 1.1.9 =
57
  * Updated GetResponse to campaign token.
58
  * Updated broken links.
@@ -79,7 +85,7 @@ Having trouble with the plugin? Simply post your question to the [support forum]
79
  * Updated mailing form.
80
 
81
  = 1.1.3 =
82
- * Improved responsive design form 02.
83
  * Added Spanish translation.
84
 
85
  = 1.1.2 =
2
  Contributors: brs, FancyThemes
3
  Tags: optin, form, forms, aweber, email subscriber, icontact, mailchimp, getresponse, mad mimi, newsletter, mailchimp forms, mailchimp integrations, mailchimp plugin, getresponse forms, subscribe, aweber forms, after post optin form, after post optin form plugin, lead generation, mobile optin forms, mobile optins, sidebar form, sidebar optin form, wordpress after post optin form, wordpress lead generation, wordpress popups, optin locker, social locker, enter email to download, interspire, email marketer, email marketing, email, e-mail, list, list building, opt-in, newsletter, email list, autoresponder, popup, pop-up, mailing, mailing list, mail, webform, newsletter plugin, optin plugin, opt-in plugin, conversion, design
4
  Requires at least: 3.2
5
+ Tested up to: 4.5.2
6
+ Stable tag: 1.2.1
7
 
8
  Create beautiful optin forms with ease. Choose a form design, customize it, and add your form to your blog with a simple mouse-click.
9
 
42
  == Frequently Asked Questions ==
43
 
44
  = How can I get support? =
45
+
46
  Having trouble with the plugin? Simply post your question to the [support forum](http://wordpress.org/support/plugin/optin-forms) and we'll help you out.
47
 
48
  == Screenshots ==
53
  3. Add your form to your website with a simple mouse-click.
54
 
55
  == Changelog ==
56
+ = 1.2.1 =
57
+ * Fixed a bug that was throwing an error when no custom form designs were registered.
58
+
59
+ = 1.2.0 =
60
+ * Added the ability for themes and plugins to extend Optin Forms with their own custom form designs.
61
+
62
  = 1.1.9 =
63
  * Updated GetResponse to campaign token.
64
  * Updated broken links.
85
  * Updated mailing form.
86
 
87
  = 1.1.3 =
88
+ * Improved responsive design form 02.
89
  * Added Spanish translation.
90
 
91
  = 1.1.2 =