Contact Form Email - Version 1.2.55

Version Description

  • Compatible with Gutenberg
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Contact Form Email
Version 1.2.55
Comparing to
See all releases

Code changes from version 1.2.54 to 1.2.55

Files changed (4) hide show
  1. README.txt +5 -2
  2. cp-main-class.inc.php +16 -0
  3. form-to-email.php +2 -1
  4. js/block.js +75 -0
README.txt CHANGED
@@ -454,6 +454,9 @@ When you click a field already added into the contact form builder area, you can
454
 
455
  == Changelog ==
456
 
 
 
 
457
  = 1.2.54 =
458
  * Interface improvements
459
 
@@ -923,5 +926,5 @@ When you click a field already added into the contact form builder area, you can
923
 
924
  == Upgrade Notice ==
925
 
926
- = 1.2.54 =
927
- * Interface improvements
454
 
455
  == Changelog ==
456
 
457
+ = 1.2.55 =
458
+ * Compatible with Gutenberg
459
+
460
  = 1.2.54 =
461
  * Interface improvements
462
 
926
 
927
  == Upgrade Notice ==
928
 
929
+ = 1.2.55 =
930
+ * Compatible with Gutenberg
cp-main-class.inc.php CHANGED
@@ -436,6 +436,22 @@ class CP_ContactFormToEmail extends CP_CFTEMAIL_BaseClass {
436
  else
437
  @include_once dirname( __FILE__ ) . '/cp-admin-int-list.inc.php';
438
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
 
440
 
441
  function insert_adminScripts($hook) {
436
  else
437
  @include_once dirname( __FILE__ ) . '/cp-admin-int-list.inc.php';
438
  }
439
+
440
+ function gutenberg_block() {
441
+ if (function_exists('register_block_type'))
442
+ {
443
+ wp_register_script(
444
+ 'cpcfte-step01',
445
+ plugins_url( 'js/block.js', __FILE__ ),
446
+ array( 'wp-blocks', 'wp-element' )
447
+ );
448
+
449
+
450
+ register_block_type( 'cpcfte/cp-contact-form-to-email-step-01', array(
451
+ 'editor_script' => 'cpcfte-step01',
452
+ ) );
453
+ }
454
+ }
455
 
456
 
457
  function insert_adminScripts($hook) {
form-to-email.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
- Version: 1.2.54
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email
@@ -88,6 +88,7 @@ if ( is_admin() ) {
88
  add_action('admin_enqueue_scripts', array($cp_cfte_plugin,'insert_adminScripts'), 1);
89
  add_filter("plugin_action_links_".plugin_basename(__FILE__), array($cp_cfte_plugin,'plugin_page_links'));
90
  add_action('admin_menu', array($cp_cfte_plugin,'admin_menu') );
 
91
  } else {
92
  add_shortcode( $cp_cfte_plugin->shorttag, array($cp_cfte_plugin, 'filter_content') );
93
  }
3
  Plugin Name: Contact Form Email
4
  Plugin URI: https://form2email.dwbooster.com/download
5
  Description: Contact form that sends the data to email and also to a database list and CSV file.
6
+ Version: 1.2.55
7
  Author: CodePeople
8
  Author URI: https://form2email.dwbooster.com
9
  Text Domain: contact-form-to-email
88
  add_action('admin_enqueue_scripts', array($cp_cfte_plugin,'insert_adminScripts'), 1);
89
  add_filter("plugin_action_links_".plugin_basename(__FILE__), array($cp_cfte_plugin,'plugin_page_links'));
90
  add_action('admin_menu', array($cp_cfte_plugin,'admin_menu') );
91
+ add_action( 'init', array($cp_cfte_plugin,'gutenberg_block') );
92
  } else {
93
  add_shortcode( $cp_cfte_plugin->shorttag, array($cp_cfte_plugin, 'filter_content') );
94
  }
js/block.js ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( blocks, element ) {
2
+ var el = wp.element.createElement,
3
+ source = blocks.source,
4
+ InspectorControls = blocks.InspectorControls,
5
+ category = {slug:'contact-form-to-email', title : 'Contact Form to Email'};
6
+
7
+ /* Plugin Category */
8
+ blocks.getCategories().push({slug: 'cpcfte', title: 'Contact Form to Email'})
9
+
10
+ blocks.registerBlockType( 'cpcfte/cp-contact-form-to-email-step-01', {
11
+ title: 'Contact Form to Email',
12
+ icon: 'email-alt',
13
+ category: 'cpcfte',
14
+ supports: {
15
+ customClassName: false,
16
+ className: false
17
+ },
18
+ attributes: {
19
+ shortcode : {
20
+ type : 'string',
21
+ source : 'text',
22
+ default: '[CONTACT_FORM_TO_EMAIL]'
23
+ }
24
+ },
25
+
26
+ edit: function( props ) {
27
+ var focus = props.focus;
28
+ return [
29
+ !!focus && el(
30
+ InspectorControls,
31
+ {
32
+ key: 'cpcfte_inspector'
33
+ },
34
+ [
35
+ el(
36
+ 'span',
37
+ {
38
+ key: 'cpcfte_inspector_help',
39
+ style:{fontStyle: 'italic'}
40
+ },
41
+ 'If you need help: '
42
+ ),
43
+ el(
44
+ 'a',
45
+ {
46
+ key : 'cpcfte_inspector_help_link',
47
+ href : 'https://form2email.dwbooster.com/contact-us',
48
+ target : '_blank'
49
+ },
50
+ 'CLICK HERE'
51
+ ),
52
+ ]
53
+ ),
54
+ el('textarea',
55
+ {
56
+ key: 'cpcfte_form_shortcode',
57
+ value: props.attributes.shortcode,
58
+ onChange: function(evt){
59
+ props.setAttributes({shortcode: evt.target.value});
60
+ },
61
+ style: {width:"100%", resize: "vertical"}
62
+ }
63
+ )
64
+ ];
65
+ },
66
+
67
+ save: function( props ) {
68
+ return props.attributes.shortcode;
69
+ },
70
+ } );
71
+
72
+ } )(
73
+ window.wp.blocks,
74
+ window.wp.element
75
+ );