PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.4.0
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.4.0
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / admin / class-pro-upgrades.php

class-pro-upgrades.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.4.0, at includes/admin/class-pro-upgrades.php

134 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The Pro Integrations
5 */
6 class WeForms_Pro_Upgrades {
7
8 /**
9 * Initialize
10 */
11 function __construct() {
12
13 if ( class_exists( 'WeForms_Pro' ) ) {
14 return;
15 }
16
17 add_filter( 'weforms_integrations', array( $this, 'register_pro_integrations' ) );
18
19 // form fields
20 add_filter( 'weforms_field_get_js_settings', array( $this, 'add_conditional_field_prompt' ) );
21 add_filter( 'weforms_form_fields', array( $this, 'register_pro_fields' ) );
22 add_filter( 'weforms_field_groups_custom', array( $this, 'add_to_custom_fields' ) );
23 add_filter( 'weforms_field_groups_others', array( $this, 'add_to_others_fields' ) );
24 }
25
26 /**
27 * Register the pro integrations
28 *
29 * @param array $integrations
30 *
31 * @return array
32 */
33 public function register_pro_integrations( $integrations ) {
34 require_once WEFORMS_INCLUDES . '/admin/class-pro-upgrade-integrations.php';
35
36 $pro = array(
37 'WeForms_Pro_Integration_MailChimp',
38 'WeForms_Pro_Integration_CM',
39 'WeForms_Pro_Integration_CC',
40 'WeForms_Pro_Integration_AWeber',
41 'WeForms_Pro_Integration_ConvertKit',
42 'WeForms_Pro_Integration_GetResponse',
43 'WeForms_Pro_Integration_GoogleAnalytics',
44 'WeForms_Pro_Integration_GoogleSheets',
45 'WeForms_Pro_Integration_HubSpot',
46 'WeForms_Pro_Integration_SalesForce',
47 'WeForms_Pro_Integration_Trello',
48 'WeForms_Pro_Integration_Zapier',
49 'WeForms_Pro_Integration_Zoho'
50 );
51
52 return array_merge( $integrations, $pro );
53 }
54
55 /**
56 * Register pro fields
57 *
58 * @param array $fields
59 *
60 * @return array
61 */
62 public function register_pro_fields( $fields ) {
63 if ( ! class_exists( 'WeForms_Form_Field_Pro' ) ) {
64 require_once WEFORMS_INCLUDES . '/fields/class-fields-pro.php';
65 }
66
67 require_once WEFORMS_INCLUDES . '/admin/class-pro-upgrade-fields.php';
68
69 $fields['repeat_field'] = new WeForms_Form_Field_Repeat();
70 $fields['file_upload'] = new WeForms_Form_Field_File();
71 $fields['country_list_field'] = new WeForms_Form_Field_Country();
72 $fields['numeric_text_field'] = new WeForms_Form_Field_Numeric();
73 $fields['address_field'] = new WeForms_Form_Field_Address();
74 $fields['google_map'] = new WeForms_Form_Field_GMap();
75 $fields['shortcode'] = new WeForms_Form_Field_Shortcode();
76 $fields['action_hook'] = new WeForms_Form_Field_Hook();
77 $fields['toc'] = new WeForms_Form_Field_Toc();
78 $fields['ratings'] = new WeForms_Form_Field_Rating();
79 $fields['linear_scale'] = new WeForms_Form_Field_Linear_Scale();
80 $fields['checkbox_grid'] = new WeForms_Form_Field_Checkbox_Grid();
81 $fields['multiple_choice_grid'] = new WeForms_Form_Field_Multiple_Choice_Grid();
82 $fields['step_start'] = new WeForms_Form_Field_Step();
83
84 return $fields;
85 }
86
87 /**
88 * Register fields to custom field section
89 *
90 * @param array $fields
91 */
92 public function add_to_custom_fields( $fields ) {
93 $pro_fields = array(
94 'repeat_field', 'date_field', 'file_upload', 'country_list_field',
95 'numeric_text_field', 'address_field', 'google_map', 'step_start'
96 );
97
98 return array_merge( $fields, $pro_fields );
99 }
100
101 /**
102 * Register fields to others field section
103 *
104 * @param array $fields
105 */
106 public function add_to_others_fields( $fields ) {
107 $pro_fields = array(
108 'shortcode', 'action_hook', 'toc', 'ratings', 'linear_scale', 'checkbox_grid', 'multiple_choice_grid'
109 );
110
111 return array_merge( $fields, $pro_fields );
112 }
113
114 /**
115 * Add conditional logic prompt
116 *
117 * @param array $settings
118 */
119 public function add_conditional_field_prompt( $settings ) {
120
121 $settings['settings'][] = array(
122 'name' => 'wpuf_cond',
123 'title' => __( 'Conditional Logic', 'weforms' ),
124 'type' => 'option-pro-feature-alert',
125 'section' => 'advanced',
126 'priority' => 30,
127 'help_text' => '',
128 'is_pro_feature' => true
129 );
130
131 return $settings;
132 }
133 }
134