Version Description
- Improvement: Improvements to admin notices behavior and styles.
- Bugfix: Fix Legal part's undefined offset error in HTML class.
Download this release
Release Info
Developer | thethemefoundry |
Plugin | Form builder to get in touch with visitors, grow your email list and collect payments — Happyforms |
Version | 1.6.22 |
Comparing to | |
See all releases |
Code changes from version 1.6.21 to 1.6.22
- happyforms.php +2 -2
- inc/classes/class-happyforms.php +74 -23
- inc/core/assets/css/notice.css +130 -0
- inc/core/assets/css/preview.css +0 -82
- inc/core/assets/js/admin/block.js +21 -4
- inc/core/classes/class-admin-notices.php +3 -3
- inc/core/classes/class-block.php +7 -0
- inc/core/classes/class-happyforms-core.php +6 -0
- inc/core/classes/parts/class-part-legal.php +11 -12
- inc/core/templates/preview-form-edit.php +2 -0
- languages/happyforms.pot +42 -28
- readme.txt +8 -1
happyforms.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin URI: https://happyforms.me
|
6 |
* Description: Your friendly drag and drop contact form builder for creating contact forms, lead generation forms, feedback forms, quote forms, survey forms and more!
|
7 |
* Author: The Theme Foundry
|
8 |
-
* Version: 1.6.
|
9 |
* Author URI: https://thethemefoundry.com
|
10 |
* Upgrade URI: https://thethemefoundry.com
|
11 |
*/
|
@@ -13,7 +13,7 @@
|
|
13 |
/**
|
14 |
* The current version of the plugin.
|
15 |
*/
|
16 |
-
define( 'HAPPYFORMS_VERSION', '1.6.
|
17 |
|
18 |
if ( ! function_exists( 'happyforms_plugin_file' ) ):
|
19 |
/**
|
5 |
* Plugin URI: https://happyforms.me
|
6 |
* Description: Your friendly drag and drop contact form builder for creating contact forms, lead generation forms, feedback forms, quote forms, survey forms and more!
|
7 |
* Author: The Theme Foundry
|
8 |
+
* Version: 1.6.22
|
9 |
* Author URI: https://thethemefoundry.com
|
10 |
* Upgrade URI: https://thethemefoundry.com
|
11 |
*/
|
13 |
/**
|
14 |
* The current version of the plugin.
|
15 |
*/
|
16 |
+
define( 'HAPPYFORMS_VERSION', '1.6.22' );
|
17 |
|
18 |
if ( ! function_exists( 'happyforms_plugin_file' ) ):
|
19 |
/**
|
inc/classes/class-happyforms.php
CHANGED
@@ -7,6 +7,54 @@ class HappyForms extends HappyForms_Core {
|
|
7 |
|
8 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
9 |
add_action( 'happyforms_form_before', array( $this, 'add_preview_notices' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
public function add_preview_notices( $form ) {
|
@@ -14,36 +62,39 @@ class HappyForms extends HappyForms_Core {
|
|
14 |
$admin_notices = happyforms_get_admin_notices();
|
15 |
$form_controller = happyforms_get_form_controller();
|
16 |
|
17 |
-
$
|
18 |
-
'
|
19 |
-
'happyforms-notice--upgrade'
|
20 |
-
),
|
21 |
-
'cap' => $form_controller->capability,
|
22 |
-
'type' => 'custom',
|
23 |
-
'title' => __( 'Don\'t miss out on these advanced features 🎉', 'happyforms' ),
|
24 |
-
'screen' => array( 'happyforms-preview' ),
|
25 |
-
'dismissible' => true,
|
26 |
);
|
27 |
|
|
|
|
|
28 |
$admin_notices->register(
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
<li>' . __( 'Allow folks to easily upload files to your forms.', 'happyforms' ) . '</li>
|
33 |
-
<li>' . __( 'Show and hide forms using a date and time scheduler.', 'happyforms' ) . '</li>
|
34 |
-
<li>' . __( 'Display your forms in a custom overlay / modal window.', 'happyforms' ) . '</li>
|
35 |
-
<li>' . __( 'Shuffle your form questions to create randomized surveys.', 'happyforms' ) . '</li>
|
36 |
-
<li>' . __( 'Secure individual forms with strong password protection.', 'happyforms' ) . '</li>
|
37 |
-
<li>' . __( 'Limit the number of responses each of your forms get.', 'happyforms' ) . '</li>
|
38 |
-
</ul>
|
39 |
-
<p><a href="%s">' . __( 'Discover more benefits of upgrading', 'happyforms' ) . '</a></p>',
|
40 |
-
'https://happyforms.me/upgrade'
|
41 |
-
),
|
42 |
-
$upgrade_notice_args
|
43 |
);
|
44 |
}
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
public function admin_menu() {
|
48 |
parent::admin_menu();
|
49 |
|
7 |
|
8 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
9 |
add_action( 'happyforms_form_before', array( $this, 'add_preview_notices' ) );
|
10 |
+
add_action( 'admin_notices', array( $this, 'add_classic_editor_notices' ) );
|
11 |
+
add_action( 'admin_notices', array( $this, 'add_response_notices' ) );
|
12 |
+
}
|
13 |
+
|
14 |
+
public function get_upgrade_notice_args() {
|
15 |
+
return array(
|
16 |
+
'classes' => array(
|
17 |
+
'happyforms-notice--custom happyforms-notice--upgrade'
|
18 |
+
),
|
19 |
+
'type' => 'custom',
|
20 |
+
'title' => __( 'Oh-no! You\'re missing out on these HappyForms features…', 'happyforms' ),
|
21 |
+
'dismissible' => true,
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function get_upgrade_notice_message() {
|
26 |
+
return sprintf(
|
27 |
+
'<ul>
|
28 |
+
<li>' . __( 'File upload part', 'happyforms' ) . '</li>
|
29 |
+
<li>' . __( 'Schedule form display', 'happyforms' ) . '</li>
|
30 |
+
<li>' . __( 'Password protect forms', 'happyforms' ) . '</li>
|
31 |
+
<li>' . __( 'Open form in a pop-up', 'happyforms' ) . '</li>
|
32 |
+
<li>' . __( 'Limit responses', 'happyforms' ) . '</li>
|
33 |
+
<li>' . __( 'Filter responses', 'happyforms' ) . '</li>
|
34 |
+
<li>' . __( 'Shuffle form parts', 'happyforms' ) . '</li>
|
35 |
+
</ul>
|
36 |
+
<p><a href="%s" class="%s" target="%s">'. __( 'Discover HappyForms Upgrade', 'happyforms' ) . '</a></p>',
|
37 |
+
'https://happyforms.me/upgrade',
|
38 |
+
'button button-primary button-hero',
|
39 |
+
'_blank'
|
40 |
+
);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function add_response_notices() {
|
44 |
+
$admin_notices = happyforms_get_admin_notices();
|
45 |
+
$message_id = get_the_ID();
|
46 |
+
|
47 |
+
$args = array(
|
48 |
+
'screen' => array( 'happyforms-message' )
|
49 |
+
);
|
50 |
+
|
51 |
+
$args = wp_parse_args( $args, $this->get_upgrade_notice_args() );
|
52 |
+
|
53 |
+
$admin_notices->register(
|
54 |
+
"happyforms_message_{$message_id}_upgrade",
|
55 |
+
$this->get_upgrade_notice_message(),
|
56 |
+
$args
|
57 |
+
);
|
58 |
}
|
59 |
|
60 |
public function add_preview_notices( $form ) {
|
62 |
$admin_notices = happyforms_get_admin_notices();
|
63 |
$form_controller = happyforms_get_form_controller();
|
64 |
|
65 |
+
$args = array(
|
66 |
+
'screen' => array( 'happyforms-preview' )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
);
|
68 |
|
69 |
+
$args = wp_parse_args( $args, $this->get_upgrade_notice_args() );
|
70 |
+
|
71 |
$admin_notices->register(
|
72 |
+
"happyforms_form_{$form['ID']}_upgrade",
|
73 |
+
$this->get_upgrade_notice_message(),
|
74 |
+
$args
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
);
|
76 |
}
|
77 |
}
|
78 |
|
79 |
+
public function add_classic_editor_notices() {
|
80 |
+
$post_id = get_the_ID();
|
81 |
+
$admin_notices = happyforms_get_admin_notices();
|
82 |
+
|
83 |
+
$admin_notices->register(
|
84 |
+
"happyforms_post_{$post_id}_upgrade",
|
85 |
+
sprintf(
|
86 |
+
__( 'Do you want access to HappyForms’ most powerful features? <a href="%s" target="%s">Discover HappyForms Upgrade</a>', 'happyforms' ),
|
87 |
+
'https://happyforms.me/upgrade',
|
88 |
+
'_blank'
|
89 |
+
),
|
90 |
+
array(
|
91 |
+
'type' => 'warning',
|
92 |
+
'dismissible' => true,
|
93 |
+
'screen' => array( 'page', 'post' )
|
94 |
+
)
|
95 |
+
);
|
96 |
+
}
|
97 |
+
|
98 |
public function admin_menu() {
|
99 |
parent::admin_menu();
|
100 |
|
inc/core/assets/css/notice.css
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.happyforms-notice--custom {
|
2 |
+
position: relative;
|
3 |
+
margin-bottom: 15px;
|
4 |
+
padding: 25px;
|
5 |
+
border-left: 6px solid #FFB900;
|
6 |
+
background-color: #FFF8E5;
|
7 |
+
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
|
8 |
+
}
|
9 |
+
|
10 |
+
.happyforms-notice--custom h2.happyforms-notice__title {
|
11 |
+
margin: 0 0 15px !important;
|
12 |
+
padding: 0 !important;
|
13 |
+
font-weight: bold !important;
|
14 |
+
font-size: 16px !important;
|
15 |
+
color: #000 !important;
|
16 |
+
}
|
17 |
+
|
18 |
+
.happyforms-notice--custom p {
|
19 |
+
margin-bottom: 0 !important;
|
20 |
+
color: #444 !important;
|
21 |
+
}
|
22 |
+
|
23 |
+
.happyforms-notice--custom ul {
|
24 |
+
list-style: none !important;
|
25 |
+
display: flex !important;
|
26 |
+
flex-flow: column wrap !important;
|
27 |
+
margin: 0 0 15px !important;
|
28 |
+
padding: 0 !important;
|
29 |
+
}
|
30 |
+
|
31 |
+
.happyforms-notice--custom ul li {
|
32 |
+
flex: 1;
|
33 |
+
width: 100%;
|
34 |
+
line-height: 1.65;
|
35 |
+
}
|
36 |
+
|
37 |
+
@media screen and (min-width: 800px) {
|
38 |
+
.happyforms-notice--custom ul {
|
39 |
+
flex-flow: row wrap !important;
|
40 |
+
}
|
41 |
+
|
42 |
+
.happyforms-notice--custom ul li {
|
43 |
+
flex: 0 1 32%;
|
44 |
+
width: 32%;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
@media screen and (min-width: 1000px) {
|
49 |
+
.happyforms-notice--custom ul li {
|
50 |
+
flex: 0 1 24%;
|
51 |
+
width: 24%;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
.happyforms-notice--custom p,
|
56 |
+
.happyforms-notice--custom ul li {
|
57 |
+
font-size: 16px !important;
|
58 |
+
color: #000 !important;
|
59 |
+
}
|
60 |
+
|
61 |
+
.happyforms-notice--custom ul li:before {
|
62 |
+
content: url('data:image/svg+xml; utf8, <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-check-circle fa-w-16 fa-2x"><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z" class=""></path></svg>');
|
63 |
+
position: relative;
|
64 |
+
top: 1px;
|
65 |
+
display: inline-block;
|
66 |
+
width: 15px;
|
67 |
+
height: 15px;
|
68 |
+
margin-right: 5px;
|
69 |
+
}
|
70 |
+
|
71 |
+
.happyforms-notice--custom .happyforms-dismiss-notice,
|
72 |
+
.happyforms-notice--custom .notice-dismiss {
|
73 |
+
cursor: pointer;
|
74 |
+
outline: 0;
|
75 |
+
position: absolute;
|
76 |
+
top: 10px;
|
77 |
+
right: 10px;
|
78 |
+
text-decoration: none;
|
79 |
+
text-shadow: none;
|
80 |
+
box-shadow: none;
|
81 |
+
}
|
82 |
+
|
83 |
+
.happyforms-notice--custom .happyforms-dismiss-notice:before,
|
84 |
+
.happyforms-notice--custom .notice-dismiss:before {
|
85 |
+
content: "\f153";
|
86 |
+
font-family: dashicons;
|
87 |
+
font-size: 18px;
|
88 |
+
color: #333;
|
89 |
+
text-decoration: none;
|
90 |
+
}
|
91 |
+
|
92 |
+
.happyforms-notice--custom .happyforms-dismiss-notice:hover:before,
|
93 |
+
.happyforms-notice--custom .notice-dismiss:hover:before {
|
94 |
+
color: #333;
|
95 |
+
}
|
96 |
+
|
97 |
+
.happyforms-notice--custom a.button {
|
98 |
+
-webkit-appearance: none;
|
99 |
+
outline: 0;
|
100 |
+
display: inline-block;
|
101 |
+
cursor: pointer !important;
|
102 |
+
padding: 14px 36px;
|
103 |
+
border-width: 1px;
|
104 |
+
border-style: solid;
|
105 |
+
border-radius: 3px;
|
106 |
+
border-color: #0073aa #006799 #006799;
|
107 |
+
box-sizing: border-box;
|
108 |
+
line-height: 1.4285714;
|
109 |
+
font-weight: normal;
|
110 |
+
font-size: 14px;
|
111 |
+
white-space: nowrap;
|
112 |
+
color: #fff;
|
113 |
+
text-decoration: none;
|
114 |
+
text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;
|
115 |
+
background: #0085ba;
|
116 |
+
box-shadow: 0 1px 0 #006799;
|
117 |
+
}
|
118 |
+
|
119 |
+
.happyforms-notice--custom a.button:hover {
|
120 |
+
border-color: #006799;
|
121 |
+
background: #008ec2;
|
122 |
+
color: #fff;
|
123 |
+
}
|
124 |
+
|
125 |
+
.happyforms-notice--custom a.button:active {
|
126 |
+
vertical-align: top;
|
127 |
+
border-color: #006799;
|
128 |
+
background: #0073aa;
|
129 |
+
box-shadow: inset 0 3px 0 #006799;
|
130 |
+
}
|
inc/core/assets/css/preview.css
CHANGED
@@ -80,86 +80,4 @@ a.happyforms-ask-link.customize-unpreviewable {
|
|
80 |
|
81 |
.preview-hidden {
|
82 |
display: none !important;
|
83 |
-
}
|
84 |
-
|
85 |
-
.happyforms-notice {
|
86 |
-
position: relative;
|
87 |
-
margin-bottom: 15px;
|
88 |
-
padding: 25px;
|
89 |
-
border-left: 6px solid #FFB900;
|
90 |
-
background-color: #FFF8E5;
|
91 |
-
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
92 |
-
}
|
93 |
-
|
94 |
-
.happyforms-notice h2.happyforms-notice__title {
|
95 |
-
margin: 0 0 20px !important;
|
96 |
-
padding: 0 !important;
|
97 |
-
font-weight: bold !important;
|
98 |
-
font-size: 16px !important;
|
99 |
-
}
|
100 |
-
|
101 |
-
.happyforms-notice p {
|
102 |
-
margin-bottom: 0 !important;
|
103 |
-
color: #444 !important;
|
104 |
-
}
|
105 |
-
|
106 |
-
.happyforms-notice ul {
|
107 |
-
list-style: disc !important;
|
108 |
-
display: flex !important;
|
109 |
-
flex-flow: column wrap !important;
|
110 |
-
justify-content: space-between !important;
|
111 |
-
margin: 0 0 15px !important;
|
112 |
-
padding: 0 0 0 20px !important;
|
113 |
-
}
|
114 |
-
|
115 |
-
.happyforms-notice ul li {
|
116 |
-
flex: 1;
|
117 |
-
width: 100%;
|
118 |
-
}
|
119 |
-
|
120 |
-
@media screen and (min-width: 800px) {
|
121 |
-
.happyforms-notice ul {
|
122 |
-
flex-flow: row wrap !important;
|
123 |
-
}
|
124 |
-
.happyforms-notice ul li {
|
125 |
-
flex: 0 1 49%;
|
126 |
-
width: 49%;
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
.happyforms-notice p, .happyforms-notice ul li {
|
131 |
-
font-size: 16px !important;
|
132 |
-
}
|
133 |
-
|
134 |
-
.happyforms-notice p a {
|
135 |
-
display: inline-block;
|
136 |
-
cursor: pointer !important;
|
137 |
-
font-weight: bold !important;
|
138 |
-
font-size: 16px !important;
|
139 |
-
color: #0073aa !important;
|
140 |
-
text-decoration: underline !important;
|
141 |
-
}
|
142 |
-
|
143 |
-
.happyforms-notice p a:after {
|
144 |
-
content: '\f504';
|
145 |
-
position: relative;
|
146 |
-
top: 2px;
|
147 |
-
display: inline-block;
|
148 |
-
padding-left: 5px;
|
149 |
-
font-family: dashicons;
|
150 |
-
text-decoration: none;
|
151 |
-
}
|
152 |
-
|
153 |
-
.happyforms-notice .happyforms-dismiss-notice {
|
154 |
-
position: absolute;
|
155 |
-
top: 10px;
|
156 |
-
right: 10px;
|
157 |
-
}
|
158 |
-
|
159 |
-
.happyforms-notice .happyforms-dismiss-notice:before {
|
160 |
-
content: "\f153";
|
161 |
-
font-family: dashicons;
|
162 |
-
font-size: 18px;
|
163 |
-
color: #333;
|
164 |
-
text-decoration: none;
|
165 |
}
|
80 |
|
81 |
.preview-hidden {
|
82 |
display: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
inc/core/assets/js/admin/block.js
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
var PanelBody = wp.components.PanelBody;
|
7 |
var SelectControl = wp.components.SelectControl;
|
8 |
var Placeholder = wp.components.Placeholder;
|
|
|
9 |
var Button = wp.components.Button;
|
10 |
var Icon = wp.components.Icon;
|
11 |
var InspectorControls = wp.editor.InspectorControls;
|
@@ -44,12 +45,28 @@
|
|
44 |
};
|
45 |
|
46 |
var ComponentForm = function( props ) {
|
47 |
-
var
|
48 |
-
el( ServerSideRender, {
|
49 |
block: blockID,
|
50 |
attributes: props.attributes,
|
51 |
-
}
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
return component;
|
55 |
};
|
6 |
var PanelBody = wp.components.PanelBody;
|
7 |
var SelectControl = wp.components.SelectControl;
|
8 |
var Placeholder = wp.components.Placeholder;
|
9 |
+
var Notice = wp.components.Notice;
|
10 |
var Button = wp.components.Button;
|
11 |
var Icon = wp.components.Icon;
|
12 |
var InspectorControls = wp.editor.InspectorControls;
|
45 |
};
|
46 |
|
47 |
var ComponentForm = function( props ) {
|
48 |
+
var shortcode = el( ServerSideRender, {
|
|
|
49 |
block: blockID,
|
50 |
attributes: props.attributes,
|
51 |
+
}
|
52 |
+
);
|
53 |
+
|
54 |
+
var component = [ shortcode ];
|
55 |
+
|
56 |
+
if ( settings.upgrade_notice.show ) {
|
57 |
+
component = [
|
58 |
+
el( Notice, {
|
59 |
+
status: 'warning',
|
60 |
+
isDismissible: false,
|
61 |
+
}, el( 'p',
|
62 |
+
null,
|
63 |
+
settings.upgrade_notice.i18n.text,
|
64 |
+
el( 'a', { href: 'https://happyforms.me/upgrade', target: '_blank' }, ' ' + settings.upgrade_notice.i18n.link_text )
|
65 |
+
)
|
66 |
+
),
|
67 |
+
shortcode
|
68 |
+
];
|
69 |
+
}
|
70 |
|
71 |
return component;
|
72 |
};
|
inc/core/classes/class-admin-notices.php
CHANGED
@@ -151,8 +151,8 @@ class HappyForms_Admin_Notices {
|
|
151 |
foreach ( $notices as $id => $notice ) {
|
152 |
$type = $notice['type'];
|
153 |
|
154 |
-
$default_classes = array( 'happyforms-notice' );
|
155 |
-
$extra_classes = ( isset( $notice['classes'] ) ) ? $notice['classes'] : array( 'notice
|
156 |
|
157 |
$classes = array_merge( $default_classes, $extra_classes );
|
158 |
|
@@ -178,7 +178,7 @@ class HappyForms_Admin_Notices {
|
|
178 |
echo $message;
|
179 |
endif;
|
180 |
?>
|
181 |
-
<?php if ( $dismissible && 'custom' === $type ) : ?>
|
182 |
<a href="#" class="happyforms-dismiss-notice"></a>
|
183 |
<?php endif; ?>
|
184 |
</div>
|
151 |
foreach ( $notices as $id => $notice ) {
|
152 |
$type = $notice['type'];
|
153 |
|
154 |
+
$default_classes = array( 'notice', 'happyforms-notice' );
|
155 |
+
$extra_classes = ( isset( $notice['classes'] ) ) ? $notice['classes'] : array( 'notice-' . $type );
|
156 |
|
157 |
$classes = array_merge( $default_classes, $extra_classes );
|
158 |
|
178 |
echo $message;
|
179 |
endif;
|
180 |
?>
|
181 |
+
<?php if ( $dismissible && 'custom' === $type && 'happyforms-preview' === $screen_id ) : ?>
|
182 |
<a href="#" class="happyforms-dismiss-notice"></a>
|
183 |
<?php endif; ?>
|
184 |
</div>
|
inc/core/classes/class-block.php
CHANGED
@@ -85,6 +85,13 @@ class HappyForms_Block {
|
|
85 |
'forms' => $forms,
|
86 |
'editLink' => $edit_link,
|
87 |
'block' => $block_properties,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
'i18n' => array(
|
89 |
'select_default' => __( 'Select', 'happyforms' ),
|
90 |
'placeholder_text' => __( 'Which form would you like to add here?', 'happyforms' ),
|
85 |
'forms' => $forms,
|
86 |
'editLink' => $edit_link,
|
87 |
'block' => $block_properties,
|
88 |
+
'upgrade_notice' => array(
|
89 |
+
'show' => ( ! defined( 'HAPPYFORMS_UPGRADE_VERSION' ) ) ? true : false,
|
90 |
+
'i18n' => array(
|
91 |
+
'text' => __( 'Do you want access to HappyForms’ most powerful features?', 'happyforms' ),
|
92 |
+
'link_text' => __( 'Discover HappyForms Upgrade', 'happyforms' ),
|
93 |
+
)
|
94 |
+
),
|
95 |
'i18n' => array(
|
96 |
'select_default' => __( 'Select', 'happyforms' ),
|
97 |
'placeholder_text' => __( 'Which form would you like to add here?', 'happyforms' ),
|
inc/core/classes/class-happyforms-core.php
CHANGED
@@ -217,6 +217,12 @@ class HappyForms_Core {
|
|
217 |
array(), HAPPYFORMS_VERSION
|
218 |
);
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
wp_register_script(
|
221 |
'happyforms-admin',
|
222 |
happyforms_get_plugin_url() . 'inc/core/assets/js/admin/dashboard.js',
|
217 |
array(), HAPPYFORMS_VERSION
|
218 |
);
|
219 |
|
220 |
+
wp_enqueue_style(
|
221 |
+
'happyforms-notices',
|
222 |
+
happyforms_get_plugin_url() . 'inc/core/assets/css/notice.css',
|
223 |
+
array(), HAPPYFORMS_VERSION
|
224 |
+
);
|
225 |
+
|
226 |
wp_register_script(
|
227 |
'happyforms-admin',
|
228 |
happyforms_get_plugin_url() . 'inc/core/assets/js/admin/dashboard.js',
|
inc/core/classes/parts/class-part-legal.php
CHANGED
@@ -27,10 +27,10 @@ class HappyForms_Part_Legal extends HappyForms_Form_Part {
|
|
27 |
'default' => $this->type,
|
28 |
'sanitize' => 'sanitize_text_field',
|
29 |
),
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
'width' => array(
|
35 |
'default' => 'full',
|
36 |
'sanitize' => 'sanitize_key'
|
@@ -119,12 +119,12 @@ class HappyForms_Part_Legal extends HappyForms_Form_Part {
|
|
119 |
if ( empty( $validated_value ) ) {
|
120 |
$validated_value = new WP_Error( 'error', __( 'This field is required.', 'happyforms' ) );
|
121 |
return $validated_value;
|
122 |
-
|
123 |
|
124 |
-
|
125 |
$validated_value = new WP_Error( 'error', __( 'Please accept terms before proceeding.', 'happyforms' ) );
|
126 |
return $validated_value;
|
127 |
-
|
128 |
|
129 |
return $validated_value;
|
130 |
}
|
@@ -155,16 +155,15 @@ class HappyForms_Part_Legal extends HappyForms_Form_Part {
|
|
155 |
$part_index = array_search( $part['id'], wp_list_pluck( $form['parts'], 'id' ) );
|
156 |
|
157 |
if ( $part_index ) {
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
if ( isset( $previous_part ) ) {
|
162 |
if ( 'left' === $previous_part['label_placement'] && 'full' === $previous_part['width'] ) {
|
163 |
$class[] = 'happyforms-part-legal--align-right';
|
164 |
}
|
165 |
}
|
166 |
|
167 |
-
if ( isset( $
|
|
|
168 |
if ( 'left' === $next_part['label_placement'] && 'full' === $next_part['width'] ) {
|
169 |
$class[] = 'happyforms-part-legal--align-right';
|
170 |
}
|
27 |
'default' => $this->type,
|
28 |
'sanitize' => 'sanitize_text_field',
|
29 |
),
|
30 |
+
'legal_text' => array(
|
31 |
+
'default' => __( 'I accept terms and conditions.', 'happyforms' ),
|
32 |
+
'sanitize' => 'esc_html'
|
33 |
+
),
|
34 |
'width' => array(
|
35 |
'default' => 'full',
|
36 |
'sanitize' => 'sanitize_key'
|
119 |
if ( empty( $validated_value ) ) {
|
120 |
$validated_value = new WP_Error( 'error', __( 'This field is required.', 'happyforms' ) );
|
121 |
return $validated_value;
|
122 |
+
}
|
123 |
|
124 |
+
if ( $validated_value !== 'yes' ) {
|
125 |
$validated_value = new WP_Error( 'error', __( 'Please accept terms before proceeding.', 'happyforms' ) );
|
126 |
return $validated_value;
|
127 |
+
}
|
128 |
|
129 |
return $validated_value;
|
130 |
}
|
155 |
$part_index = array_search( $part['id'], wp_list_pluck( $form['parts'], 'id' ) );
|
156 |
|
157 |
if ( $part_index ) {
|
158 |
+
if ( isset( $form['parts'][$part_index-1] ) ) {
|
159 |
+
$previous_part = $form['parts'][$part_index-1];
|
|
|
|
|
160 |
if ( 'left' === $previous_part['label_placement'] && 'full' === $previous_part['width'] ) {
|
161 |
$class[] = 'happyforms-part-legal--align-right';
|
162 |
}
|
163 |
}
|
164 |
|
165 |
+
if ( isset( $form['parts'][$part_index+1] ) ) {
|
166 |
+
$next_part = $form['parts'][$parts_index+1];
|
167 |
if ( 'left' === $next_part['label_placement'] && 'full' === $next_part['width'] ) {
|
168 |
$class[] = 'happyforms-part-legal--align-right';
|
169 |
}
|
inc/core/templates/preview-form-edit.php
CHANGED
@@ -4,6 +4,8 @@
|
|
4 |
<meta charset="utf-8">
|
5 |
<title><?php wp_title(); ?></title>
|
6 |
<?php wp_head(); ?>
|
|
|
|
|
7 |
</head>
|
8 |
<body class="happyforms-preview">
|
9 |
<?php global $post; $form = happyforms_get_form_controller()->get( $post->ID ); ?>
|
4 |
<meta charset="utf-8">
|
5 |
<title><?php wp_title(); ?></title>
|
6 |
<?php wp_head(); ?>
|
7 |
+
|
8 |
+
<link rel="stylesheet" type="text/css" href="<?php echo happyforms_get_plugin_url() . '/inc/core/assets/css/notice.css'; ?>">
|
9 |
</head>
|
10 |
<body class="happyforms-preview">
|
11 |
<?php global $post; $form = happyforms_get_form_controller()->get( $post->ID ); ?>
|
languages/happyforms.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the HappyForms package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: HappyForms 1.6.
|
6 |
"Report-Msgid-Bugs-To: https://thethemefoundry.com/support/\n"
|
7 |
-
"POT-Creation-Date: 2019-02-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -13,43 +13,53 @@ msgstr ""
|
|
13 |
"Language-Team: The Theme Foundry\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.9\n"
|
15 |
|
16 |
-
#: inc/classes/class-happyforms.php:
|
17 |
-
msgid "
|
18 |
msgstr ""
|
19 |
|
20 |
-
#: inc/classes/class-happyforms.php:
|
21 |
-
msgid "
|
22 |
msgstr ""
|
23 |
|
24 |
-
#: inc/classes/class-happyforms.php:
|
25 |
-
msgid "
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: inc/classes/class-happyforms.php:
|
29 |
-
msgid "
|
|
|
|
|
|
|
|
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: inc/classes/class-happyforms.php:
|
33 |
-
msgid "
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: inc/classes/class-happyforms.php:
|
37 |
-
msgid "
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: inc/classes/class-happyforms.php:
|
41 |
-
msgid "
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: inc/classes/class-happyforms.php:
|
45 |
-
msgid "Discover
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: inc/classes/class-happyforms.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
msgid "HappyForms Upgrade"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: inc/classes/class-happyforms.php:
|
53 |
msgid "Upgrade"
|
54 |
msgstr ""
|
55 |
|
@@ -61,19 +71,23 @@ msgstr ""
|
|
61 |
msgid "Contact form to manage and respond to conversations with customers."
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: inc/core/classes/class-block.php:
|
|
|
|
|
|
|
|
|
65 |
msgid "Select"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: inc/core/classes/class-block.php:
|
69 |
msgid "Which form would you like to add here?"
|
70 |
msgstr ""
|
71 |
|
72 |
-
#: inc/core/classes/class-block.php:
|
73 |
msgid "HappyForms Settings"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: inc/core/classes/class-block.php:
|
77 |
msgid "Edit Form"
|
78 |
msgstr ""
|
79 |
|
@@ -914,19 +928,19 @@ msgstr ""
|
|
914 |
msgid "Welcome"
|
915 |
msgstr ""
|
916 |
|
917 |
-
#: inc/core/classes/class-happyforms-core.php:
|
918 |
msgid "HappyForm"
|
919 |
msgstr ""
|
920 |
|
921 |
-
#: inc/core/classes/class-happyforms-core.php:
|
922 |
msgid "New HappyForm"
|
923 |
msgstr ""
|
924 |
|
925 |
-
#: inc/core/classes/class-happyforms-core.php:
|
926 |
msgid "Insert HappyForm"
|
927 |
msgstr ""
|
928 |
|
929 |
-
#: inc/core/classes/class-happyforms-core.php:
|
930 |
msgid "Add HappyForms"
|
931 |
msgstr ""
|
932 |
|
2 |
# This file is distributed under the same license as the HappyForms package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: HappyForms 1.6.22\n"
|
6 |
"Report-Msgid-Bugs-To: https://thethemefoundry.com/support/\n"
|
7 |
+
"POT-Creation-Date: 2019-02-16 14:28:15+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"Language-Team: The Theme Foundry\n"
|
14 |
"X-Generator: grunt-wp-i18n 0.4.9\n"
|
15 |
|
16 |
+
#: inc/classes/class-happyforms.php:20
|
17 |
+
msgid "Oh-no! You're missing out on these HappyForms features…"
|
18 |
msgstr ""
|
19 |
|
20 |
+
#: inc/classes/class-happyforms.php:28
|
21 |
+
msgid "File upload part"
|
22 |
msgstr ""
|
23 |
|
24 |
+
#: inc/classes/class-happyforms.php:29
|
25 |
+
msgid "Schedule form display"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: inc/classes/class-happyforms.php:30
|
29 |
+
msgid "Password protect forms"
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: inc/classes/class-happyforms.php:31
|
33 |
+
msgid "Open form in a pop-up"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: inc/classes/class-happyforms.php:32
|
37 |
+
msgid "Limit responses"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: inc/classes/class-happyforms.php:33
|
41 |
+
msgid "Filter responses"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: inc/classes/class-happyforms.php:34
|
45 |
+
msgid "Shuffle form parts"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: inc/classes/class-happyforms.php:36 inc/core/classes/class-block.php:92
|
49 |
+
msgid "Discover HappyForms Upgrade"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: inc/classes/class-happyforms.php:86
|
53 |
+
msgid ""
|
54 |
+
"Do you want access to HappyForms’ most powerful features? <a href=\"%s\" "
|
55 |
+
"target=\"%s\">Discover HappyForms Upgrade</a>"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: inc/classes/class-happyforms.php:105
|
59 |
msgid "HappyForms Upgrade"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: inc/classes/class-happyforms.php:106
|
63 |
msgid "Upgrade"
|
64 |
msgstr ""
|
65 |
|
71 |
msgid "Contact form to manage and respond to conversations with customers."
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: inc/core/classes/class-block.php:91
|
75 |
+
msgid "Do you want access to HappyForms’ most powerful features?"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: inc/core/classes/class-block.php:96
|
79 |
msgid "Select"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: inc/core/classes/class-block.php:97
|
83 |
msgid "Which form would you like to add here?"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: inc/core/classes/class-block.php:98
|
87 |
msgid "HappyForms Settings"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: inc/core/classes/class-block.php:99
|
91 |
msgid "Edit Form"
|
92 |
msgstr ""
|
93 |
|
928 |
msgid "Welcome"
|
929 |
msgstr ""
|
930 |
|
931 |
+
#: inc/core/classes/class-happyforms-core.php:321
|
932 |
msgid "HappyForm"
|
933 |
msgstr ""
|
934 |
|
935 |
+
#: inc/core/classes/class-happyforms-core.php:325
|
936 |
msgid "New HappyForm"
|
937 |
msgstr ""
|
938 |
|
939 |
+
#: inc/core/classes/class-happyforms-core.php:446
|
940 |
msgid "Insert HappyForm"
|
941 |
msgstr ""
|
942 |
|
943 |
+
#: inc/core/classes/class-happyforms-core.php:446
|
944 |
msgid "Add HappyForms"
|
945 |
msgstr ""
|
946 |
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: contact, contact form, email, feedback form, form, form builder, custom fo
|
|
5 |
Requires at least: 4.8
|
6 |
Tested up to: 5.0
|
7 |
Requires PHP: 5.3
|
8 |
-
Stable tag: 1.6.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -99,6 +99,10 @@ Yep! HappyForms free isn't going anywhere but for those looking for even more po
|
|
99 |
|
100 |
== Changelog ==
|
101 |
|
|
|
|
|
|
|
|
|
102 |
= 1.6.21 =
|
103 |
* Bugfix: Fix dismissible form preview notices for new forms.
|
104 |
* Bugfix: Email part with confirmation field prevented form submits when "Preview values before submission" was checked.
|
@@ -400,6 +404,9 @@ Yep! HappyForms free isn't going anywhere but for those looking for even more po
|
|
400 |
|
401 |
== Upgrade Notice ==
|
402 |
|
|
|
|
|
|
|
403 |
= 1.6.21 =
|
404 |
* Fix Email part preventing form submits when "Preview values before submission" was checked. Improve form preview notices behavior on new forms.
|
405 |
|
5 |
Requires at least: 4.8
|
6 |
Tested up to: 5.0
|
7 |
Requires PHP: 5.3
|
8 |
+
Stable tag: 1.6.22
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
99 |
|
100 |
== Changelog ==
|
101 |
|
102 |
+
= 1.6.22 =
|
103 |
+
* Improvement: Improvements to admin notices behavior and styles.
|
104 |
+
* Bugfix: Fix Legal part's undefined offset error in HTML class.
|
105 |
+
|
106 |
= 1.6.21 =
|
107 |
* Bugfix: Fix dismissible form preview notices for new forms.
|
108 |
* Bugfix: Email part with confirmation field prevented form submits when "Preview values before submission" was checked.
|
404 |
|
405 |
== Upgrade Notice ==
|
406 |
|
407 |
+
= 1.6.22 =
|
408 |
+
* Improvements to admin notices behavior and styles.
|
409 |
+
|
410 |
= 1.6.21 =
|
411 |
* Fix Email part preventing form submits when "Preview values before submission" was checked. Improve form preview notices behavior on new forms.
|
412 |
|