|
1
|
|
|
<?php |
|
2
|
|
|
if ( ! defined( 'ABSPATH' ) ) { |
|
3
|
|
|
die( 'You are not allowed to call this page directly.' ); |
|
4
|
|
|
} |
|
5
|
|
|
|
|
6
|
|
|
// add post action |
|
7
|
|
View Code Duplication |
class FrmDefPostAction extends FrmFormAction { |
|
|
|
|
|
|
8
|
|
|
public function __construct() { |
|
9
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_wordpress_icon frm-inverse frm_show_upgrade' ); |
|
10
|
|
|
$action_ops['color'] = 'rgb(0,160,210)'; |
|
11
|
|
|
|
|
12
|
|
|
parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops ); |
|
13
|
|
|
} |
|
14
|
|
|
} |
|
15
|
|
|
|
|
16
|
|
|
// add register action |
|
17
|
|
View Code Duplication |
class FrmDefRegAction extends FrmFormAction { |
|
|
|
|
|
|
18
|
|
|
public function __construct() { |
|
19
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_register_icon frm_show_upgrade' ); |
|
20
|
|
|
$action_ops['plugin'] = 'registration'; |
|
21
|
|
|
$action_ops['color'] = 'var(--pink)'; |
|
22
|
|
|
parent::__construct( 'register', __( 'Register User', 'formidable' ), $action_ops ); |
|
23
|
|
|
} |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
// add paypal action |
|
27
|
|
|
class FrmDefPayPalAction extends FrmFormAction { |
|
28
|
|
|
public function __construct() { |
|
29
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_paypal_icon frm-inverse frm_show_upgrade' ); |
|
30
|
|
|
$action_ops['color'] = 'var(--primary-hover)'; |
|
31
|
|
|
|
|
32
|
|
|
parent::__construct( 'paypal', 'PayPal', $action_ops ); |
|
33
|
|
|
} |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
// add aweber action |
|
37
|
|
|
class FrmDefAweberAction extends FrmFormAction { |
|
38
|
|
|
public function __construct() { |
|
39
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_aweber_icon frm_show_upgrade' ); |
|
40
|
|
|
$action_ops['color'] = 'var(--green)'; |
|
41
|
|
|
parent::__construct( 'aweber', 'AWeber', $action_ops ); |
|
42
|
|
|
} |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
// add mailchimp action |
|
46
|
|
|
class FrmDefMlcmpAction extends FrmFormAction { |
|
47
|
|
|
public function __construct() { |
|
48
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon frm_show_upgrade frm-inverse' ); |
|
49
|
|
|
$action_ops['color'] = 'var(--dark-grey)'; |
|
50
|
|
|
|
|
51
|
|
|
parent::__construct( 'mailchimp', 'MailChimp', $action_ops ); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
// add zapier action |
|
56
|
|
|
class FrmDefZapierAction extends FrmFormAction { |
|
57
|
|
|
public function __construct() { |
|
58
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_zapier_icon frm_show_upgrade' ); |
|
59
|
|
|
parent::__construct( 'zapier', 'Zapier', $action_ops ); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
// add twilio action |
|
64
|
|
View Code Duplication |
class FrmDefTwilioAction extends FrmFormAction { |
|
|
|
|
|
|
65
|
|
|
public function __construct() { |
|
66
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_sms_icon frm_show_upgrade' ); |
|
67
|
|
|
parent::__construct( 'twilio', __( 'Twilio SMS', 'formidable' ), $action_ops ); |
|
68
|
|
|
} |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
// add payment action |
|
72
|
|
View Code Duplication |
class FrmDefHrsAction extends FrmFormAction { |
|
|
|
|
|
|
73
|
|
|
public function __construct() { |
|
74
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_stripe_icon frm_credit_card_alt_icon frm_show_upgrade' ); |
|
75
|
|
|
$action_ops['color'] = 'var(--green)'; |
|
76
|
|
|
$action_ops['plugin'] = 'stripe'; |
|
77
|
|
|
parent::__construct( 'payment', __( 'eCommerce', 'formidable' ), $action_ops ); |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
class FrmDefActiveCampaignAction extends FrmFormAction { |
|
82
|
|
|
public function __construct() { |
|
83
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_activecampaign_icon frm_show_upgrade' ); |
|
84
|
|
|
$action_ops['color'] = 'var(--primary-hover)'; |
|
85
|
|
|
parent::__construct( 'activecampaign', 'ActiveCampaign', $action_ops ); |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
class FrmDefSalesforceAction extends FrmFormAction { |
|
90
|
|
|
public function __construct() { |
|
91
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_salesforce_icon frm-inverse frm_show_upgrade' ); |
|
92
|
|
|
$action_ops['color'] = 'var(--primary-color)'; |
|
93
|
|
|
parent::__construct( 'salesforce', 'Salesforce', $action_ops ); |
|
94
|
|
|
} |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
class FrmDefConstContactAction extends FrmFormAction { |
|
98
|
|
|
public function __construct() { |
|
99
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_constant_contact_icon frm_show_upgrade' ); |
|
100
|
|
|
$action_ops['color'] = 'rgb(0,160,210)'; |
|
101
|
|
|
parent::__construct( 'constantcontact', 'Constant Contact', $action_ops ); |
|
102
|
|
|
} |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
class FrmDefGetResponseAction extends FrmFormAction { |
|
106
|
|
|
public function __construct() { |
|
107
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_getresponse_icon frm_show_upgrade' ); |
|
108
|
|
|
$action_ops['color'] = '#00baff'; |
|
109
|
|
|
parent::__construct( 'getresponse', 'GetResponse', $action_ops ); |
|
110
|
|
|
} |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
class FrmDefHubspotAction extends FrmFormAction { |
|
114
|
|
|
public function __construct() { |
|
115
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_hubspot_icon frm_show_upgrade' ); |
|
116
|
|
|
$action_ops['color'] = 'var(--orange)'; |
|
117
|
|
|
parent::__construct( 'hubspot', 'Hubspot', $action_ops ); |
|
118
|
|
|
} |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
class FrmDefHighriseAction extends FrmFormAction { |
|
122
|
|
|
public function __construct() { |
|
123
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_building_icon frm_show_upgrade' ); |
|
124
|
|
|
$action_ops['color'] = 'var(--purple)'; |
|
125
|
|
|
parent::__construct( 'highrise', 'Highrise', $action_ops ); |
|
126
|
|
|
} |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
class FrmDefMailpoetAction extends FrmFormAction { |
|
130
|
|
|
public function __construct() { |
|
131
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_mailpoet_icon frm_show_upgrade' ); |
|
132
|
|
|
$action_ops['color'] = 'var(--orange)'; |
|
133
|
|
|
parent::__construct( 'mailpoet', 'MailPoet', $action_ops ); |
|
134
|
|
|
} |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
View Code Duplication |
class FrmDefApiAction extends FrmFormAction { |
|
|
|
|
|
|
138
|
|
|
public function __construct() { |
|
139
|
|
|
$action_ops = FrmFormAction::default_action_opts( 'frm_feed_icon frm_show_upgrade' ); |
|
140
|
|
|
$action_ops['color'] = 'var(--purple)'; |
|
141
|
|
|
parent::__construct( 'api', __( 'Send API data', 'formidable' ), $action_ops ); |
|
142
|
|
|
} |
|
143
|
|
|
} |
|
144
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.