Version Description
Download this release
Release Info
Developer | alerzhus |
Plugin | Forminator Payment, Quiz and Contact Form Plugin |
Version | 1.14.11 |
Comparing to | |
See all releases |
Code changes from version 1.14.10.1 to 1.14.11
- addons/pro/activecampaign/class-forminator-addon-activecampaign-form-hooks.php +13 -13
- addons/pro/activecampaign/class-forminator-addon-activecampaign-form-settings.php +25 -25
- addons/pro/activecampaign/class-forminator-addon-activecampaign-quiz-hooks.php +13 -13
- addons/pro/activecampaign/class-forminator-addon-activecampaign-quiz-settings.php +29 -29
- addons/pro/activecampaign/class-forminator-addon-activecampaign.php +21 -21
- addons/pro/activecampaign/lib/class-forminator-addon-activecampaign-wp-api.php +8 -8
- addons/pro/activecampaign/views/form-settings/map-fields.php +4 -4
- addons/pro/activecampaign/views/form-settings/pick-name.php +4 -4
- addons/pro/activecampaign/views/form-settings/select-list.php +4 -4
- addons/pro/activecampaign/views/form-settings/setup-options.php +11 -11
- addons/pro/activecampaign/views/quiz-settings/map-fields.php +5 -5
- addons/pro/activecampaign/views/quiz-settings/pick-name.php +4 -4
- addons/pro/activecampaign/views/quiz-settings/select-list.php +4 -4
- addons/pro/activecampaign/views/quiz-settings/setup-options.php +11 -11
- addons/pro/activecampaign/views/settings/setup-api-success.php +2 -2
- addons/pro/activecampaign/views/settings/setup-api.php +6 -6
- addons/pro/aweber/class-forminator-addon-aweber-form-hooks.php +14 -14
- addons/pro/aweber/class-forminator-addon-aweber-form-settings.php +22 -22
- addons/pro/aweber/class-forminator-addon-aweber-quiz-hooks.php +14 -14
- addons/pro/aweber/class-forminator-addon-aweber-quiz-settings.php +26 -26
- addons/pro/aweber/class-forminator-addon-aweber.php +16 -16
- addons/pro/aweber/lib/class-forminator-addon-aweber-wp-api.php +8 -8
- addons/pro/aweber/views/form-settings/map-fields.php +4 -4
- addons/pro/aweber/views/form-settings/pick-name.php +4 -4
- addons/pro/aweber/views/form-settings/setup-list.php +4 -4
- addons/pro/aweber/views/form-settings/setup-options.php +7 -7
- addons/pro/aweber/views/quiz-settings/map-fields.php +5 -5
- addons/pro/aweber/views/quiz-settings/pick-name.php +4 -4
- addons/pro/aweber/views/quiz-settings/setup-list.php +4 -4
- addons/pro/aweber/views/quiz-settings/setup-options.php +7 -7
- addons/pro/aweber/views/sections/authorize.php +3 -3
- addons/pro/aweber/views/settings/authorize.php +5 -5
- addons/pro/aweber/views/settings/success-authorize.php +3 -3
- addons/pro/aweber/views/settings/wait-authorize.php +3 -3
- addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-form-hooks.php +14 -14
- addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-form-settings.php +23 -23
- addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-quiz-hooks.php +14 -14
- addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-quiz-settings.php +27 -27
- addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor.php +20 -20
- addons/pro/campaignmonitor/lib/class-forminator-addon-campaignmonitor-wp-api.php +4 -4
- addons/pro/campaignmonitor/views/form-settings/map-fields.php +4 -4
- addons/pro/campaignmonitor/views/form-settings/pick-name.php +4 -4
- addons/pro/campaignmonitor/views/form-settings/setup-list.php +4 -4
- addons/pro/campaignmonitor/views/form-settings/setup-options.php +8 -8
- addons/pro/campaignmonitor/views/quiz-settings/map-fields.php +5 -5
- addons/pro/campaignmonitor/views/quiz-settings/pick-name.php +4 -4
- addons/pro/campaignmonitor/views/quiz-settings/setup-list.php +4 -4
- addons/pro/campaignmonitor/views/quiz-settings/setup-options.php +8 -8
- addons/pro/campaignmonitor/views/settings/setup-api-success.php +2 -2
- addons/pro/campaignmonitor/views/settings/setup-api.php +12 -12
- addons/pro/fortressdb/class-fortressdb-forminator.php +3 -3
- addons/pro/googlesheet/class-forminator-addon-googlesheet-form-hooks.php +11 -11
- addons/pro/googlesheet/class-forminator-addon-googlesheet-form-settings.php +11 -11
- addons/pro/googlesheet/class-forminator-addon-googlesheet-poll-hooks.php +6 -6
- addons/pro/googlesheet/class-forminator-addon-googlesheet-poll-settings.php +11 -11
- addons/pro/googlesheet/class-forminator-addon-googlesheet-quiz-hooks.php +13 -13
- addons/pro/googlesheet/class-forminator-addon-googlesheet-quiz-settings.php +11 -11
- addons/pro/googlesheet/class-forminator-addon-googlesheet.php +24 -24
- addons/pro/googlesheet/views/form-settings/pick-name.php +6 -6
- addons/pro/googlesheet/views/form-settings/setup-sheet.php +13 -13
- addons/pro/googlesheet/views/poll-settings/pick-name.php +6 -6
- addons/pro/googlesheet/views/poll-settings/setup-sheet.php +13 -13
- addons/pro/googlesheet/views/quiz-settings/pick-name.php +6 -6
- addons/pro/googlesheet/views/quiz-settings/setup-sheet.php +13 -13
- addons/pro/googlesheet/views/sections/authorize.php +3 -3
- addons/pro/googlesheet/views/settings/authorize.php +5 -5
- addons/pro/googlesheet/views/settings/setup-client.php +11 -11
- addons/pro/googlesheet/views/settings/success-authorize.php +2 -2
- addons/pro/googlesheet/views/settings/wait-authorize.php +2 -2
- addons/pro/gutenberg/library/blocks/class-forminator-gfblock-forms.php +9 -9
- addons/pro/gutenberg/library/blocks/class-forminator-gfblock-polls.php +9 -9
- addons/pro/gutenberg/library/blocks/class-forminator-gfblock-quizzes.php +10 -10
- addons/pro/hubspot/class-forminator-addon-hubspot-form-hooks.php +13 -13
- addons/pro/hubspot/class-forminator-addon-hubspot-form-settings.php +16 -16
- addons/pro/hubspot/class-forminator-addon-hubspot-quiz-hooks.php +12 -12
- addons/pro/hubspot/class-forminator-addon-hubspot-quiz-settings.php +20 -20
- addons/pro/hubspot/class-forminator-addon-hubspot.php +18 -18
- addons/pro/hubspot/lib/class-forminator-addon-hubspot-wp-api.php +7 -7
- addons/pro/hubspot/views/form-settings/create-contact.php +16 -16
- addons/pro/hubspot/views/form-settings/create-ticket.php +14 -14
- addons/pro/hubspot/views/quiz-settings/create-contact.php +16 -16
- addons/pro/hubspot/views/quiz-settings/create-ticket.php +16 -16
- addons/pro/hubspot/views/sections/authorize.php +3 -3
- addons/pro/hubspot/views/settings/authorize.php +5 -5
- addons/pro/hubspot/views/settings/error-authorize.php +3 -3
- addons/pro/hubspot/views/settings/success-authorize.php +2 -2
- addons/pro/hubspot/views/settings/wait-authorize.php +4 -4
- addons/pro/mailchimp/class-forminator-addon-mailchimp-form-hooks.php +21 -21
- addons/pro/mailchimp/class-forminator-addon-mailchimp-form-settings.php +26 -26
- addons/pro/mailchimp/class-forminator-addon-mailchimp-quiz-hooks.php +20 -20
- addons/pro/mailchimp/class-forminator-addon-mailchimp-quiz-settings.php +33 -33
- addons/pro/mailchimp/class-forminator-addon-mailchimp.php +25 -25
- addons/pro/mailchimp/lib/class-forminator-addon-mailchimp-wp-api.php +9 -9
- addons/pro/slack/class-forminator-addon-slack-form-hooks.php +13 -13
- addons/pro/slack/class-forminator-addon-slack-form-settings.php +23 -23
- addons/pro/slack/class-forminator-addon-slack-poll-hooks.php +8 -8
- addons/pro/slack/class-forminator-addon-slack-poll-settings.php +25 -25
- addons/pro/slack/class-forminator-addon-slack-quiz-hooks.php +16 -16
- addons/pro/slack/class-forminator-addon-slack-quiz-settings.php +25 -25
- addons/pro/slack/class-forminator-addon-slack.php +17 -17
- addons/pro/slack/lib/class-forminator-addon-slack-wp-api.php +5 -5
- addons/pro/slack/views/form-settings/pick-name.php +4 -4
- addons/pro/slack/views/form-settings/select-target.php +3 -3
- addons/pro/slack/views/form-settings/select-type.php +4 -4
- addons/pro/slack/views/form-settings/setup-message.php +8 -8
- addons/pro/slack/views/poll-settings/pick-name.php +4 -4
- addons/pro/slack/views/poll-settings/select-target.php +3 -3
- addons/pro/slack/views/poll-settings/select-type.php +4 -4
- addons/pro/slack/views/poll-settings/setup-message.php +8 -8
- addons/pro/slack/views/quiz-settings/pick-name.php +4 -4
- addons/pro/slack/views/quiz-settings/select-target.php +3 -3
- addons/pro/slack/views/quiz-settings/select-type.php +4 -4
- addons/pro/slack/views/quiz-settings/setup-message.php +8 -8
- addons/pro/slack/views/sections/authorize.php +3 -3
- addons/pro/slack/views/settings/authorize.php +5 -5
- addons/pro/slack/views/settings/error-authorize.php +2 -2
- addons/pro/slack/views/settings/setup-client.php +16 -16
- addons/pro/slack/views/settings/success-authorize.php +2 -2
- addons/pro/slack/views/settings/wait-authorize.php +2 -2
- addons/pro/trello/class-forminator-addon-trello-form-hooks.php +13 -13
- addons/pro/trello/class-forminator-addon-trello-form-settings.php +20 -20
- addons/pro/trello/class-forminator-addon-trello-poll-hooks.php +7 -7
- addons/pro/trello/class-forminator-addon-trello-poll-settings.php +21 -21
- addons/pro/trello/class-forminator-addon-trello-quiz-hooks.php +17 -17
- addons/pro/trello/class-forminator-addon-trello-quiz-settings.php +21 -21
- addons/pro/trello/class-forminator-addon-trello.php +10 -10
- addons/pro/trello/lib/class-forminator-addon-trello-wp-api.php +7 -7
- addons/pro/trello/views/form-settings/setup-board.php +4 -4
- addons/pro/trello/views/form-settings/setup-card.php +15 -15
- addons/pro/trello/views/form-settings/setup-list.php +4 -4
- addons/pro/trello/views/form-settings/setup-name.php +4 -4
- addons/pro/trello/views/poll-settings/setup-board.php +4 -4
- addons/pro/trello/views/poll-settings/setup-card.php +14 -14
- addons/pro/trello/views/poll-settings/setup-list.php +4 -4
- addons/pro/trello/views/poll-settings/setup-name.php +4 -4
- addons/pro/trello/views/quiz-settings/setup-board.php +4 -4
- addons/pro/trello/views/quiz-settings/setup-card.php +14 -14
- addons/pro/trello/views/quiz-settings/setup-list.php +4 -4
- addons/pro/trello/views/quiz-settings/setup-name.php +4 -4
- addons/pro/trello/views/sections/authorize.php +3 -3
- addons/pro/trello/views/settings/authorize.php +5 -5
- addons/pro/trello/views/settings/success-authorize.php +3 -3
- addons/pro/trello/views/settings/wait-authorize.php +2 -2
- addons/pro/zapier/class-forminator-addon-zapier-form-hooks.php +12 -12
- addons/pro/zapier/class-forminator-addon-zapier-form-settings.php +16 -16
- addons/pro/zapier/class-forminator-addon-zapier-poll-hooks.php +4 -4
- addons/pro/zapier/class-forminator-addon-zapier-poll-settings.php +11 -11
- addons/pro/zapier/class-forminator-addon-zapier-quiz-hooks.php +12 -12
- addons/pro/zapier/class-forminator-addon-zapier-quiz-settings.php +11 -11
- addons/pro/zapier/class-forminator-addon-zapier.php +14 -14
- addons/pro/zapier/lib/class-forminator-addon-zapier-wp-api.php +4 -4
- addons/pro/zapier/views/poll-settings/setup-webhook.php +7 -7
- addons/pro/zapier/views/quiz-settings/setup-webhook.php +7 -7
- addons/pro/zapier/views/settings/setup-connect-success.php +2 -2
- addons/pro/zapier/views/settings/setup-connect.php +3 -3
- admin/abstracts/class-admin-import-mediator.php +5 -5
- admin/abstracts/class-admin-module-edit-page.php +539 -0
- admin/abstracts/class-admin-module.php +15 -2
- admin/abstracts/class-admin-page.php +39 -193
- admin/abstracts/class-admin-view-page.php +648 -0
- admin/classes/class-admin-ajax.php +195 -415
- admin/classes/class-admin-data.php +6 -4
- admin/classes/class-admin-l10n.php +317 -319
- admin/classes/class-admin.php +38 -41
- admin/classes/thirdparty-importers/class-importer-cf7.php +2 -2
- admin/locale.php +13 -22
- admin/pages/dashboard-page.php +4 -40
- admin/pages/entries-page.php +28 -31
- admin/pages/integrations-page.php +1 -1
- admin/views/boxes/content-box.php +0 -43
- admin/views/boxes/popup-box.php +0 -39
- admin/views/common/dashboard/widget.php +223 -0
- admin/views/common/entries/active_filters_row.php +78 -0
- admin/views/common/entries/content-none.php +35 -0
- admin/views/{entries → common/entries}/content.php +11 -26
- admin/views/{quiz → common}/entries/filter.php +45 -20
- admin/views/{entries → common/entries}/header.php +4 -2
- admin/views/{quiz → common}/entries/prompt.php +17 -9
- admin/views/common/list/chart_script.php +246 -0
- admin/views/common/list/empty_content.php +77 -0
- admin/views/common/list/header.php +28 -0
- admin/views/common/list/main_content.php +371 -0
- admin/views/common/list/summary.php +88 -0
- admin/views/common/list/temp_css.php +23 -0
- admin/views/{poll → common}/popup/export.php +12 -10
- admin/views/{quiz → common}/popup/import.php +5 -4
- admin/views/custom-form/entries/content.php +31 -143
- admin/views/custom-form/entries/filter.php +0 -206
- admin/views/custom-form/entries/header.php +0 -9
- admin/views/custom-form/entries/popup/schedule-export-content.php +0 -91
- admin/views/custom-form/entries/prompt.php +0 -107
- admin/views/custom-form/list/content.php +16 -652
- admin/views/custom-form/list/header.php +6 -26
- admin/views/custom-form/popup/export.php +0 -59
- admin/views/custom-form/popup/import-cf7.php +46 -46
- admin/views/custom-form/popup/import-gravityforms.php +4 -4
- admin/views/custom-form/popup/import-ninjaforms.php +4 -4
- admin/views/custom-form/popup/import.php +0 -35
- admin/views/dashboard/footer-free.php +14 -14
- admin/views/dashboard/header.php +4 -2
- admin/views/dashboard/new-feature-notice.php +6 -6
- admin/views/dashboard/widgets/widget-cform.php +11 -189
- admin/views/dashboard/widgets/widget-create.php +2 -2
- admin/views/dashboard/widgets/widget-poll.php +11 -184
- admin/views/dashboard/widgets/widget-quiz.php +11 -210
- admin/views/dashboard/widgets/widget-resume.php +7 -7
- admin/views/dashboard/widgets/widget-upgrade.php +12 -13
- admin/views/integrations/addon.php +62 -70
- admin/views/integrations/content.php +2 -3
addons/pro/activecampaign/class-forminator-addon-activecampaign-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'ActiveCampaign failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -168,7 +168,7 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
168 |
$args = array();
|
169 |
|
170 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
171 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'List ID not properly setup.',
|
172 |
}
|
173 |
|
174 |
$args[ 'p[' . $connection_settings['list_id'] . ']' ] = $connection_settings['list_id'];
|
@@ -179,7 +179,7 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
179 |
|
180 |
$email_element_id = $connection_settings['fields_map']['email'];
|
181 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
182 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Email on element not found or not filled on submitted data.',
|
183 |
}
|
184 |
$email = $submitted_data[ $email_element_id ];
|
185 |
$email = strtolower( trim( $email ) );
|
@@ -334,7 +334,7 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
334 |
return array(
|
335 |
'is_sent' => true,
|
336 |
'connection_name' => $connection_settings['name'],
|
337 |
-
'description' => __( 'Successfully send data to ActiveCampaign',
|
338 |
'data_sent' => $ac_api->get_last_data_sent(),
|
339 |
'data_received' => $ac_api->get_last_data_received(),
|
340 |
'url_request' => $ac_api->get_last_url_request(),
|
@@ -438,29 +438,29 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
438 |
}
|
439 |
$status = $addon_meta_data['value'];
|
440 |
$additional_entry_item = array(
|
441 |
-
'label' => __( 'ActiveCampaign Integration',
|
442 |
'value' => '',
|
443 |
);
|
444 |
|
445 |
$sub_entries = array();
|
446 |
if ( isset( $status['connection_name'] ) ) {
|
447 |
$sub_entries[] = array(
|
448 |
-
'label' => __( 'Integration Name',
|
449 |
'value' => $status['connection_name'],
|
450 |
);
|
451 |
}
|
452 |
|
453 |
if ( isset( $status['is_sent'] ) ) {
|
454 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
455 |
$sub_entries[] = array(
|
456 |
-
'label' => __( 'Sent To ActiveCampaign',
|
457 |
'value' => $is_sent,
|
458 |
);
|
459 |
}
|
460 |
|
461 |
if ( isset( $status['description'] ) ) {
|
462 |
$sub_entries[] = array(
|
463 |
-
'label' => __( 'Info',
|
464 |
'value' => $status['description'],
|
465 |
);
|
466 |
}
|
@@ -469,21 +469,21 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
469 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG', true)`
|
470 |
if ( isset( $status['url_request'] ) ) {
|
471 |
$sub_entries[] = array(
|
472 |
-
'label' => __( 'API URL',
|
473 |
'value' => $status['url_request'],
|
474 |
);
|
475 |
}
|
476 |
|
477 |
if ( isset( $status['data_sent'] ) ) {
|
478 |
$sub_entries[] = array(
|
479 |
-
'label' => __( 'Data sent to ActiveCampaign',
|
480 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
481 |
);
|
482 |
}
|
483 |
|
484 |
if ( isset( $status['data_received'] ) ) {
|
485 |
$sub_entries[] = array(
|
486 |
-
'label' => __( 'Data received from ActiveCampaign',
|
487 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
488 |
);
|
489 |
}
|
@@ -505,7 +505,7 @@ class Forminator_Addon_Activecampaign_Form_Hooks extends Forminator_Addon_Form_H
|
|
505 |
public function on_export_render_title_row() {
|
506 |
|
507 |
$export_headers = array(
|
508 |
-
'info' => __( 'ActiveCampaign Info',
|
509 |
);
|
510 |
|
511 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'ActiveCampaign failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
168 |
$args = array();
|
169 |
|
170 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
171 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
172 |
}
|
173 |
|
174 |
$args[ 'p[' . $connection_settings['list_id'] . ']' ] = $connection_settings['list_id'];
|
179 |
|
180 |
$email_element_id = $connection_settings['fields_map']['email'];
|
181 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
182 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Email on element not found or not filled on submitted data.', 'forminator' ) );
|
183 |
}
|
184 |
$email = $submitted_data[ $email_element_id ];
|
185 |
$email = strtolower( trim( $email ) );
|
334 |
return array(
|
335 |
'is_sent' => true,
|
336 |
'connection_name' => $connection_settings['name'],
|
337 |
+
'description' => __( 'Successfully send data to ActiveCampaign', 'forminator' ),
|
338 |
'data_sent' => $ac_api->get_last_data_sent(),
|
339 |
'data_received' => $ac_api->get_last_data_received(),
|
340 |
'url_request' => $ac_api->get_last_url_request(),
|
438 |
}
|
439 |
$status = $addon_meta_data['value'];
|
440 |
$additional_entry_item = array(
|
441 |
+
'label' => __( 'ActiveCampaign Integration', 'forminator' ),
|
442 |
'value' => '',
|
443 |
);
|
444 |
|
445 |
$sub_entries = array();
|
446 |
if ( isset( $status['connection_name'] ) ) {
|
447 |
$sub_entries[] = array(
|
448 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
449 |
'value' => $status['connection_name'],
|
450 |
);
|
451 |
}
|
452 |
|
453 |
if ( isset( $status['is_sent'] ) ) {
|
454 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
455 |
$sub_entries[] = array(
|
456 |
+
'label' => __( 'Sent To ActiveCampaign', 'forminator' ),
|
457 |
'value' => $is_sent,
|
458 |
);
|
459 |
}
|
460 |
|
461 |
if ( isset( $status['description'] ) ) {
|
462 |
$sub_entries[] = array(
|
463 |
+
'label' => __( 'Info', 'forminator' ),
|
464 |
'value' => $status['description'],
|
465 |
);
|
466 |
}
|
469 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG', true)`
|
470 |
if ( isset( $status['url_request'] ) ) {
|
471 |
$sub_entries[] = array(
|
472 |
+
'label' => __( 'API URL', 'forminator' ),
|
473 |
'value' => $status['url_request'],
|
474 |
);
|
475 |
}
|
476 |
|
477 |
if ( isset( $status['data_sent'] ) ) {
|
478 |
$sub_entries[] = array(
|
479 |
+
'label' => __( 'Data sent to ActiveCampaign', 'forminator' ),
|
480 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
481 |
);
|
482 |
}
|
483 |
|
484 |
if ( isset( $status['data_received'] ) ) {
|
485 |
$sub_entries[] = array(
|
486 |
+
'label' => __( 'Data received from ActiveCampaign', 'forminator' ),
|
487 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
488 |
);
|
489 |
}
|
505 |
public function on_export_render_title_row() {
|
506 |
|
507 |
$export_headers = array(
|
508 |
+
'info' => __( 'ActiveCampaign Info', 'forminator' ),
|
509 |
);
|
510 |
|
511 |
$form_id = $this->form_id;
|
addons/pro/activecampaign/class-forminator-addon-activecampaign-form-settings.php
CHANGED
@@ -37,7 +37,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
37 |
|
38 |
$this->_update_form_settings_error_message = __(
|
39 |
'The update to your settings for this form failed, check the form input and try again.',
|
40 |
-
|
41 |
);
|
42 |
}
|
43 |
|
@@ -123,14 +123,14 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
123 |
$buttons = array();
|
124 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
125 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
126 |
-
esc_html__( 'Deactivate',
|
127 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
128 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.',
|
129 |
);
|
130 |
}
|
131 |
|
132 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
133 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
134 |
'</div>';
|
135 |
|
136 |
return array(
|
@@ -182,7 +182,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
182 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/select-list.php';
|
183 |
|
184 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
185 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
186 |
}
|
187 |
|
188 |
$multi_id = $submitted_data['multi_id'];
|
@@ -216,7 +216,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
216 |
}
|
217 |
|
218 |
if ( empty( $lists ) ) {
|
219 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'No lists found on your ActiveCampaign account. Please create one.',
|
220 |
}
|
221 |
|
222 |
$template_params['lists'] = $lists;
|
@@ -263,14 +263,14 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
263 |
$buttons = array();
|
264 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
265 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
266 |
-
esc_html__( 'Deactivate',
|
267 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
268 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.',
|
269 |
);
|
270 |
}
|
271 |
|
272 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
273 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
274 |
'</div>';
|
275 |
|
276 |
return array(
|
@@ -324,7 +324,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
324 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/map-fields.php';
|
325 |
|
326 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
327 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
328 |
}
|
329 |
|
330 |
$multi_id = $submitted_data['multi_id'];
|
@@ -354,11 +354,11 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
354 |
$has_errors = false;
|
355 |
|
356 |
$fields = array(
|
357 |
-
'email' => __( 'Email Address',
|
358 |
-
'first_name' => __( 'First Name',
|
359 |
-
'last_name' => __( 'Last Name',
|
360 |
-
'phone' => __( 'Phone',
|
361 |
-
'orgname' => __( 'Organization Name',
|
362 |
);
|
363 |
|
364 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
@@ -388,7 +388,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
388 |
|
389 |
try {
|
390 |
if ( empty( $fields_map ) ) {
|
391 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please assign fields.',
|
392 |
}
|
393 |
|
394 |
$input_exceptions = new Forminator_Addon_Activecampaign_Form_Settings_Exception();
|
@@ -403,7 +403,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
403 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
404 |
$input_exceptions->add_input_exception(
|
405 |
/* translators: %s: title */
|
406 |
-
sprintf( __( 'Please assign valid field for %s',
|
407 |
$key . '_error'
|
408 |
);
|
409 |
continue;
|
@@ -431,14 +431,14 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
431 |
$buttons = array();
|
432 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
433 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
434 |
-
esc_html__( 'Deactivate',
|
435 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
436 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.',
|
437 |
);
|
438 |
}
|
439 |
|
440 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
441 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
442 |
'</div>';
|
443 |
|
444 |
return array(
|
@@ -502,7 +502,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
502 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/setup-options.php';
|
503 |
|
504 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
505 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
506 |
}
|
507 |
|
508 |
$multi_id = $submitted_data['multi_id'];
|
@@ -593,7 +593,7 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
593 |
// possible different type intended
|
594 |
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
595 |
if ( ! empty( $double_opt_form_id ) && ! in_array( $double_opt_form_id, array_keys( $forms ) ) ) {
|
596 |
-
$input_exceptions->add_input_exception( __( 'Please pick valid ActiveCampaign Form',
|
597 |
}
|
598 |
|
599 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
@@ -628,14 +628,14 @@ class Forminator_Addon_Activecampaign_Form_Settings extends Forminator_Addon_For
|
|
628 |
$buttons = array();
|
629 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
630 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
631 |
-
esc_html__( 'Deactivate',
|
632 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
633 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.',
|
634 |
);
|
635 |
}
|
636 |
|
637 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
638 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
639 |
'</div>';
|
640 |
|
641 |
return array(
|
37 |
|
38 |
$this->_update_form_settings_error_message = __(
|
39 |
'The update to your settings for this form failed, check the form input and try again.',
|
40 |
+
'forminator'
|
41 |
);
|
42 |
}
|
43 |
|
123 |
$buttons = array();
|
124 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
125 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
126 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
127 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
128 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.', 'forminator' )
|
129 |
);
|
130 |
}
|
131 |
|
132 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
133 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
134 |
'</div>';
|
135 |
|
136 |
return array(
|
182 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/select-list.php';
|
183 |
|
184 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
185 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
186 |
}
|
187 |
|
188 |
$multi_id = $submitted_data['multi_id'];
|
216 |
}
|
217 |
|
218 |
if ( empty( $lists ) ) {
|
219 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'No lists found on your ActiveCampaign account. Please create one.', 'forminator' ) );
|
220 |
}
|
221 |
|
222 |
$template_params['lists'] = $lists;
|
263 |
$buttons = array();
|
264 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
265 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
266 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
267 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
268 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.', 'forminator' )
|
269 |
);
|
270 |
}
|
271 |
|
272 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
273 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
274 |
'</div>';
|
275 |
|
276 |
return array(
|
324 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/map-fields.php';
|
325 |
|
326 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
327 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
328 |
}
|
329 |
|
330 |
$multi_id = $submitted_data['multi_id'];
|
354 |
$has_errors = false;
|
355 |
|
356 |
$fields = array(
|
357 |
+
'email' => __( 'Email Address', 'forminator' ),
|
358 |
+
'first_name' => __( 'First Name', 'forminator' ),
|
359 |
+
'last_name' => __( 'Last Name', 'forminator' ),
|
360 |
+
'phone' => __( 'Phone', 'forminator' ),
|
361 |
+
'orgname' => __( 'Organization Name', 'forminator' ),
|
362 |
);
|
363 |
|
364 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
388 |
|
389 |
try {
|
390 |
if ( empty( $fields_map ) ) {
|
391 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please assign fields.', 'forminator' ) );
|
392 |
}
|
393 |
|
394 |
$input_exceptions = new Forminator_Addon_Activecampaign_Form_Settings_Exception();
|
403 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
404 |
$input_exceptions->add_input_exception(
|
405 |
/* translators: %s: title */
|
406 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
407 |
$key . '_error'
|
408 |
);
|
409 |
continue;
|
431 |
$buttons = array();
|
432 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
433 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
434 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
435 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
436 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.', 'forminator' )
|
437 |
);
|
438 |
}
|
439 |
|
440 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
441 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
442 |
'</div>';
|
443 |
|
444 |
return array(
|
502 |
$template = forminator_addon_activecampaign_dir() . 'views/form-settings/setup-options.php';
|
503 |
|
504 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
505 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
506 |
}
|
507 |
|
508 |
$multi_id = $submitted_data['multi_id'];
|
593 |
// possible different type intended
|
594 |
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
595 |
if ( ! empty( $double_opt_form_id ) && ! in_array( $double_opt_form_id, array_keys( $forms ) ) ) {
|
596 |
+
$input_exceptions->add_input_exception( __( 'Please pick valid ActiveCampaign Form', 'forminator' ), 'double_opt_form_id_error' );
|
597 |
}
|
598 |
|
599 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
628 |
$buttons = array();
|
629 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
630 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
631 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
632 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
633 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Form.', 'forminator' )
|
634 |
);
|
635 |
}
|
636 |
|
637 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
638 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
639 |
'</div>';
|
640 |
|
641 |
return array(
|
addons/pro/activecampaign/class-forminator-addon-activecampaign-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'ActiveCampaign failed to process submitted data. Please check your quiz and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -160,7 +160,7 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
160 |
$args = array();
|
161 |
|
162 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
163 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'List ID not properly setup.',
|
164 |
}
|
165 |
|
166 |
$args[ 'p[' . $connection_settings['list_id'] . ']' ] = $connection_settings['list_id'];
|
@@ -171,7 +171,7 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
171 |
|
172 |
$email_element_id = $connection_settings['fields_map']['email'];
|
173 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
174 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Email on element not found or not filled on submitted data.',
|
175 |
}
|
176 |
$email = $submitted_data[ $email_element_id ];
|
177 |
$email = strtolower( trim( $email ) );
|
@@ -308,7 +308,7 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
308 |
return array(
|
309 |
'is_sent' => true,
|
310 |
'connection_name' => $connection_settings['name'],
|
311 |
-
'description' => __( 'Successfully send data to ActiveCampaign',
|
312 |
'data_sent' => $ac_api->get_last_data_sent(),
|
313 |
'data_received' => $ac_api->get_last_data_received(),
|
314 |
'url_request' => $ac_api->get_last_url_request(),
|
@@ -412,29 +412,29 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
412 |
}
|
413 |
$status = $addon_meta_data['value'];
|
414 |
$additional_entry_item = array(
|
415 |
-
'label' => __( 'ActiveCampaign Integration',
|
416 |
'value' => '',
|
417 |
);
|
418 |
|
419 |
$sub_entries = array();
|
420 |
if ( isset( $status['connection_name'] ) ) {
|
421 |
$sub_entries[] = array(
|
422 |
-
'label' => __( 'Integration Name',
|
423 |
'value' => $status['connection_name'],
|
424 |
);
|
425 |
}
|
426 |
|
427 |
if ( isset( $status['is_sent'] ) ) {
|
428 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
429 |
$sub_entries[] = array(
|
430 |
-
'label' => __( 'Sent To ActiveCampaign',
|
431 |
'value' => $is_sent,
|
432 |
);
|
433 |
}
|
434 |
|
435 |
if ( isset( $status['description'] ) ) {
|
436 |
$sub_entries[] = array(
|
437 |
-
'label' => __( 'Info',
|
438 |
'value' => $status['description'],
|
439 |
);
|
440 |
}
|
@@ -443,21 +443,21 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
443 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG', true)`
|
444 |
if ( isset( $status['url_request'] ) ) {
|
445 |
$sub_entries[] = array(
|
446 |
-
'label' => __( 'API URL',
|
447 |
'value' => $status['url_request'],
|
448 |
);
|
449 |
}
|
450 |
|
451 |
if ( isset( $status['data_sent'] ) ) {
|
452 |
$sub_entries[] = array(
|
453 |
-
'label' => __( 'Data sent to ActiveCampaign',
|
454 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
455 |
);
|
456 |
}
|
457 |
|
458 |
if ( isset( $status['data_received'] ) ) {
|
459 |
$sub_entries[] = array(
|
460 |
-
'label' => __( 'Data received from ActiveCampaign',
|
461 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
462 |
);
|
463 |
}
|
@@ -479,7 +479,7 @@ class Forminator_Addon_Activecampaign_Quiz_Hooks extends Forminator_Addon_Quiz_H
|
|
479 |
public function on_export_render_title_row() {
|
480 |
|
481 |
$export_headers = array(
|
482 |
-
'info' => __( 'ActiveCampaign Info',
|
483 |
);
|
484 |
|
485 |
$quiz_id = $this->quiz_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'ActiveCampaign failed to process submitted data. Please check your quiz and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
160 |
$args = array();
|
161 |
|
162 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
163 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
164 |
}
|
165 |
|
166 |
$args[ 'p[' . $connection_settings['list_id'] . ']' ] = $connection_settings['list_id'];
|
171 |
|
172 |
$email_element_id = $connection_settings['fields_map']['email'];
|
173 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
174 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Email on element not found or not filled on submitted data.', 'forminator' ) );
|
175 |
}
|
176 |
$email = $submitted_data[ $email_element_id ];
|
177 |
$email = strtolower( trim( $email ) );
|
308 |
return array(
|
309 |
'is_sent' => true,
|
310 |
'connection_name' => $connection_settings['name'],
|
311 |
+
'description' => __( 'Successfully send data to ActiveCampaign', 'forminator' ),
|
312 |
'data_sent' => $ac_api->get_last_data_sent(),
|
313 |
'data_received' => $ac_api->get_last_data_received(),
|
314 |
'url_request' => $ac_api->get_last_url_request(),
|
412 |
}
|
413 |
$status = $addon_meta_data['value'];
|
414 |
$additional_entry_item = array(
|
415 |
+
'label' => __( 'ActiveCampaign Integration', 'forminator' ),
|
416 |
'value' => '',
|
417 |
);
|
418 |
|
419 |
$sub_entries = array();
|
420 |
if ( isset( $status['connection_name'] ) ) {
|
421 |
$sub_entries[] = array(
|
422 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
423 |
'value' => $status['connection_name'],
|
424 |
);
|
425 |
}
|
426 |
|
427 |
if ( isset( $status['is_sent'] ) ) {
|
428 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
429 |
$sub_entries[] = array(
|
430 |
+
'label' => __( 'Sent To ActiveCampaign', 'forminator' ),
|
431 |
'value' => $is_sent,
|
432 |
);
|
433 |
}
|
434 |
|
435 |
if ( isset( $status['description'] ) ) {
|
436 |
$sub_entries[] = array(
|
437 |
+
'label' => __( 'Info', 'forminator' ),
|
438 |
'value' => $status['description'],
|
439 |
);
|
440 |
}
|
443 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ACTIVECAMPAIGN_SHOW_FULL_LOG', true)`
|
444 |
if ( isset( $status['url_request'] ) ) {
|
445 |
$sub_entries[] = array(
|
446 |
+
'label' => __( 'API URL', 'forminator' ),
|
447 |
'value' => $status['url_request'],
|
448 |
);
|
449 |
}
|
450 |
|
451 |
if ( isset( $status['data_sent'] ) ) {
|
452 |
$sub_entries[] = array(
|
453 |
+
'label' => __( 'Data sent to ActiveCampaign', 'forminator' ),
|
454 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
455 |
);
|
456 |
}
|
457 |
|
458 |
if ( isset( $status['data_received'] ) ) {
|
459 |
$sub_entries[] = array(
|
460 |
+
'label' => __( 'Data received from ActiveCampaign', 'forminator' ),
|
461 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
462 |
);
|
463 |
}
|
479 |
public function on_export_render_title_row() {
|
480 |
|
481 |
$export_headers = array(
|
482 |
+
'info' => __( 'ActiveCampaign Info', 'forminator' ),
|
483 |
);
|
484 |
|
485 |
$quiz_id = $this->quiz_id;
|
addons/pro/activecampaign/class-forminator-addon-activecampaign-quiz-settings.php
CHANGED
@@ -37,7 +37,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
37 |
|
38 |
$this->_update_quiz_settings_error_message = __(
|
39 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
40 |
-
|
41 |
);
|
42 |
}
|
43 |
|
@@ -123,14 +123,14 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
123 |
$buttons = array();
|
124 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
125 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
126 |
-
esc_html__( 'Deactivate',
|
127 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
128 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.',
|
129 |
);
|
130 |
}
|
131 |
|
132 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
133 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
134 |
'</div>';
|
135 |
|
136 |
return array(
|
@@ -182,7 +182,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
182 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/select-list.php';
|
183 |
|
184 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
185 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
186 |
}
|
187 |
|
188 |
$multi_id = $submitted_data['multi_id'];
|
@@ -216,7 +216,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
216 |
}
|
217 |
|
218 |
if ( empty( $lists ) ) {
|
219 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'No lists found on your ActiveCampaign account. Please create one.',
|
220 |
}
|
221 |
|
222 |
$template_params['lists'] = $lists;
|
@@ -263,14 +263,14 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
263 |
$buttons = array();
|
264 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
265 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
266 |
-
esc_html__( 'Deactivate',
|
267 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
268 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.',
|
269 |
);
|
270 |
}
|
271 |
|
272 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
273 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
274 |
'</div>';
|
275 |
|
276 |
return array(
|
@@ -324,7 +324,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
324 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/map-fields.php';
|
325 |
|
326 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
327 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
328 |
}
|
329 |
|
330 |
$multi_id = $submitted_data['multi_id'];
|
@@ -345,7 +345,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
345 |
|
346 |
$quiz_questions = $this->get_quiz_fields();
|
347 |
$quiz_fields = array(
|
348 |
-
'quiz-name' => __( 'Quiz Name',
|
349 |
);
|
350 |
foreach ( $quiz_questions as $quiz_question ) {
|
351 |
// collect element ids
|
@@ -353,11 +353,11 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
353 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
354 |
}
|
355 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
356 |
-
$quiz_fields['correct-answers'] = __( 'Correct Answers',
|
357 |
-
$quiz_fields['total-answers'] = __( 'Total Answers',
|
358 |
array_push( $forminator_quiz_element_ids,'quiz-name','correct-answers', 'total-answers' );
|
359 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
360 |
-
$quiz_fields['result-answers'] = __( 'Result Answer',
|
361 |
array_push( $forminator_quiz_element_ids,'quiz-name', 'result-answers' );
|
362 |
}
|
363 |
|
@@ -377,11 +377,11 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
377 |
$has_errors = false;
|
378 |
|
379 |
$fields = array(
|
380 |
-
'email' => __( 'Email Address',
|
381 |
-
'first_name' => __( 'First Name',
|
382 |
-
'last_name' => __( 'Last Name',
|
383 |
-
'phone' => __( 'Phone',
|
384 |
-
'orgname' => __( 'Organization Name',
|
385 |
);
|
386 |
|
387 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
@@ -411,7 +411,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
411 |
|
412 |
try {
|
413 |
if ( empty( $fields_map ) ) {
|
414 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please assign fields.',
|
415 |
}
|
416 |
|
417 |
$input_exceptions = new Forminator_Addon_Activecampaign_Quiz_Settings_Exception();
|
@@ -426,7 +426,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
426 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
427 |
$input_exceptions->add_input_exception(
|
428 |
/* translators: %s: title */
|
429 |
-
sprintf( __( 'Please assign valid field for %s',
|
430 |
$key . '_error'
|
431 |
);
|
432 |
continue;
|
@@ -454,14 +454,14 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
454 |
$buttons = array();
|
455 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
456 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
457 |
-
esc_html__( 'Deactivate',
|
458 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
459 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.',
|
460 |
);
|
461 |
}
|
462 |
|
463 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
464 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
465 |
'</div>';
|
466 |
|
467 |
return array(
|
@@ -525,7 +525,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
525 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/setup-options.php';
|
526 |
|
527 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
528 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
529 |
}
|
530 |
|
531 |
$multi_id = $submitted_data['multi_id'];
|
@@ -616,7 +616,7 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
616 |
// possible different type intended
|
617 |
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
618 |
if ( ! empty( $double_opt_form_id ) && ! in_array( $double_opt_form_id, array_keys( $forms ) ) ) {
|
619 |
-
$input_exceptions->add_input_exception( __( 'Please pick valid ActiveCampaign Quiz',
|
620 |
}
|
621 |
|
622 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
@@ -651,14 +651,14 @@ class Forminator_Addon_Activecampaign_Quiz_Settings extends Forminator_Addon_Qui
|
|
651 |
$buttons = array();
|
652 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
653 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
654 |
-
esc_html__( 'Deactivate',
|
655 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
656 |
-
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.',
|
657 |
);
|
658 |
}
|
659 |
|
660 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
661 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
662 |
'</div>';
|
663 |
|
664 |
return array(
|
37 |
|
38 |
$this->_update_quiz_settings_error_message = __(
|
39 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
40 |
+
'forminator'
|
41 |
);
|
42 |
}
|
43 |
|
123 |
$buttons = array();
|
124 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
125 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
126 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
127 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
128 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.', 'forminator' )
|
129 |
);
|
130 |
}
|
131 |
|
132 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
133 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
134 |
'</div>';
|
135 |
|
136 |
return array(
|
182 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/select-list.php';
|
183 |
|
184 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
185 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
186 |
}
|
187 |
|
188 |
$multi_id = $submitted_data['multi_id'];
|
216 |
}
|
217 |
|
218 |
if ( empty( $lists ) ) {
|
219 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'No lists found on your ActiveCampaign account. Please create one.', 'forminator' ) );
|
220 |
}
|
221 |
|
222 |
$template_params['lists'] = $lists;
|
263 |
$buttons = array();
|
264 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
265 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
266 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
267 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
268 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.', 'forminator' )
|
269 |
);
|
270 |
}
|
271 |
|
272 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
273 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
274 |
'</div>';
|
275 |
|
276 |
return array(
|
324 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/map-fields.php';
|
325 |
|
326 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
327 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
328 |
}
|
329 |
|
330 |
$multi_id = $submitted_data['multi_id'];
|
345 |
|
346 |
$quiz_questions = $this->get_quiz_fields();
|
347 |
$quiz_fields = array(
|
348 |
+
'quiz-name' => __( 'Quiz Name', 'forminator' ),
|
349 |
);
|
350 |
foreach ( $quiz_questions as $quiz_question ) {
|
351 |
// collect element ids
|
353 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
354 |
}
|
355 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
356 |
+
$quiz_fields['correct-answers'] = __( 'Correct Answers', 'forminator' );
|
357 |
+
$quiz_fields['total-answers'] = __( 'Total Answers', 'forminator' );
|
358 |
array_push( $forminator_quiz_element_ids,'quiz-name','correct-answers', 'total-answers' );
|
359 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
360 |
+
$quiz_fields['result-answers'] = __( 'Result Answer', 'forminator' );
|
361 |
array_push( $forminator_quiz_element_ids,'quiz-name', 'result-answers' );
|
362 |
}
|
363 |
|
377 |
$has_errors = false;
|
378 |
|
379 |
$fields = array(
|
380 |
+
'email' => __( 'Email Address', 'forminator' ),
|
381 |
+
'first_name' => __( 'First Name', 'forminator' ),
|
382 |
+
'last_name' => __( 'Last Name', 'forminator' ),
|
383 |
+
'phone' => __( 'Phone', 'forminator' ),
|
384 |
+
'orgname' => __( 'Organization Name', 'forminator' ),
|
385 |
);
|
386 |
|
387 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
411 |
|
412 |
try {
|
413 |
if ( empty( $fields_map ) ) {
|
414 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please assign fields.', 'forminator' ) );
|
415 |
}
|
416 |
|
417 |
$input_exceptions = new Forminator_Addon_Activecampaign_Quiz_Settings_Exception();
|
426 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
427 |
$input_exceptions->add_input_exception(
|
428 |
/* translators: %s: title */
|
429 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
430 |
$key . '_error'
|
431 |
);
|
432 |
continue;
|
454 |
$buttons = array();
|
455 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
456 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
457 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
458 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
459 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.', 'forminator' )
|
460 |
);
|
461 |
}
|
462 |
|
463 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
464 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
465 |
'</div>';
|
466 |
|
467 |
return array(
|
525 |
$template = forminator_addon_activecampaign_dir() . 'views/quiz-settings/setup-options.php';
|
526 |
|
527 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
528 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
529 |
}
|
530 |
|
531 |
$multi_id = $submitted_data['multi_id'];
|
616 |
// possible different type intended
|
617 |
// phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
|
618 |
if ( ! empty( $double_opt_form_id ) && ! in_array( $double_opt_form_id, array_keys( $forms ) ) ) {
|
619 |
+
$input_exceptions->add_input_exception( __( 'Please pick valid ActiveCampaign Quiz', 'forminator' ), 'double_opt_form_id_error' );
|
620 |
}
|
621 |
|
622 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
651 |
$buttons = array();
|
652 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
653 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
654 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
655 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
656 |
+
esc_html__( 'Deactivate this ActiveCampaign Integration from this Quiz.', 'forminator' )
|
657 |
);
|
658 |
}
|
659 |
|
660 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
661 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
662 |
'</div>';
|
663 |
|
664 |
return array(
|
addons/pro/activecampaign/class-forminator-addon-activecampaign.php
CHANGED
@@ -45,13 +45,13 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
// late init to allow translation
|
48 |
-
$this->_description = __( 'Get awesome by your form.',
|
49 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Activecampaign Integration, don\'t hesitate to contact us',
|
50 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Activecampaign Integration, please try again',
|
51 |
|
52 |
$this->_update_settings_error_message = __(
|
53 |
'Sorry, we failed to update settings, please check your form and try again',
|
54 |
-
|
55 |
);
|
56 |
|
57 |
$this->_icon = forminator_addon_activecampaign_assets_url() . 'icons/activecampaign.png';
|
@@ -85,7 +85,7 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
85 |
try {
|
86 |
// check if its active
|
87 |
if ( ! $this->is_active() ) {
|
88 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'ActiveCampaign is not active',
|
89 |
}
|
90 |
|
91 |
// if user completed api setup
|
@@ -120,17 +120,17 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
120 |
try {
|
121 |
$form_settings_instance = null;
|
122 |
if ( ! $this->is_connected() ) {
|
123 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( ' ActiveCampaign is not connected',
|
124 |
}
|
125 |
|
126 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
127 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Activecampaign_Form_Settings ) {
|
128 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Form Settings of ActiveCampaign',
|
129 |
}
|
130 |
|
131 |
// Mark as active when there is at least one active connection
|
132 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
133 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'No active ActiveCampaign connection found in this form',
|
134 |
}
|
135 |
|
136 |
$is_form_connected = true;
|
@@ -331,22 +331,22 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
331 |
|
332 |
if ( $show_success ) {
|
333 |
$buttons['close'] = array(
|
334 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
335 |
);
|
336 |
} else {
|
337 |
if ( $this->is_connected() ) {
|
338 |
$buttons['disconnect'] = array(
|
339 |
-
'markup' => self::get_button_markup( esc_html__( 'Disconnect',
|
340 |
);
|
341 |
$buttons['submit'] = array(
|
342 |
'markup' => '<div class="sui-actions-right">' .
|
343 |
-
self::get_button_markup( esc_html__( 'Save',
|
344 |
'</div>',
|
345 |
);
|
346 |
} else {
|
347 |
$buttons['submit'] = array(
|
348 |
'markup' => '<div class="sui-actions-right">' .
|
349 |
-
self::get_button_markup( esc_html__( 'CONNECT',
|
350 |
'</div>',
|
351 |
);
|
352 |
}
|
@@ -379,12 +379,12 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
379 |
*/
|
380 |
public function validate_api_url( $api_url ) {
|
381 |
if ( empty( $api_url ) ) {
|
382 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API URL',
|
383 |
}
|
384 |
|
385 |
$api_url = wp_http_validate_url( $api_url );
|
386 |
if ( false === $api_url ) {
|
387 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API URL',
|
388 |
}
|
389 |
|
390 |
return $api_url;
|
@@ -402,7 +402,7 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
402 |
*/
|
403 |
public function validate_api_key( $api_key ) {
|
404 |
if ( empty( $api_key ) ) {
|
405 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API Key',
|
406 |
}
|
407 |
|
408 |
return $api_key;
|
@@ -426,7 +426,7 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
426 |
$account_request = $api->get_account();
|
427 |
|
428 |
if ( ! isset( $account_request->account ) || empty( $account_request->account ) ) {
|
429 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Failed to get ActiveCampaign account info.',
|
430 |
}
|
431 |
|
432 |
$this->connected_account = $account_request->account;
|
@@ -500,17 +500,17 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
500 |
try {
|
501 |
$quiz_settings_instance = null;
|
502 |
if ( ! $this->is_connected() ) {
|
503 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'ActiveCampaign is not connected',
|
504 |
}
|
505 |
|
506 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
507 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Activecampaign_Quiz_Settings ) {
|
508 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Quiz Settings of ActiveCampaign',
|
509 |
}
|
510 |
|
511 |
// Mark as active when there is at least one active connection
|
512 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
513 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'No active ActiveCampaign connection found in this quiz',
|
514 |
}
|
515 |
|
516 |
$is_quiz_connected = true;
|
@@ -551,12 +551,12 @@ final class Forminator_Addon_Activecampaign extends Forminator_Addon_Abstract {
|
|
551 |
// initialize with null
|
552 |
$quiz_settings_instance = null;
|
553 |
if ( ! $this->is_connected() ) {
|
554 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( ' ActiveCampaign is not connected',
|
555 |
}
|
556 |
|
557 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
558 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Activecampaign_Quiz_Settings ) {
|
559 |
-
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Quiz Settings of ActiveCampaign',
|
560 |
}
|
561 |
|
562 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
// late init to allow translation
|
48 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
49 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Activecampaign Integration, don\'t hesitate to contact us', 'forminator' );
|
50 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Activecampaign Integration, please try again', 'forminator' );
|
51 |
|
52 |
$this->_update_settings_error_message = __(
|
53 |
'Sorry, we failed to update settings, please check your form and try again',
|
54 |
+
'forminator'
|
55 |
);
|
56 |
|
57 |
$this->_icon = forminator_addon_activecampaign_assets_url() . 'icons/activecampaign.png';
|
85 |
try {
|
86 |
// check if its active
|
87 |
if ( ! $this->is_active() ) {
|
88 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'ActiveCampaign is not active', 'forminator' ) );
|
89 |
}
|
90 |
|
91 |
// if user completed api setup
|
120 |
try {
|
121 |
$form_settings_instance = null;
|
122 |
if ( ! $this->is_connected() ) {
|
123 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( ' ActiveCampaign is not connected', 'forminator' ) );
|
124 |
}
|
125 |
|
126 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
127 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Activecampaign_Form_Settings ) {
|
128 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Form Settings of ActiveCampaign', 'forminator' ) );
|
129 |
}
|
130 |
|
131 |
// Mark as active when there is at least one active connection
|
132 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
133 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'No active ActiveCampaign connection found in this form', 'forminator' ) );
|
134 |
}
|
135 |
|
136 |
$is_form_connected = true;
|
331 |
|
332 |
if ( $show_success ) {
|
333 |
$buttons['close'] = array(
|
334 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'sui-button-ghost forminator-addon-close' ),
|
335 |
);
|
336 |
} else {
|
337 |
if ( $this->is_connected() ) {
|
338 |
$buttons['disconnect'] = array(
|
339 |
+
'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
340 |
);
|
341 |
$buttons['submit'] = array(
|
342 |
'markup' => '<div class="sui-actions-right">' .
|
343 |
+
self::get_button_markup( esc_html__( 'Save', 'forminator' ), 'forminator-addon-connect' ) .
|
344 |
'</div>',
|
345 |
);
|
346 |
} else {
|
347 |
$buttons['submit'] = array(
|
348 |
'markup' => '<div class="sui-actions-right">' .
|
349 |
+
self::get_button_markup( esc_html__( 'CONNECT', 'forminator' ), 'forminator-addon-connect' ) .
|
350 |
'</div>',
|
351 |
);
|
352 |
}
|
379 |
*/
|
380 |
public function validate_api_url( $api_url ) {
|
381 |
if ( empty( $api_url ) ) {
|
382 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API URL', 'forminator' ) );
|
383 |
}
|
384 |
|
385 |
$api_url = wp_http_validate_url( $api_url );
|
386 |
if ( false === $api_url ) {
|
387 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API URL', 'forminator' ) );
|
388 |
}
|
389 |
|
390 |
return $api_url;
|
402 |
*/
|
403 |
public function validate_api_key( $api_key ) {
|
404 |
if ( empty( $api_key ) ) {
|
405 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Please put a valid ActiveCampaign API Key', 'forminator' ) );
|
406 |
}
|
407 |
|
408 |
return $api_key;
|
426 |
$account_request = $api->get_account();
|
427 |
|
428 |
if ( ! isset( $account_request->account ) || empty( $account_request->account ) ) {
|
429 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Failed to get ActiveCampaign account info.', 'forminator' ) );
|
430 |
}
|
431 |
|
432 |
$this->connected_account = $account_request->account;
|
500 |
try {
|
501 |
$quiz_settings_instance = null;
|
502 |
if ( ! $this->is_connected() ) {
|
503 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'ActiveCampaign is not connected', 'forminator' ) );
|
504 |
}
|
505 |
|
506 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
507 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Activecampaign_Quiz_Settings ) {
|
508 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Quiz Settings of ActiveCampaign', 'forminator' ) );
|
509 |
}
|
510 |
|
511 |
// Mark as active when there is at least one active connection
|
512 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
513 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'No active ActiveCampaign connection found in this quiz', 'forminator' ) );
|
514 |
}
|
515 |
|
516 |
$is_quiz_connected = true;
|
551 |
// initialize with null
|
552 |
$quiz_settings_instance = null;
|
553 |
if ( ! $this->is_connected() ) {
|
554 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( ' ActiveCampaign is not connected', 'forminator' ) );
|
555 |
}
|
556 |
|
557 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
558 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Activecampaign_Quiz_Settings ) {
|
559 |
+
throw new Forminator_Addon_Activecampaign_Exception( __( 'Invalid Quiz Settings of ActiveCampaign', 'forminator' ) );
|
560 |
}
|
561 |
|
562 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
addons/pro/activecampaign/lib/class-forminator-addon-activecampaign-wp-api.php
CHANGED
@@ -60,11 +60,11 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
60 |
public function __construct( $_endpoint, $_api_key ) {
|
61 |
//prerequisites
|
62 |
if ( ! $_endpoint ) {
|
63 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Missing required API URL',
|
64 |
}
|
65 |
|
66 |
if ( ! $_api_key ) {
|
67 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Missing required API Key',
|
68 |
}
|
69 |
|
70 |
$this->_endpoint = $_endpoint;
|
@@ -178,7 +178,7 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
178 |
if ( is_wp_error( $res ) || ! $res ) {
|
179 |
forminator_addon_maybe_log( __METHOD__, $res );
|
180 |
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception(
|
181 |
-
__( 'Failed to process request, make sure your API URL and API KEY are correct and your server has internet connection.',
|
182 |
);
|
183 |
}
|
184 |
|
@@ -192,10 +192,10 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
192 |
|
193 |
if ( 404 === $status_code ) {
|
194 |
/* translators: ... */
|
195 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
196 |
}
|
197 |
/* translators: ... */
|
198 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
199 |
}
|
200 |
}
|
201 |
|
@@ -213,7 +213,7 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
213 |
$message = ' ' . $res->result_message;
|
214 |
}
|
215 |
/* translators: ... */
|
216 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( sprintf( __( 'Failed to get ActiveCampaign data.%1$s',
|
217 |
}
|
218 |
}
|
219 |
}
|
@@ -394,7 +394,7 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
394 |
$args = array_merge( $default_args, $args );
|
395 |
|
396 |
if ( empty( $args['email'] ) ) {
|
397 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Required email parameter not set',
|
398 |
}
|
399 |
|
400 |
return $this->request(
|
@@ -427,7 +427,7 @@ class Forminator_Addon_Activecampaign_Wp_Api {
|
|
427 |
$args = array_merge( $default_args, $args );
|
428 |
|
429 |
if ( empty( $args['id'] ) ) {
|
430 |
-
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Required id parameter not set for contact_delete.',
|
431 |
}
|
432 |
|
433 |
return $this->request(
|
60 |
public function __construct( $_endpoint, $_api_key ) {
|
61 |
//prerequisites
|
62 |
if ( ! $_endpoint ) {
|
63 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Missing required API URL', 'forminator' ) );
|
64 |
}
|
65 |
|
66 |
if ( ! $_api_key ) {
|
67 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Missing required API Key', 'forminator' ) );
|
68 |
}
|
69 |
|
70 |
$this->_endpoint = $_endpoint;
|
178 |
if ( is_wp_error( $res ) || ! $res ) {
|
179 |
forminator_addon_maybe_log( __METHOD__, $res );
|
180 |
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception(
|
181 |
+
__( 'Failed to process request, make sure your API URL and API KEY are correct and your server has internet connection.', 'forminator' )
|
182 |
);
|
183 |
}
|
184 |
|
192 |
|
193 |
if ( 404 === $status_code ) {
|
194 |
/* translators: ... */
|
195 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
196 |
}
|
197 |
/* translators: ... */
|
198 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
199 |
}
|
200 |
}
|
201 |
|
213 |
$message = ' ' . $res->result_message;
|
214 |
}
|
215 |
/* translators: ... */
|
216 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( sprintf( __( 'Failed to get ActiveCampaign data.%1$s', 'forminator' ), $message ) );
|
217 |
}
|
218 |
}
|
219 |
}
|
394 |
$args = array_merge( $default_args, $args );
|
395 |
|
396 |
if ( empty( $args['email'] ) ) {
|
397 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Required email parameter not set', 'forminator' ) );
|
398 |
}
|
399 |
|
400 |
return $this->request(
|
427 |
$args = array_merge( $default_args, $args );
|
428 |
|
429 |
if ( empty( $args['id'] ) ) {
|
430 |
+
throw new Forminator_Addon_Activecampaign_Wp_Api_Exception( __( 'Required id parameter not set for contact_delete.', 'forminator' ) );
|
431 |
}
|
432 |
|
433 |
return $this->request(
|
addons/pro/activecampaign/views/form-settings/map-fields.php
CHANGED
@@ -15,8 +15,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
|
16 |
?>
|
17 |
<div class="integration-header">
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields',
|
19 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Match up your form fields with your campaign fields to make sure we\'re sending data to the right place.',
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
21 |
<div class="sui-notice sui-notice-error">
|
22 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -27,8 +27,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
27 |
<table class="sui-table">
|
28 |
<thead>
|
29 |
<tr>
|
30 |
-
<th><?php esc_html_e( 'ActiveCampaign Field',
|
31 |
-
<th><?php esc_html_e( 'Forminator Field',
|
32 |
</tr>
|
33 |
</thead>
|
34 |
<tbody>
|
15 |
|
16 |
?>
|
17 |
<div class="integration-header">
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
19 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Match up your form fields with your campaign fields to make sure we\'re sending data to the right place.', 'forminator' ); ?></span>
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
21 |
<div class="sui-notice sui-notice-error">
|
22 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
27 |
<table class="sui-table">
|
28 |
<thead>
|
29 |
<tr>
|
30 |
+
<th><?php esc_html_e( 'ActiveCampaign Field', 'forminator' ); ?></th>
|
31 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
32 |
</tr>
|
33 |
</thead>
|
34 |
<tbody>
|
addons/pro/activecampaign/views/form-settings/pick-name.php
CHANGED
@@ -13,8 +13,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<div class="sui-notice sui-notice-error">
|
20 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -23,10 +23,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
</div>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
27 |
<input
|
28 |
class="sui-form-control"
|
29 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
30 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
31 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
32 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></span>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<div class="sui-notice sui-notice-error">
|
20 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
23 |
</div>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
27 |
<input
|
28 |
class="sui-form-control"
|
29 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
30 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
31 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
32 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/activecampaign/views/form-settings/select-list.php
CHANGED
@@ -14,8 +14,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose Contact List',
|
18 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick ActiveCampaign List for new contacts to be added to.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<div class="sui-notice sui-notice-error">
|
21 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -24,9 +24,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
</div>
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
-
<label class="sui-label" for="activecampaign-list-id"><?php esc_html_e( 'List',
|
28 |
<select name="list_id" class="sui-select sui-form-control" id="activecampaign-list-id">
|
29 |
-
<option><?php esc_html_e( 'Please select a list',
|
30 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
31 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
32 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose Contact List', 'forminator' ) ); ?></h3>
|
18 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick ActiveCampaign List for new contacts to be added to.', 'forminator' ); ?></span>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<div class="sui-notice sui-notice-error">
|
21 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
24 |
</div>
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
+
<label class="sui-label" for="activecampaign-list-id"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
28 |
<select name="list_id" class="sui-select sui-form-control" id="activecampaign-list-id">
|
29 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
30 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
31 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
32 |
<?php endforeach; ?>
|
addons/pro/activecampaign/views/form-settings/setup-options.php
CHANGED
@@ -21,9 +21,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
21 |
?>
|
22 |
<div class="integration-header">
|
23 |
|
24 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
25 |
|
26 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for ActiveCampaign integration.',
|
27 |
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -35,7 +35,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
35 |
|
36 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['tags_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
37 |
|
38 |
-
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags',
|
39 |
|
40 |
<select name="tags[]"
|
41 |
multiple="multiple"
|
@@ -71,15 +71,15 @@ foreach ( $template_vars as $key => $val ) {
|
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<span class="sui-description">
|
74 |
-
<?php esc_html_e( 'Tags for contact that sent to ActiveCampaign.',
|
75 |
</span>
|
76 |
|
77 |
</div>
|
78 |
|
79 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['double_opt_form_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
80 |
-
<label class="sui-label" for="double_opt_form_id"><?php esc_html_e( 'Double Opt-In Form',
|
81 |
<select name="double_opt_form_id" id="double_opt_form_id" class="sui-select sui-form-control">
|
82 |
-
<option value=""><?php esc_html_e( 'No form selected',
|
83 |
<?php foreach ( $vars['forms'] as $form_id => $form_name ) : ?>
|
84 |
<option value="<?php echo esc_attr( $form_id ); ?>" <?php selected( $form_id, $vars['double_opt_form_id'] ); ?>><?php echo esc_html( $form_name ); ?></option>
|
85 |
<?php endforeach; ?>
|
@@ -91,7 +91,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
91 |
<?php
|
92 |
esc_html_e(
|
93 |
'Select which ActiveCampaign form will be used when adding to ActiveCampaign to send the opt-in email. You can read more information ',
|
94 |
-
|
95 |
);
|
96 |
?>
|
97 |
<a href="https://help.activecampaign.com/hc/en-us/articles/115000839230-How-do-I-enable-double-opt-in-confirmation-" target="_blank">here</a>.
|
@@ -111,7 +111,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
111 |
<?php checked( 1, $vars['instantresponders'] ); ?>>
|
112 |
<span class="sui-toggle-slider"></span>
|
113 |
</label>
|
114 |
-
<label class="sui-toggle-label" for="instantresponders"><?php esc_html_e( 'Enable Instant Responders',
|
115 |
<?php if ( ! empty( $vars['instantresponders_error'] ) ) : ?>
|
116 |
<span class="sui-error-message"><?php echo esc_html( $vars['instantresponders_error'] ); ?></span>
|
117 |
<?php endif; ?>
|
@@ -120,7 +120,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
120 |
esc_html_e(
|
121 |
'When the instant responders option is enabled, ActiveCampaign will send any instant responders setup when the contact is added to the list.
|
122 |
This option is not available to users on a free trial.',
|
123 |
-
|
124 |
);
|
125 |
?>
|
126 |
</span>
|
@@ -138,7 +138,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
138 |
<?php checked( 1, $vars['lastmessage'] ); ?>>
|
139 |
<span class="sui-toggle-slider"></span>
|
140 |
</label>
|
141 |
-
<label class="sui-toggle-label" for="lastmessage"><?php esc_html_e( 'Send last broadcast campaign',
|
142 |
<?php if ( ! empty( $vars['lastmessage_error'] ) ) : ?>
|
143 |
<span class="sui-error-message"><?php echo esc_html( $vars['lastmessage_error'] ); ?></span>
|
144 |
<?php endif; ?>
|
@@ -147,7 +147,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
147 |
esc_html_e(
|
148 |
'When the send last broadcast campaign option is enabled, ActiveCampaign will send the last campaign sent out to the list to the contact being added.
|
149 |
This option is not available to users on a free trial.',
|
150 |
-
|
151 |
);
|
152 |
?>
|
153 |
</span>
|
21 |
?>
|
22 |
<div class="integration-header">
|
23 |
|
24 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
25 |
|
26 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for ActiveCampaign integration.', 'forminator' ); ?></span>
|
27 |
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
35 |
|
36 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['tags_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
37 |
|
38 |
+
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags', 'forminator' ); ?></label>
|
39 |
|
40 |
<select name="tags[]"
|
41 |
multiple="multiple"
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<span class="sui-description">
|
74 |
+
<?php esc_html_e( 'Tags for contact that sent to ActiveCampaign.', 'forminator' ); ?>
|
75 |
</span>
|
76 |
|
77 |
</div>
|
78 |
|
79 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['double_opt_form_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
80 |
+
<label class="sui-label" for="double_opt_form_id"><?php esc_html_e( 'Double Opt-In Form', 'forminator' ); ?></label>
|
81 |
<select name="double_opt_form_id" id="double_opt_form_id" class="sui-select sui-form-control">
|
82 |
+
<option value=""><?php esc_html_e( 'No form selected', 'forminator' ); ?></option>
|
83 |
<?php foreach ( $vars['forms'] as $form_id => $form_name ) : ?>
|
84 |
<option value="<?php echo esc_attr( $form_id ); ?>" <?php selected( $form_id, $vars['double_opt_form_id'] ); ?>><?php echo esc_html( $form_name ); ?></option>
|
85 |
<?php endforeach; ?>
|
91 |
<?php
|
92 |
esc_html_e(
|
93 |
'Select which ActiveCampaign form will be used when adding to ActiveCampaign to send the opt-in email. You can read more information ',
|
94 |
+
'forminator'
|
95 |
);
|
96 |
?>
|
97 |
<a href="https://help.activecampaign.com/hc/en-us/articles/115000839230-How-do-I-enable-double-opt-in-confirmation-" target="_blank">here</a>.
|
111 |
<?php checked( 1, $vars['instantresponders'] ); ?>>
|
112 |
<span class="sui-toggle-slider"></span>
|
113 |
</label>
|
114 |
+
<label class="sui-toggle-label" for="instantresponders"><?php esc_html_e( 'Enable Instant Responders', 'forminator' ); ?></label>
|
115 |
<?php if ( ! empty( $vars['instantresponders_error'] ) ) : ?>
|
116 |
<span class="sui-error-message"><?php echo esc_html( $vars['instantresponders_error'] ); ?></span>
|
117 |
<?php endif; ?>
|
120 |
esc_html_e(
|
121 |
'When the instant responders option is enabled, ActiveCampaign will send any instant responders setup when the contact is added to the list.
|
122 |
This option is not available to users on a free trial.',
|
123 |
+
'forminator'
|
124 |
);
|
125 |
?>
|
126 |
</span>
|
138 |
<?php checked( 1, $vars['lastmessage'] ); ?>>
|
139 |
<span class="sui-toggle-slider"></span>
|
140 |
</label>
|
141 |
+
<label class="sui-toggle-label" for="lastmessage"><?php esc_html_e( 'Send last broadcast campaign', 'forminator' ); ?></label>
|
142 |
<?php if ( ! empty( $vars['lastmessage_error'] ) ) : ?>
|
143 |
<span class="sui-error-message"><?php echo esc_html( $vars['lastmessage_error'] ); ?></span>
|
144 |
<?php endif; ?>
|
147 |
esc_html_e(
|
148 |
'When the send last broadcast campaign option is enabled, ActiveCampaign will send the last campaign sent out to the list to the contact being added.
|
149 |
This option is not available to users on a free trial.',
|
150 |
+
'forminator'
|
151 |
);
|
152 |
?>
|
153 |
</span>
|
addons/pro/activecampaign/views/quiz-settings/map-fields.php
CHANGED
@@ -16,8 +16,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields',
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Match up your quiz lead fields with your campaign fields to make sure we\'re sending data to the right place.',
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<div class="sui-notice sui-notice-error">
|
23 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -28,8 +28,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
28 |
<table class="sui-table">
|
29 |
<thead>
|
30 |
<tr>
|
31 |
-
<th><?php esc_html_e( 'ActiveCampaign Field',
|
32 |
-
<th><?php esc_html_e( 'Forminator Field',
|
33 |
</tr>
|
34 |
</thead>
|
35 |
<tbody>
|
@@ -58,7 +58,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
58 |
?>
|
59 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
60 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
61 |
-
<option value=""><?php esc_html_e( 'Please Select A Field',
|
62 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
63 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
64 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Match up your quiz lead fields with your campaign fields to make sure we\'re sending data to the right place.', 'forminator' ); ?></span>
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<div class="sui-notice sui-notice-error">
|
23 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
28 |
<table class="sui-table">
|
29 |
<thead>
|
30 |
<tr>
|
31 |
+
<th><?php esc_html_e( 'ActiveCampaign Field', 'forminator' ); ?></th>
|
32 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
33 |
</tr>
|
34 |
</thead>
|
35 |
<tbody>
|
58 |
?>
|
59 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
60 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
61 |
+
<option value=""><?php esc_html_e( 'Please Select A Field', 'forminator' ); ?></option>
|
62 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
63 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
64 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
addons/pro/activecampaign/views/quiz-settings/pick-name.php
CHANGED
@@ -13,8 +13,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<div class="sui-notice sui-notice-error">
|
20 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -23,10 +23,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
</div>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
27 |
<input
|
28 |
class="sui-form-control"
|
29 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
30 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
31 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
32 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></span>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<div class="sui-notice sui-notice-error">
|
20 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
23 |
</div>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
27 |
<input
|
28 |
class="sui-form-control"
|
29 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
30 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
31 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
32 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/activecampaign/views/quiz-settings/select-list.php
CHANGED
@@ -14,8 +14,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose Contact List',
|
18 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick ActiveCampaign List for new contacts to be added to.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<div class="sui-notice sui-notice-error">
|
21 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
@@ -24,9 +24,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
</div>
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
-
<label class="sui-label" for="activecampaign-list-id"><?php esc_html_e( 'List',
|
28 |
<select name="list_id" class="sui-select sui-form-control" id="activecampaign-list-id">
|
29 |
-
<option><?php esc_html_e( 'Please select a list',
|
30 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
31 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
32 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose Contact List', 'forminator' ) ); ?></h3>
|
18 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick ActiveCampaign List for new contacts to be added to.', 'forminator' ); ?></span>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<div class="sui-notice sui-notice-error">
|
21 |
<p><?php echo esc_html( $vars['error_message'] ); ?></p>
|
24 |
</div>
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
+
<label class="sui-label" for="activecampaign-list-id"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
28 |
<select name="list_id" class="sui-select sui-form-control" id="activecampaign-list-id">
|
29 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
30 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
31 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
32 |
<?php endforeach; ?>
|
addons/pro/activecampaign/views/quiz-settings/setup-options.php
CHANGED
@@ -21,9 +21,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
21 |
?>
|
22 |
<div class="integration-header">
|
23 |
|
24 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
25 |
|
26 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for ActiveCampaign integration.',
|
27 |
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -35,7 +35,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
35 |
|
36 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['tags_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
37 |
|
38 |
-
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags',
|
39 |
|
40 |
<select name="tags[]"
|
41 |
multiple="multiple"
|
@@ -71,15 +71,15 @@ foreach ( $template_vars as $key => $val ) {
|
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<span class="sui-description">
|
74 |
-
<?php esc_html_e( 'Tags for contact that sent to ActiveCampaign.',
|
75 |
</span>
|
76 |
|
77 |
</div>
|
78 |
|
79 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['double_opt_form_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
80 |
-
<label class="sui-label" for="double_opt_form_id"><?php esc_html_e( 'Double Opt-In Form',
|
81 |
<select name="double_opt_form_id" id="double_opt_form_id" class="sui-select sui-form-control">
|
82 |
-
<option value=""><?php esc_html_e( 'No form selected',
|
83 |
<?php foreach ( $vars['forms'] as $form_id => $form_name ) : ?>
|
84 |
<option value="<?php echo esc_attr( $form_id ); ?>" <?php selected( $form_id, $vars['double_opt_form_id'] ); ?>><?php echo esc_html( $form_name ); ?></option>
|
85 |
<?php endforeach; ?>
|
@@ -91,7 +91,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
91 |
<?php
|
92 |
esc_html_e(
|
93 |
'Select which ActiveCampaign form will be used when adding to ActiveCampaign to send the opt-in email. You can read more information ',
|
94 |
-
|
95 |
);
|
96 |
?>
|
97 |
<a href="https://help.activecampaign.com/hc/en-us/articles/115000839230-How-do-I-enable-double-opt-in-confirmation-" target="_blank">here</a>.
|
@@ -111,7 +111,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
111 |
<?php checked( 1, $vars['instantresponders'] ); ?>>
|
112 |
<span class="sui-toggle-slider"></span>
|
113 |
</label>
|
114 |
-
<label class="sui-toggle-label" for="instantresponders"><?php esc_html_e( 'Enable Instant Responders',
|
115 |
<?php if ( ! empty( $vars['instantresponders_error'] ) ) : ?>
|
116 |
<span class="sui-error-message"><?php echo esc_html( $vars['instantresponders_error'] ); ?></span>
|
117 |
<?php endif; ?>
|
@@ -120,7 +120,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
120 |
esc_html_e(
|
121 |
'When the instant responders option is enabled, ActiveCampaign will send any instant responders setup when the contact is added to the list.
|
122 |
This option is not available to users on a free trial.',
|
123 |
-
|
124 |
);
|
125 |
?>
|
126 |
</span>
|
@@ -138,7 +138,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
138 |
<?php checked( 1, $vars['lastmessage'] ); ?>>
|
139 |
<span class="sui-toggle-slider"></span>
|
140 |
</label>
|
141 |
-
<label class="sui-toggle-label" for="lastmessage"><?php esc_html_e( 'Send last broadcast campaign',
|
142 |
<?php if ( ! empty( $vars['lastmessage_error'] ) ) : ?>
|
143 |
<span class="sui-error-message"><?php echo esc_html( $vars['lastmessage_error'] ); ?></span>
|
144 |
<?php endif; ?>
|
@@ -147,7 +147,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
147 |
esc_html_e(
|
148 |
'When the send last broadcast campaign option is enabled, ActiveCampaign will send the last campaign sent out to the list to the contact being added.
|
149 |
This option is not available to users on a free trial.',
|
150 |
-
|
151 |
);
|
152 |
?>
|
153 |
</span>
|
21 |
?>
|
22 |
<div class="integration-header">
|
23 |
|
24 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
25 |
|
26 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for ActiveCampaign integration.', 'forminator' ); ?></span>
|
27 |
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
35 |
|
36 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['tags_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
37 |
|
38 |
+
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags', 'forminator' ); ?></label>
|
39 |
|
40 |
<select name="tags[]"
|
41 |
multiple="multiple"
|
71 |
<?php endif; ?>
|
72 |
|
73 |
<span class="sui-description">
|
74 |
+
<?php esc_html_e( 'Tags for contact that sent to ActiveCampaign.', 'forminator' ); ?>
|
75 |
</span>
|
76 |
|
77 |
</div>
|
78 |
|
79 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['double_opt_form_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
80 |
+
<label class="sui-label" for="double_opt_form_id"><?php esc_html_e( 'Double Opt-In Form', 'forminator' ); ?></label>
|
81 |
<select name="double_opt_form_id" id="double_opt_form_id" class="sui-select sui-form-control">
|
82 |
+
<option value=""><?php esc_html_e( 'No form selected', 'forminator' ); ?></option>
|
83 |
<?php foreach ( $vars['forms'] as $form_id => $form_name ) : ?>
|
84 |
<option value="<?php echo esc_attr( $form_id ); ?>" <?php selected( $form_id, $vars['double_opt_form_id'] ); ?>><?php echo esc_html( $form_name ); ?></option>
|
85 |
<?php endforeach; ?>
|
91 |
<?php
|
92 |
esc_html_e(
|
93 |
'Select which ActiveCampaign form will be used when adding to ActiveCampaign to send the opt-in email. You can read more information ',
|
94 |
+
'forminator'
|
95 |
);
|
96 |
?>
|
97 |
<a href="https://help.activecampaign.com/hc/en-us/articles/115000839230-How-do-I-enable-double-opt-in-confirmation-" target="_blank">here</a>.
|
111 |
<?php checked( 1, $vars['instantresponders'] ); ?>>
|
112 |
<span class="sui-toggle-slider"></span>
|
113 |
</label>
|
114 |
+
<label class="sui-toggle-label" for="instantresponders"><?php esc_html_e( 'Enable Instant Responders', 'forminator' ); ?></label>
|
115 |
<?php if ( ! empty( $vars['instantresponders_error'] ) ) : ?>
|
116 |
<span class="sui-error-message"><?php echo esc_html( $vars['instantresponders_error'] ); ?></span>
|
117 |
<?php endif; ?>
|
120 |
esc_html_e(
|
121 |
'When the instant responders option is enabled, ActiveCampaign will send any instant responders setup when the contact is added to the list.
|
122 |
This option is not available to users on a free trial.',
|
123 |
+
'forminator'
|
124 |
);
|
125 |
?>
|
126 |
</span>
|
138 |
<?php checked( 1, $vars['lastmessage'] ); ?>>
|
139 |
<span class="sui-toggle-slider"></span>
|
140 |
</label>
|
141 |
+
<label class="sui-toggle-label" for="lastmessage"><?php esc_html_e( 'Send last broadcast campaign', 'forminator' ); ?></label>
|
142 |
<?php if ( ! empty( $vars['lastmessage_error'] ) ) : ?>
|
143 |
<span class="sui-error-message"><?php echo esc_html( $vars['lastmessage_error'] ); ?></span>
|
144 |
<?php endif; ?>
|
147 |
esc_html_e(
|
148 |
'When the send last broadcast campaign option is enabled, ActiveCampaign will send the last campaign sent out to the list to the contact being added.
|
149 |
This option is not available to users on a free trial.',
|
150 |
+
'forminator'
|
151 |
);
|
152 |
?>
|
153 |
</span>
|
addons/pro/activecampaign/views/settings/setup-api-success.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: %s: Addon name */
|
5 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
6 |
?>
|
7 |
</h3>
|
8 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
9 |
</div>
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: %s: Addon name */
|
5 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'ActiveCampaign' ) );
|
6 |
?>
|
7 |
</h3>
|
8 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></span>
|
9 |
</div>
|
addons/pro/activecampaign/views/settings/setup-api.php
CHANGED
@@ -18,11 +18,11 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
<h3 class="sui-box-title" id="dialogTitle2">
|
19 |
<?php
|
20 |
/* translators: %s: Addon name */
|
21 |
-
echo esc_html( sprintf( __( 'Configure %1$s API',
|
22 |
?>
|
23 |
</h3>
|
24 |
|
25 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup ActiveCampaign API Access.',
|
26 |
|
27 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
28 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -34,12 +34,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_url_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
-
<label class="sui-label"><?php esc_html_e( 'API URL',
|
38 |
|
39 |
<div class="sui-control-with-icon">
|
40 |
|
41 |
<input name="api_url"
|
42 |
-
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API URL',
|
43 |
value="<?php echo esc_attr( $vars['api_url'] ); ?>"
|
44 |
class="sui-form-control" />
|
45 |
|
@@ -55,12 +55,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
55 |
|
56 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_key_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
57 |
|
58 |
-
<label class="sui-label"><?php esc_html_e( 'API Key',
|
59 |
|
60 |
<div class="sui-control-with-icon">
|
61 |
|
62 |
<input name="api_key"
|
63 |
-
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API Key',
|
64 |
value="<?php echo esc_attr( $vars['api_key'] ); ?>"
|
65 |
class="sui-form-control" />
|
66 |
|
18 |
<h3 class="sui-box-title" id="dialogTitle2">
|
19 |
<?php
|
20 |
/* translators: %s: Addon name */
|
21 |
+
echo esc_html( sprintf( __( 'Configure %1$s API', 'forminator' ), 'ActiveCampaign' ) );
|
22 |
?>
|
23 |
</h3>
|
24 |
|
25 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup ActiveCampaign API Access.', 'forminator' ); ?></span>
|
26 |
|
27 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
28 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_url_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
+
<label class="sui-label"><?php esc_html_e( 'API URL', 'forminator' ); ?></label>
|
38 |
|
39 |
<div class="sui-control-with-icon">
|
40 |
|
41 |
<input name="api_url"
|
42 |
+
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API URL', 'forminator' ), 'ActiveCampaign' ) ); ?>"
|
43 |
value="<?php echo esc_attr( $vars['api_url'] ); ?>"
|
44 |
class="sui-form-control" />
|
45 |
|
55 |
|
56 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_key_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
57 |
|
58 |
+
<label class="sui-label"><?php esc_html_e( 'API Key', 'forminator' ); ?></label>
|
59 |
|
60 |
<div class="sui-control-with-icon">
|
61 |
|
62 |
<input name="api_key"
|
63 |
+
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API Key', 'forminator' ), 'ActiveCampaign' ) ); ?>"
|
64 |
value="<?php echo esc_attr( $vars['api_key'] ); ?>"
|
65 |
class="sui-form-control" />
|
66 |
|
addons/pro/aweber/class-forminator-addon-aweber-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'AWeber failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -148,7 +148,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
148 |
$args = array();
|
149 |
|
150 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
151 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'List ID not properly setup.',
|
152 |
}
|
153 |
|
154 |
$list_id = $connection_settings['list_id'];
|
@@ -159,7 +159,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
159 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
160 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
161 |
throw new Forminator_Addon_Aweber_Exception(/* translators: ... */
|
162 |
-
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.',
|
163 |
);
|
164 |
}
|
165 |
$email = $submitted_data[ $email_element_id ];
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
207 |
// https://labs.aweber.com/docs/reference/1.0#subscriber_entry
|
208 |
// you can not modify or delete Subscribers with a status of 'unconfirmed'.
|
209 |
if ( isset( $existing_subscriber->status ) && 'unconfirmed' === $existing_subscriber->status ) {
|
210 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Unconfirmed subscriber can\'t be modified.',
|
211 |
}
|
212 |
}
|
213 |
}
|
@@ -486,7 +486,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
486 |
return array(
|
487 |
'is_sent' => true,
|
488 |
'connection_name' => $connection_settings['name'],
|
489 |
-
'description' => __( 'Successfully send data to AWeber',
|
490 |
'data_sent' => $api->get_last_data_sent(),
|
491 |
'data_received' => $api->get_last_data_received(),
|
492 |
'url_request' => $api->get_last_url_request(),
|
@@ -591,29 +591,29 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
591 |
}
|
592 |
$status = $addon_meta_data['value'];
|
593 |
$additional_entry_item = array(
|
594 |
-
'label' => __( 'AWeber Integration',
|
595 |
'value' => '',
|
596 |
);
|
597 |
|
598 |
$sub_entries = array();
|
599 |
if ( isset( $status['connection_name'] ) ) {
|
600 |
$sub_entries[] = array(
|
601 |
-
'label' => __( 'Integration Name',
|
602 |
'value' => $status['connection_name'],
|
603 |
);
|
604 |
}
|
605 |
|
606 |
if ( isset( $status['is_sent'] ) ) {
|
607 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
608 |
$sub_entries[] = array(
|
609 |
-
'label' => __( 'Sent To AWeber',
|
610 |
'value' => $is_sent,
|
611 |
);
|
612 |
}
|
613 |
|
614 |
if ( isset( $status['description'] ) ) {
|
615 |
$sub_entries[] = array(
|
616 |
-
'label' => __( 'Info',
|
617 |
'value' => $status['description'],
|
618 |
);
|
619 |
}
|
@@ -622,21 +622,21 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
622 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_AWEBER_SHOW_FULL_LOG', true)`
|
623 |
if ( isset( $status['url_request'] ) ) {
|
624 |
$sub_entries[] = array(
|
625 |
-
'label' => __( 'API URL',
|
626 |
'value' => $status['url_request'],
|
627 |
);
|
628 |
}
|
629 |
|
630 |
if ( isset( $status['data_sent'] ) ) {
|
631 |
$sub_entries[] = array(
|
632 |
-
'label' => __( 'Data sent to AWeber',
|
633 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
634 |
);
|
635 |
}
|
636 |
|
637 |
if ( isset( $status['data_received'] ) ) {
|
638 |
$sub_entries[] = array(
|
639 |
-
'label' => __( 'Data received from AWeber',
|
640 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
641 |
);
|
642 |
}
|
@@ -658,7 +658,7 @@ class Forminator_Addon_Aweber_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
658 |
public function on_export_render_title_row() {
|
659 |
|
660 |
$export_headers = array(
|
661 |
-
'info' => __( 'AWeber Info',
|
662 |
);
|
663 |
|
664 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'AWeber failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
148 |
$args = array();
|
149 |
|
150 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
151 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
152 |
}
|
153 |
|
154 |
$list_id = $connection_settings['list_id'];
|
159 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
160 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
161 |
throw new Forminator_Addon_Aweber_Exception(/* translators: ... */
|
162 |
+
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.', 'forminator' ), $email_element_id )
|
163 |
);
|
164 |
}
|
165 |
$email = $submitted_data[ $email_element_id ];
|
207 |
// https://labs.aweber.com/docs/reference/1.0#subscriber_entry
|
208 |
// you can not modify or delete Subscribers with a status of 'unconfirmed'.
|
209 |
if ( isset( $existing_subscriber->status ) && 'unconfirmed' === $existing_subscriber->status ) {
|
210 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Unconfirmed subscriber can\'t be modified.', 'forminator' ) );
|
211 |
}
|
212 |
}
|
213 |
}
|
486 |
return array(
|
487 |
'is_sent' => true,
|
488 |
'connection_name' => $connection_settings['name'],
|
489 |
+
'description' => __( 'Successfully send data to AWeber', 'forminator' ),
|
490 |
'data_sent' => $api->get_last_data_sent(),
|
491 |
'data_received' => $api->get_last_data_received(),
|
492 |
'url_request' => $api->get_last_url_request(),
|
591 |
}
|
592 |
$status = $addon_meta_data['value'];
|
593 |
$additional_entry_item = array(
|
594 |
+
'label' => __( 'AWeber Integration', 'forminator' ),
|
595 |
'value' => '',
|
596 |
);
|
597 |
|
598 |
$sub_entries = array();
|
599 |
if ( isset( $status['connection_name'] ) ) {
|
600 |
$sub_entries[] = array(
|
601 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
602 |
'value' => $status['connection_name'],
|
603 |
);
|
604 |
}
|
605 |
|
606 |
if ( isset( $status['is_sent'] ) ) {
|
607 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
608 |
$sub_entries[] = array(
|
609 |
+
'label' => __( 'Sent To AWeber', 'forminator' ),
|
610 |
'value' => $is_sent,
|
611 |
);
|
612 |
}
|
613 |
|
614 |
if ( isset( $status['description'] ) ) {
|
615 |
$sub_entries[] = array(
|
616 |
+
'label' => __( 'Info', 'forminator' ),
|
617 |
'value' => $status['description'],
|
618 |
);
|
619 |
}
|
622 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_AWEBER_SHOW_FULL_LOG', true)`
|
623 |
if ( isset( $status['url_request'] ) ) {
|
624 |
$sub_entries[] = array(
|
625 |
+
'label' => __( 'API URL', 'forminator' ),
|
626 |
'value' => $status['url_request'],
|
627 |
);
|
628 |
}
|
629 |
|
630 |
if ( isset( $status['data_sent'] ) ) {
|
631 |
$sub_entries[] = array(
|
632 |
+
'label' => __( 'Data sent to AWeber', 'forminator' ),
|
633 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
634 |
);
|
635 |
}
|
636 |
|
637 |
if ( isset( $status['data_received'] ) ) {
|
638 |
$sub_entries[] = array(
|
639 |
+
'label' => __( 'Data received from AWeber', 'forminator' ),
|
640 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
641 |
);
|
642 |
}
|
658 |
public function on_export_render_title_row() {
|
659 |
|
660 |
$export_headers = array(
|
661 |
+
'info' => __( 'AWeber Info', 'forminator' ),
|
662 |
);
|
663 |
|
664 |
$form_id = $this->form_id;
|
addons/pro/aweber/class-forminator-addon-aweber-form-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,14 +118,14 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
-
esc_html__( 'Deactivate',
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
-
esc_html__( 'Deactivate this AWeber Integration from this Form.',
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
@@ -177,7 +177,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
177 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
@@ -202,7 +202,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
202 |
$lists_request = $api->get_account_lists( $this->addon->get_account_id() );
|
203 |
|
204 |
if ( ! is_object( $lists_request ) || ! isset( $lists_request->entries ) || ! is_array( $lists_request->entries ) || empty( $lists_request->entries ) ) {
|
205 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'No lists found on your AWeber. Please create one.',
|
206 |
}
|
207 |
|
208 |
foreach ( $lists_request->entries as $entry ) {
|
@@ -250,14 +250,14 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
250 |
$buttons = array();
|
251 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
-
esc_html__( 'Deactivate',
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
-
esc_html__( 'Deactivate this AWeber Integration from this Form.',
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
@@ -310,7 +310,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
310 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/map-fields.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
@@ -340,8 +340,8 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
340 |
$has_errors = false;
|
341 |
|
342 |
$fields = array(
|
343 |
-
'default_field_email' => __( 'Email Address',
|
344 |
-
'default_field_name' => __( 'Name',
|
345 |
);
|
346 |
|
347 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
@@ -352,7 +352,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
352 |
$list_custom_fields_request = $api->get_account_list_custom_fields( $this->addon->get_account_id(), $list_id );
|
353 |
|
354 |
if ( ! is_object( $list_custom_fields_request ) || ! isset( $list_custom_fields_request->entries ) || ! is_array( $list_custom_fields_request->entries ) ) {
|
355 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get Custom Fields on the list.',
|
356 |
}
|
357 |
|
358 |
foreach ( $list_custom_fields_request->entries as $entry ) {
|
@@ -372,7 +372,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
372 |
|
373 |
try {
|
374 |
if ( empty( $fields_map ) ) {
|
375 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Please assign fields.',
|
376 |
}
|
377 |
|
378 |
$input_exceptions = new Forminator_Addon_Aweber_Form_Settings_Exception();
|
@@ -386,7 +386,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
386 |
$element_id = $fields_map[ $key ];
|
387 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
388 |
$input_exceptions->add_input_exception(/* translators: ... */
|
389 |
-
sprintf( __( 'Please assign valid field for %s',
|
390 |
$key . '_error'
|
391 |
);
|
392 |
continue;
|
@@ -420,14 +420,14 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
420 |
$buttons = array();
|
421 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
422 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
423 |
-
esc_html__( 'Deactivate',
|
424 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
425 |
-
esc_html__( 'Deactivate this AWeber Integration from this Form.',
|
426 |
);
|
427 |
}
|
428 |
|
429 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
430 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
431 |
'</div>';
|
432 |
|
433 |
return array(
|
@@ -494,7 +494,7 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
494 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/setup-options.php';
|
495 |
|
496 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
497 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
498 |
}
|
499 |
|
500 |
$multi_id = $submitted_data['multi_id'];
|
@@ -587,14 +587,14 @@ class Forminator_Addon_Aweber_Form_Settings extends Forminator_Addon_Form_Settin
|
|
587 |
$buttons = array();
|
588 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
589 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
590 |
-
esc_html__( 'Deactivate',
|
591 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
592 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.',
|
593 |
);
|
594 |
}
|
595 |
|
596 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
597 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
598 |
'</div>';
|
599 |
|
600 |
return array(
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
+
esc_html__( 'Deactivate this AWeber Integration from this Form.', 'forminator' )
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
177 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
202 |
$lists_request = $api->get_account_lists( $this->addon->get_account_id() );
|
203 |
|
204 |
if ( ! is_object( $lists_request ) || ! isset( $lists_request->entries ) || ! is_array( $lists_request->entries ) || empty( $lists_request->entries ) ) {
|
205 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'No lists found on your AWeber. Please create one.', 'forminator' ) );
|
206 |
}
|
207 |
|
208 |
foreach ( $lists_request->entries as $entry ) {
|
250 |
$buttons = array();
|
251 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
+
esc_html__( 'Deactivate this AWeber Integration from this Form.', 'forminator' )
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
310 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/map-fields.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
340 |
$has_errors = false;
|
341 |
|
342 |
$fields = array(
|
343 |
+
'default_field_email' => __( 'Email Address', 'forminator' ),
|
344 |
+
'default_field_name' => __( 'Name', 'forminator' ),
|
345 |
);
|
346 |
|
347 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
352 |
$list_custom_fields_request = $api->get_account_list_custom_fields( $this->addon->get_account_id(), $list_id );
|
353 |
|
354 |
if ( ! is_object( $list_custom_fields_request ) || ! isset( $list_custom_fields_request->entries ) || ! is_array( $list_custom_fields_request->entries ) ) {
|
355 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get Custom Fields on the list.', 'forminator' ) );
|
356 |
}
|
357 |
|
358 |
foreach ( $list_custom_fields_request->entries as $entry ) {
|
372 |
|
373 |
try {
|
374 |
if ( empty( $fields_map ) ) {
|
375 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Please assign fields.', 'forminator' ) );
|
376 |
}
|
377 |
|
378 |
$input_exceptions = new Forminator_Addon_Aweber_Form_Settings_Exception();
|
386 |
$element_id = $fields_map[ $key ];
|
387 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
388 |
$input_exceptions->add_input_exception(/* translators: ... */
|
389 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
390 |
$key . '_error'
|
391 |
);
|
392 |
continue;
|
420 |
$buttons = array();
|
421 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
422 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
423 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
424 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
425 |
+
esc_html__( 'Deactivate this AWeber Integration from this Form.', 'forminator' )
|
426 |
);
|
427 |
}
|
428 |
|
429 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
430 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
431 |
'</div>';
|
432 |
|
433 |
return array(
|
494 |
$template = forminator_addon_aweber_dir() . 'views/form-settings/setup-options.php';
|
495 |
|
496 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
497 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
498 |
}
|
499 |
|
500 |
$multi_id = $submitted_data['multi_id'];
|
587 |
$buttons = array();
|
588 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
589 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
590 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
591 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
592 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.', 'forminator' )
|
593 |
);
|
594 |
}
|
595 |
|
596 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
597 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
598 |
'</div>';
|
599 |
|
600 |
return array(
|
addons/pro/aweber/class-forminator-addon-aweber-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'AWeber failed to process submitted data. Please check your quiz and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -157,7 +157,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
157 |
$args = array();
|
158 |
|
159 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
160 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'List ID not properly setup.',
|
161 |
}
|
162 |
|
163 |
$list_id = $connection_settings['list_id'];
|
@@ -168,7 +168,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
168 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
169 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
170 |
throw new Forminator_Addon_Aweber_Exception(/* translators: ... */
|
171 |
-
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.',
|
172 |
);
|
173 |
}
|
174 |
$email = $submitted_data[ $email_element_id ];
|
@@ -216,7 +216,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
216 |
// https://labs.aweber.com/docs/reference/1.0#subscriber_entry
|
217 |
// you can not modify or delete Subscribers with a status of 'unconfirmed'.
|
218 |
if ( isset( $existing_subscriber->status ) && 'unconfirmed' === $existing_subscriber->status ) {
|
219 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Unconfirmed subscriber can\'t be modified.',
|
220 |
}
|
221 |
}
|
222 |
}
|
@@ -480,7 +480,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
480 |
return array(
|
481 |
'is_sent' => true,
|
482 |
'connection_name' => $connection_settings['name'],
|
483 |
-
'description' => __( 'Successfully send data to AWeber',
|
484 |
'data_sent' => $api->get_last_data_sent(),
|
485 |
'data_received' => $api->get_last_data_received(),
|
486 |
'url_request' => $api->get_last_url_request(),
|
@@ -585,29 +585,29 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
585 |
}
|
586 |
$status = $addon_meta_data['value'];
|
587 |
$additional_entry_item = array(
|
588 |
-
'label' => __( 'AWeber Integration',
|
589 |
'value' => '',
|
590 |
);
|
591 |
|
592 |
$sub_entries = array();
|
593 |
if ( isset( $status['connection_name'] ) ) {
|
594 |
$sub_entries[] = array(
|
595 |
-
'label' => __( 'Integration Name',
|
596 |
'value' => $status['connection_name'],
|
597 |
);
|
598 |
}
|
599 |
|
600 |
if ( isset( $status['is_sent'] ) ) {
|
601 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
602 |
$sub_entries[] = array(
|
603 |
-
'label' => __( 'Sent To AWeber',
|
604 |
'value' => $is_sent,
|
605 |
);
|
606 |
}
|
607 |
|
608 |
if ( isset( $status['description'] ) ) {
|
609 |
$sub_entries[] = array(
|
610 |
-
'label' => __( 'Info',
|
611 |
'value' => $status['description'],
|
612 |
);
|
613 |
}
|
@@ -616,21 +616,21 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
616 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_AWEBER_SHOW_FULL_LOG', true)`
|
617 |
if ( isset( $status['url_request'] ) ) {
|
618 |
$sub_entries[] = array(
|
619 |
-
'label' => __( 'API URL',
|
620 |
'value' => $status['url_request'],
|
621 |
);
|
622 |
}
|
623 |
|
624 |
if ( isset( $status['data_sent'] ) ) {
|
625 |
$sub_entries[] = array(
|
626 |
-
'label' => __( 'Data sent to AWeber',
|
627 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
628 |
);
|
629 |
}
|
630 |
|
631 |
if ( isset( $status['data_received'] ) ) {
|
632 |
$sub_entries[] = array(
|
633 |
-
'label' => __( 'Data received from AWeber',
|
634 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
635 |
);
|
636 |
}
|
@@ -652,7 +652,7 @@ class Forminator_Addon_Aweber_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
652 |
public function on_export_render_title_row() {
|
653 |
|
654 |
$export_headers = array(
|
655 |
-
'info' => __( 'AWeber Info',
|
656 |
);
|
657 |
|
658 |
$quiz_id = $this->quiz_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'AWeber failed to process submitted data. Please check your quiz and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
157 |
$args = array();
|
158 |
|
159 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
160 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
161 |
}
|
162 |
|
163 |
$list_id = $connection_settings['list_id'];
|
168 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
169 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
170 |
throw new Forminator_Addon_Aweber_Exception(/* translators: ... */
|
171 |
+
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.', 'forminator' ), $email_element_id )
|
172 |
);
|
173 |
}
|
174 |
$email = $submitted_data[ $email_element_id ];
|
216 |
// https://labs.aweber.com/docs/reference/1.0#subscriber_entry
|
217 |
// you can not modify or delete Subscribers with a status of 'unconfirmed'.
|
218 |
if ( isset( $existing_subscriber->status ) && 'unconfirmed' === $existing_subscriber->status ) {
|
219 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Unconfirmed subscriber can\'t be modified.', 'forminator' ) );
|
220 |
}
|
221 |
}
|
222 |
}
|
480 |
return array(
|
481 |
'is_sent' => true,
|
482 |
'connection_name' => $connection_settings['name'],
|
483 |
+
'description' => __( 'Successfully send data to AWeber', 'forminator' ),
|
484 |
'data_sent' => $api->get_last_data_sent(),
|
485 |
'data_received' => $api->get_last_data_received(),
|
486 |
'url_request' => $api->get_last_url_request(),
|
585 |
}
|
586 |
$status = $addon_meta_data['value'];
|
587 |
$additional_entry_item = array(
|
588 |
+
'label' => __( 'AWeber Integration', 'forminator' ),
|
589 |
'value' => '',
|
590 |
);
|
591 |
|
592 |
$sub_entries = array();
|
593 |
if ( isset( $status['connection_name'] ) ) {
|
594 |
$sub_entries[] = array(
|
595 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
596 |
'value' => $status['connection_name'],
|
597 |
);
|
598 |
}
|
599 |
|
600 |
if ( isset( $status['is_sent'] ) ) {
|
601 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
602 |
$sub_entries[] = array(
|
603 |
+
'label' => __( 'Sent To AWeber', 'forminator' ),
|
604 |
'value' => $is_sent,
|
605 |
);
|
606 |
}
|
607 |
|
608 |
if ( isset( $status['description'] ) ) {
|
609 |
$sub_entries[] = array(
|
610 |
+
'label' => __( 'Info', 'forminator' ),
|
611 |
'value' => $status['description'],
|
612 |
);
|
613 |
}
|
616 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_AWEBER_SHOW_FULL_LOG', true)`
|
617 |
if ( isset( $status['url_request'] ) ) {
|
618 |
$sub_entries[] = array(
|
619 |
+
'label' => __( 'API URL', 'forminator' ),
|
620 |
'value' => $status['url_request'],
|
621 |
);
|
622 |
}
|
623 |
|
624 |
if ( isset( $status['data_sent'] ) ) {
|
625 |
$sub_entries[] = array(
|
626 |
+
'label' => __( 'Data sent to AWeber', 'forminator' ),
|
627 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
628 |
);
|
629 |
}
|
630 |
|
631 |
if ( isset( $status['data_received'] ) ) {
|
632 |
$sub_entries[] = array(
|
633 |
+
'label' => __( 'Data received from AWeber', 'forminator' ),
|
634 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
635 |
);
|
636 |
}
|
652 |
public function on_export_render_title_row() {
|
653 |
|
654 |
$export_headers = array(
|
655 |
+
'info' => __( 'AWeber Info', 'forminator' ),
|
656 |
);
|
657 |
|
658 |
$quiz_id = $this->quiz_id;
|
addons/pro/aweber/class-forminator-addon-aweber-quiz-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,14 +118,14 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
-
esc_html__( 'Deactivate',
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
-
esc_html__( 'Deactivate this AWeber Integration from this Quiz.',
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
@@ -177,7 +177,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
177 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
@@ -202,7 +202,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
202 |
$lists_request = $api->get_account_lists( $this->addon->get_account_id() );
|
203 |
|
204 |
if ( ! is_object( $lists_request ) || ! isset( $lists_request->entries ) || ! is_array( $lists_request->entries ) || empty( $lists_request->entries ) ) {
|
205 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'No lists found on your AWeber. Please create one.',
|
206 |
}
|
207 |
|
208 |
foreach ( $lists_request->entries as $entry ) {
|
@@ -250,14 +250,14 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
250 |
$buttons = array();
|
251 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
-
esc_html__( 'Deactivate',
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
-
esc_html__( 'Deactivate this AWeber Integration from this Quiz.',
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
@@ -310,7 +310,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
310 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/map-fields.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
@@ -330,7 +330,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
330 |
|
331 |
$quiz_questions = $this->get_quiz_fields();
|
332 |
$quiz_fields = array(
|
333 |
-
'quiz-name' => __( 'Quiz Name',
|
334 |
);
|
335 |
foreach ( $quiz_questions as $quiz_question ) {
|
336 |
// collect element ids
|
@@ -338,11 +338,11 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
338 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
339 |
}
|
340 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
341 |
-
$quiz_fields['correct-answers'] = __( 'Correct Answers',
|
342 |
-
$quiz_fields['total-answers'] = __( 'Total Answers',
|
343 |
array_push( $forminator_quiz_element_ids,'quiz-name','correct-answers', 'total-answers' );
|
344 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
345 |
-
$quiz_fields['result-answers'] = __( 'Result Answer',
|
346 |
array_push( $forminator_quiz_element_ids,'quiz-name', 'result-answers' );
|
347 |
}
|
348 |
|
@@ -362,8 +362,8 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
362 |
$has_errors = false;
|
363 |
|
364 |
$fields = array(
|
365 |
-
'default_field_email' => __( 'Email Address',
|
366 |
-
'default_field_name' => __( 'Name',
|
367 |
);
|
368 |
|
369 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
@@ -374,7 +374,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
374 |
$list_custom_fields_request = $api->get_account_list_custom_fields( $this->addon->get_account_id(), $list_id );
|
375 |
|
376 |
if ( ! is_object( $list_custom_fields_request ) || ! isset( $list_custom_fields_request->entries ) || ! is_array( $list_custom_fields_request->entries ) ) {
|
377 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get Custom Fields on the list.',
|
378 |
}
|
379 |
|
380 |
foreach ( $list_custom_fields_request->entries as $entry ) {
|
@@ -394,7 +394,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
394 |
|
395 |
try {
|
396 |
if ( empty( $fields_map ) ) {
|
397 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Please assign fields.',
|
398 |
}
|
399 |
|
400 |
$input_exceptions = new Forminator_Addon_Aweber_Quiz_Settings_Exception();
|
@@ -408,7 +408,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
408 |
$element_id = $fields_map[ $key ];
|
409 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
410 |
$input_exceptions->add_input_exception(/* translators: ... */
|
411 |
-
sprintf( __( 'Please assign valid field for %s',
|
412 |
$key . '_error'
|
413 |
);
|
414 |
continue;
|
@@ -442,14 +442,14 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
442 |
$buttons = array();
|
443 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
444 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
445 |
-
esc_html__( 'Deactivate',
|
446 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
447 |
-
esc_html__( 'Deactivate this AWeber Integration from this Quiz.',
|
448 |
);
|
449 |
}
|
450 |
|
451 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
452 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
453 |
'</div>';
|
454 |
|
455 |
return array(
|
@@ -516,7 +516,7 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
516 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/setup-options.php';
|
517 |
|
518 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
519 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
520 |
}
|
521 |
|
522 |
$multi_id = $submitted_data['multi_id'];
|
@@ -609,14 +609,14 @@ class Forminator_Addon_Aweber_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
609 |
$buttons = array();
|
610 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
611 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
612 |
-
esc_html__( 'Deactivate',
|
613 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
614 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.',
|
615 |
);
|
616 |
}
|
617 |
|
618 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
619 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
620 |
'</div>';
|
621 |
|
622 |
return array(
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
+
esc_html__( 'Deactivate this AWeber Integration from this Quiz.', 'forminator' )
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
177 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
202 |
$lists_request = $api->get_account_lists( $this->addon->get_account_id() );
|
203 |
|
204 |
if ( ! is_object( $lists_request ) || ! isset( $lists_request->entries ) || ! is_array( $lists_request->entries ) || empty( $lists_request->entries ) ) {
|
205 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'No lists found on your AWeber. Please create one.', 'forminator' ) );
|
206 |
}
|
207 |
|
208 |
foreach ( $lists_request->entries as $entry ) {
|
250 |
$buttons = array();
|
251 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
+
esc_html__( 'Deactivate this AWeber Integration from this Quiz.', 'forminator' )
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
310 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/map-fields.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
330 |
|
331 |
$quiz_questions = $this->get_quiz_fields();
|
332 |
$quiz_fields = array(
|
333 |
+
'quiz-name' => __( 'Quiz Name', 'forminator' ),
|
334 |
);
|
335 |
foreach ( $quiz_questions as $quiz_question ) {
|
336 |
// collect element ids
|
338 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
339 |
}
|
340 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
341 |
+
$quiz_fields['correct-answers'] = __( 'Correct Answers', 'forminator' );
|
342 |
+
$quiz_fields['total-answers'] = __( 'Total Answers', 'forminator' );
|
343 |
array_push( $forminator_quiz_element_ids,'quiz-name','correct-answers', 'total-answers' );
|
344 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
345 |
+
$quiz_fields['result-answers'] = __( 'Result Answer', 'forminator' );
|
346 |
array_push( $forminator_quiz_element_ids,'quiz-name', 'result-answers' );
|
347 |
}
|
348 |
|
362 |
$has_errors = false;
|
363 |
|
364 |
$fields = array(
|
365 |
+
'default_field_email' => __( 'Email Address', 'forminator' ),
|
366 |
+
'default_field_name' => __( 'Name', 'forminator' ),
|
367 |
);
|
368 |
|
369 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
374 |
$list_custom_fields_request = $api->get_account_list_custom_fields( $this->addon->get_account_id(), $list_id );
|
375 |
|
376 |
if ( ! is_object( $list_custom_fields_request ) || ! isset( $list_custom_fields_request->entries ) || ! is_array( $list_custom_fields_request->entries ) ) {
|
377 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get Custom Fields on the list.', 'forminator' ) );
|
378 |
}
|
379 |
|
380 |
foreach ( $list_custom_fields_request->entries as $entry ) {
|
394 |
|
395 |
try {
|
396 |
if ( empty( $fields_map ) ) {
|
397 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Please assign fields.', 'forminator' ) );
|
398 |
}
|
399 |
|
400 |
$input_exceptions = new Forminator_Addon_Aweber_Quiz_Settings_Exception();
|
408 |
$element_id = $fields_map[ $key ];
|
409 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
410 |
$input_exceptions->add_input_exception(/* translators: ... */
|
411 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
412 |
$key . '_error'
|
413 |
);
|
414 |
continue;
|
442 |
$buttons = array();
|
443 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
444 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
445 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
446 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
447 |
+
esc_html__( 'Deactivate this AWeber Integration from this Quiz.', 'forminator' )
|
448 |
);
|
449 |
}
|
450 |
|
451 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
452 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
453 |
'</div>';
|
454 |
|
455 |
return array(
|
516 |
$template = forminator_addon_aweber_dir() . 'views/quiz-settings/setup-options.php';
|
517 |
|
518 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
519 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
520 |
}
|
521 |
|
522 |
$multi_id = $submitted_data['multi_id'];
|
609 |
$buttons = array();
|
610 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
611 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
612 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
613 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
614 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.', 'forminator' )
|
615 |
);
|
616 |
}
|
617 |
|
618 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
619 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
620 |
'</div>';
|
621 |
|
622 |
return array(
|
addons/pro/aweber/class-forminator-addon-aweber.php
CHANGED
@@ -54,13 +54,13 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
54 |
*/
|
55 |
public function __construct() {
|
56 |
// late init to allow translation
|
57 |
-
$this->_description = __( 'Get awesome by your form.',
|
58 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate AWeber Integration, don\'t hesitate to contact us',
|
59 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate AWeber Integration, please try again',
|
60 |
|
61 |
$this->_update_settings_error_message = __(
|
62 |
'Sorry, we failed to update settings, please check your form and try again',
|
63 |
-
|
64 |
);
|
65 |
|
66 |
$this->_icon = forminator_addon_aweber_assets_url() . 'icons/aweber.png';
|
@@ -94,7 +94,7 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
94 |
try {
|
95 |
// check if its active
|
96 |
if ( ! $this->is_active() ) {
|
97 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'AWeber is not active',
|
98 |
}
|
99 |
|
100 |
// if user completed api setup
|
@@ -133,17 +133,17 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
133 |
try {
|
134 |
$form_settings_instance = null;
|
135 |
if ( ! $this->is_connected() ) {
|
136 |
-
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected',
|
137 |
}
|
138 |
|
139 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
140 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Aweber_Form_Settings ) {
|
141 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Form Settings of AWeber',
|
142 |
}
|
143 |
|
144 |
// Mark as active when there is at least one active connection
|
145 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
146 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'No active AWeber connection found in this form',
|
147 |
}
|
148 |
|
149 |
$is_form_connected = true;
|
@@ -352,7 +352,7 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
352 |
//https://labs.aweber.com/docs/authentication#distributed-app
|
353 |
//the authorization code is an application key, application secret, request token, token secret, and oauth_verifier, delimited by pipes (|).
|
354 |
if ( ! is_array( $split_codes ) || 5 !== count( $split_codes ) ) {
|
355 |
-
new Forminator_Addon_Aweber_Exception( __( 'Invalid Authorization Code',
|
356 |
}
|
357 |
|
358 |
$application_key = $split_codes[0];
|
@@ -546,12 +546,12 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
546 |
|
547 |
$accounts = $api->get_accounts();
|
548 |
if ( ! isset( $accounts->entries ) ) {
|
549 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get AWeber account information',
|
550 |
}
|
551 |
|
552 |
$entries = $accounts->entries;
|
553 |
if ( ! isset( $entries[0] ) ) {
|
554 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get AWeber account information',
|
555 |
}
|
556 |
|
557 |
$first_entry = $entries[0];
|
@@ -638,17 +638,17 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
638 |
try {
|
639 |
$quiz_settings_instance = null;
|
640 |
if ( ! $this->is_connected() ) {
|
641 |
-
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected',
|
642 |
}
|
643 |
|
644 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
645 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Aweber_Quiz_Settings ) {
|
646 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Quiz Settings of AWeber',
|
647 |
}
|
648 |
|
649 |
// Mark as active when there is at least one active connection
|
650 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
651 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'No active AWeber connection found in this quiz',
|
652 |
}
|
653 |
|
654 |
$is_quiz_connected = true;
|
@@ -688,12 +688,12 @@ final class Forminator_Addon_Aweber extends Forminator_Addon_Abstract {
|
|
688 |
// initialize with null
|
689 |
$quiz_settings_instance = null;
|
690 |
if ( ! $this->is_connected() ) {
|
691 |
-
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected',
|
692 |
}
|
693 |
|
694 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
695 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Aweber_Quiz_Settings ) {
|
696 |
-
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Quiz Settings of AWeber',
|
697 |
}
|
698 |
|
699 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
54 |
*/
|
55 |
public function __construct() {
|
56 |
// late init to allow translation
|
57 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
58 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate AWeber Integration, don\'t hesitate to contact us', 'forminator' );
|
59 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate AWeber Integration, please try again', 'forminator' );
|
60 |
|
61 |
$this->_update_settings_error_message = __(
|
62 |
'Sorry, we failed to update settings, please check your form and try again',
|
63 |
+
'forminator'
|
64 |
);
|
65 |
|
66 |
$this->_icon = forminator_addon_aweber_assets_url() . 'icons/aweber.png';
|
94 |
try {
|
95 |
// check if its active
|
96 |
if ( ! $this->is_active() ) {
|
97 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'AWeber is not active', 'forminator' ) );
|
98 |
}
|
99 |
|
100 |
// if user completed api setup
|
133 |
try {
|
134 |
$form_settings_instance = null;
|
135 |
if ( ! $this->is_connected() ) {
|
136 |
+
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected', 'forminator' ) );
|
137 |
}
|
138 |
|
139 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
140 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Aweber_Form_Settings ) {
|
141 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Form Settings of AWeber', 'forminator' ) );
|
142 |
}
|
143 |
|
144 |
// Mark as active when there is at least one active connection
|
145 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
146 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'No active AWeber connection found in this form', 'forminator' ) );
|
147 |
}
|
148 |
|
149 |
$is_form_connected = true;
|
352 |
//https://labs.aweber.com/docs/authentication#distributed-app
|
353 |
//the authorization code is an application key, application secret, request token, token secret, and oauth_verifier, delimited by pipes (|).
|
354 |
if ( ! is_array( $split_codes ) || 5 !== count( $split_codes ) ) {
|
355 |
+
new Forminator_Addon_Aweber_Exception( __( 'Invalid Authorization Code', 'forminator' ) );
|
356 |
}
|
357 |
|
358 |
$application_key = $split_codes[0];
|
546 |
|
547 |
$accounts = $api->get_accounts();
|
548 |
if ( ! isset( $accounts->entries ) ) {
|
549 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get AWeber account information', 'forminator' ) );
|
550 |
}
|
551 |
|
552 |
$entries = $accounts->entries;
|
553 |
if ( ! isset( $entries[0] ) ) {
|
554 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Failed to get AWeber account information', 'forminator' ) );
|
555 |
}
|
556 |
|
557 |
$first_entry = $entries[0];
|
638 |
try {
|
639 |
$quiz_settings_instance = null;
|
640 |
if ( ! $this->is_connected() ) {
|
641 |
+
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected', 'forminator' ) );
|
642 |
}
|
643 |
|
644 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
645 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Aweber_Quiz_Settings ) {
|
646 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Quiz Settings of AWeber', 'forminator' ) );
|
647 |
}
|
648 |
|
649 |
// Mark as active when there is at least one active connection
|
650 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
651 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'No active AWeber connection found in this quiz', 'forminator' ) );
|
652 |
}
|
653 |
|
654 |
$is_quiz_connected = true;
|
688 |
// initialize with null
|
689 |
$quiz_settings_instance = null;
|
690 |
if ( ! $this->is_connected() ) {
|
691 |
+
throw new Forminator_Addon_Aweber_Exception( __( ' AWeber is not connected', 'forminator' ) );
|
692 |
}
|
693 |
|
694 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
695 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Aweber_Quiz_Settings ) {
|
696 |
+
throw new Forminator_Addon_Aweber_Exception( __( 'Invalid Quiz Settings of AWeber', 'forminator' ) );
|
697 |
}
|
698 |
|
699 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
addons/pro/aweber/lib/class-forminator-addon-aweber-wp-api.php
CHANGED
@@ -66,7 +66,7 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
66 |
public function __construct( $_application_key, $_application_secret, $_oauth_token, $_oauth_token_secret ) {
|
67 |
//prerequisites
|
68 |
if ( ! $_application_key || ! $_application_secret || ! $_oauth_token || ! $_oauth_token_secret ) {
|
69 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Missing required API Credentials',
|
70 |
}
|
71 |
|
72 |
$this->_application_key = $_application_key;
|
@@ -227,7 +227,7 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
227 |
|
228 |
if ( is_wp_error( $res ) || ! $res ) {
|
229 |
throw new Forminator_Addon_Aweber_Wp_Api_Exception(
|
230 |
-
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.',
|
231 |
);
|
232 |
}
|
233 |
|
@@ -249,10 +249,10 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
249 |
|
250 |
if ( 404 === $status_code ) {
|
251 |
/* translators: ... */
|
252 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
253 |
}
|
254 |
/* translators: ... */
|
255 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
256 |
}
|
257 |
}
|
258 |
|
@@ -411,11 +411,11 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
411 |
$access_tokens = $this->request( 'POST', self::$_access_token_url, $args );
|
412 |
|
413 |
if ( ! is_object( $access_tokens ) ) {
|
414 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Invalid access token',
|
415 |
}
|
416 |
|
417 |
if ( ! isset( $access_tokens->oauth_token_secret ) || ! isset( $access_tokens->oauth_token ) ) {
|
418 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Invalid access token',
|
419 |
}
|
420 |
|
421 |
return $access_tokens;
|
@@ -508,7 +508,7 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
508 |
$args = array_merge( $default_args, $args );
|
509 |
|
510 |
if ( empty( $args['email'] ) ) {
|
511 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Email is required on add AWeber subscriber.',
|
512 |
}
|
513 |
|
514 |
return $this->request(
|
@@ -544,7 +544,7 @@ class Forminator_Addon_Aweber_Wp_Api {
|
|
544 |
$args = array_merge( $default_args, $args );
|
545 |
|
546 |
if ( empty( $args['email'] ) ) {
|
547 |
-
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Email is required on update AWeber subscriber.',
|
548 |
}
|
549 |
|
550 |
return $this->request(
|
66 |
public function __construct( $_application_key, $_application_secret, $_oauth_token, $_oauth_token_secret ) {
|
67 |
//prerequisites
|
68 |
if ( ! $_application_key || ! $_application_secret || ! $_oauth_token || ! $_oauth_token_secret ) {
|
69 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Missing required API Credentials', 'forminator' ) );
|
70 |
}
|
71 |
|
72 |
$this->_application_key = $_application_key;
|
227 |
|
228 |
if ( is_wp_error( $res ) || ! $res ) {
|
229 |
throw new Forminator_Addon_Aweber_Wp_Api_Exception(
|
230 |
+
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.', 'forminator' )
|
231 |
);
|
232 |
}
|
233 |
|
249 |
|
250 |
if ( 404 === $status_code ) {
|
251 |
/* translators: ... */
|
252 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
253 |
}
|
254 |
/* translators: ... */
|
255 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
256 |
}
|
257 |
}
|
258 |
|
411 |
$access_tokens = $this->request( 'POST', self::$_access_token_url, $args );
|
412 |
|
413 |
if ( ! is_object( $access_tokens ) ) {
|
414 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Invalid access token', 'forminator' ) );
|
415 |
}
|
416 |
|
417 |
if ( ! isset( $access_tokens->oauth_token_secret ) || ! isset( $access_tokens->oauth_token ) ) {
|
418 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Invalid access token', 'forminator' ) );
|
419 |
}
|
420 |
|
421 |
return $access_tokens;
|
508 |
$args = array_merge( $default_args, $args );
|
509 |
|
510 |
if ( empty( $args['email'] ) ) {
|
511 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Email is required on add AWeber subscriber.', 'forminator' ) );
|
512 |
}
|
513 |
|
514 |
return $this->request(
|
544 |
$args = array_merge( $default_args, $args );
|
545 |
|
546 |
if ( empty( $args['email'] ) ) {
|
547 |
+
throw new Forminator_Addon_Aweber_Wp_Api_Exception( __( 'Email is required on update AWeber subscriber.', 'forminator' ) );
|
548 |
}
|
549 |
|
550 |
return $this->request(
|
addons/pro/aweber/views/form-settings/map-fields.php
CHANGED
@@ -16,9 +16,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields',
|
20 |
|
21 |
-
<p><?php esc_html_e( 'Match up your form fields with your AWeber fields to make sure we\'re sending data to the right place.',
|
22 |
|
23 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -33,8 +33,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
33 |
<thead>
|
34 |
|
35 |
<tr>
|
36 |
-
<th><?php esc_html_e( 'AWeber Field',
|
37 |
-
<th><?php esc_html_e( 'Forminator Field',
|
38 |
</tr>
|
39 |
|
40 |
</thead>
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
20 |
|
21 |
+
<p><?php esc_html_e( 'Match up your form fields with your AWeber fields to make sure we\'re sending data to the right place.', 'forminator' ); ?></p>
|
22 |
|
23 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
33 |
<thead>
|
34 |
|
35 |
<tr>
|
36 |
+
<th><?php esc_html_e( 'AWeber Field', 'forminator' ); ?></th>
|
37 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
38 |
</tr>
|
39 |
|
40 |
</thead>
|
addons/pro/aweber/views/form-settings/pick-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/aweber/views/form-settings/setup-list.php
CHANGED
@@ -15,9 +15,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List',
|
19 |
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick AWeber List for new subscriber to be added to.',
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
@@ -31,10 +31,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
31 |
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
33 |
|
34 |
-
<label class="sui-label" for="aweber-list-id"><?php esc_html_e( 'List',
|
35 |
|
36 |
<select name="list_id" class="sui-select sui-form-control" id="aweber-list-id">
|
37 |
-
<option value=""><?php esc_html_e( 'Please select a list',
|
38 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
39 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
40 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List', 'forminator' ) ); ?></h3>
|
19 |
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick AWeber List for new subscriber to be added to.', 'forminator' ); ?></span>
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
31 |
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
33 |
|
34 |
+
<label class="sui-label" for="aweber-list-id"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
35 |
|
36 |
<select name="list_id" class="sui-select sui-form-control" id="aweber-list-id">
|
37 |
+
<option value=""><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
38 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
39 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
40 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
addons/pro/aweber/views/form-settings/setup-options.php
CHANGED
@@ -18,9 +18,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
?>
|
19 |
<div class="integration-header">
|
20 |
|
21 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
22 |
|
23 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for AWeber integration.',
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
@@ -34,12 +34,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['ad_tracking_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
-
<label class="sui-label"><?php esc_html_e( 'Ad Tracking',
|
38 |
|
39 |
<div class="sui-insert-variables">
|
40 |
|
41 |
<input name="ad_tracking"
|
42 |
-
placeholder="<?php echo esc_attr( __( 'Ad Tracking',
|
43 |
value="<?php echo esc_attr( $vars['ad_tracking'] ); ?>"
|
44 |
id="ad_tracking"
|
45 |
class="sui-form-control" />
|
@@ -61,13 +61,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
61 |
<span class="sui-error-message"><?php echo esc_html( $vars['ad_tracking_error'] ); ?></span>
|
62 |
<?php endif; ?>
|
63 |
|
64 |
-
<span class="sui-description"><?php echo ( sprintf( __( 'Use 20 or fewer characters to label subscribers based on how they signed up. Find complete article %1$shere%2$s.',
|
65 |
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['tags_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
|
70 |
-
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags',
|
71 |
|
72 |
<select class="sui-select fui-multi-select" name="tags[]" id="tags"
|
73 |
multiple="multiple"
|
@@ -96,7 +96,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
96 |
<span class="sui-error-message"><?php echo esc_html( $vars['tags_error'] ); ?></span>
|
97 |
<?php endif; ?>
|
98 |
|
99 |
-
<span class="sui-description"><?php echo ( sprintf( __( 'Available fields value or free text can be used as tags. Have a campaign that’s triggered when a subscriber is tagged? Enter the appropriate tag to add the subscriber to the campaign, and they will immediately begin receiving your messages. More info about AWeber subscriber tags can be found %1$shere%2$s.',
|
100 |
|
101 |
</div>
|
102 |
|
18 |
?>
|
19 |
<div class="integration-header">
|
20 |
|
21 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
22 |
|
23 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for AWeber integration.', 'forminator' ); ?></span>
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['ad_tracking_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
+
<label class="sui-label"><?php esc_html_e( 'Ad Tracking', 'forminator' ); ?></label>
|
38 |
|
39 |
<div class="sui-insert-variables">
|
40 |
|
41 |
<input name="ad_tracking"
|
42 |
+
placeholder="<?php echo esc_attr( __( 'Ad Tracking', 'forminator' ) ); ?>"
|
43 |
value="<?php echo esc_attr( $vars['ad_tracking'] ); ?>"
|
44 |
id="ad_tracking"
|
45 |
class="sui-form-control" />
|
61 |
<span class="sui-error-message"><?php echo esc_html( $vars['ad_tracking_error'] ); ?></span>
|
62 |
<?php endif; ?>
|
63 |
|
64 |
+
<span class="sui-description"><?php echo ( sprintf( __( 'Use 20 or fewer characters to label subscribers based on how they signed up. Find complete article %1$shere%2$s.', 'forminator' ), '<a href="https://help.aweber.com/hc/en-us/articles/204028836-What-is-Ad-Tracking-" target="_blank">', '</a>' ) ); // phpcs:ignore ?></span>
|
65 |
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['tags_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
|
70 |
+
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags', 'forminator' ); ?></label>
|
71 |
|
72 |
<select class="sui-select fui-multi-select" name="tags[]" id="tags"
|
73 |
multiple="multiple"
|
96 |
<span class="sui-error-message"><?php echo esc_html( $vars['tags_error'] ); ?></span>
|
97 |
<?php endif; ?>
|
98 |
|
99 |
+
<span class="sui-description"><?php echo ( sprintf( __( 'Available fields value or free text can be used as tags. Have a campaign that’s triggered when a subscriber is tagged? Enter the appropriate tag to add the subscriber to the campaign, and they will immediately begin receiving your messages. More info about AWeber subscriber tags can be found %1$shere%2$s.', 'forminator' ), '<a href="https://help.aweber.com/hc/en-us/articles/212677877-How-do-I-use-Tags-with-Campaigns-" target="_blank">', '</a>' ) ); // phpcs:ignore ?></span>
|
100 |
|
101 |
</div>
|
102 |
|
addons/pro/aweber/views/quiz-settings/map-fields.php
CHANGED
@@ -17,9 +17,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields',
|
21 |
|
22 |
-
<p><?php esc_html_e( 'Match up your form fields with your AWeber fields to make sure we\'re sending data to the right place.',
|
23 |
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -34,8 +34,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
34 |
<thead>
|
35 |
|
36 |
<tr>
|
37 |
-
<th><?php esc_html_e( 'AWeber Field',
|
38 |
-
<th><?php esc_html_e( 'Forminator Field',
|
39 |
</tr>
|
40 |
|
41 |
</thead>
|
@@ -67,7 +67,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
67 |
?>
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
70 |
-
<option value=""><?php esc_html_e( 'Please Select A Field',
|
71 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
72 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
73 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
21 |
|
22 |
+
<p><?php esc_html_e( 'Match up your form fields with your AWeber fields to make sure we\'re sending data to the right place.', 'forminator' ); ?></p>
|
23 |
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
34 |
<thead>
|
35 |
|
36 |
<tr>
|
37 |
+
<th><?php esc_html_e( 'AWeber Field', 'forminator' ); ?></th>
|
38 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
39 |
</tr>
|
40 |
|
41 |
</thead>
|
67 |
?>
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
70 |
+
<option value=""><?php esc_html_e( 'Please Select A Field', 'forminator' ); ?></option>
|
71 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
72 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
73 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
addons/pro/aweber/views/quiz-settings/pick-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/aweber/views/quiz-settings/setup-list.php
CHANGED
@@ -15,9 +15,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List',
|
19 |
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick AWeber List for new subscriber to be added to.',
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
@@ -31,10 +31,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
31 |
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
33 |
|
34 |
-
<label class="sui-label" for="aweber-list-id"><?php esc_html_e( 'List',
|
35 |
|
36 |
<select name="list_id" class="sui-select sui-form-control" id="aweber-list-id">
|
37 |
-
<option value=""><?php esc_html_e( 'Please select a list',
|
38 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
39 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
40 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List', 'forminator' ) ); ?></h3>
|
19 |
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick AWeber List for new subscriber to be added to.', 'forminator' ); ?></span>
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
31 |
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
33 |
|
34 |
+
<label class="sui-label" for="aweber-list-id"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
35 |
|
36 |
<select name="list_id" class="sui-select sui-form-control" id="aweber-list-id">
|
37 |
+
<option value=""><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
38 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
39 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
40 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
addons/pro/aweber/views/quiz-settings/setup-options.php
CHANGED
@@ -18,9 +18,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
?>
|
19 |
<div class="integration-header">
|
20 |
|
21 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
22 |
|
23 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for AWeber integration.',
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
@@ -34,12 +34,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['ad_tracking_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
-
<label class="sui-label"><?php esc_html_e( 'Ad Tracking',
|
38 |
|
39 |
<div class="sui-insert-variables">
|
40 |
|
41 |
<input name="ad_tracking"
|
42 |
-
placeholder="<?php echo esc_attr( __( 'Ad Tracking',
|
43 |
value="<?php echo esc_attr( $vars['ad_tracking'] ); ?>"
|
44 |
id="ad_tracking"
|
45 |
class="sui-form-control" />
|
@@ -61,13 +61,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
61 |
<span class="sui-error-message"><?php echo esc_html( $vars['ad_tracking_error'] ); ?></span>
|
62 |
<?php endif; ?>
|
63 |
|
64 |
-
<span class="sui-description"><?php echo ( sprintf( __( 'Use 20 or fewer characters to label subscribers based on how they signed up. Find complete article %1$shere%2$s.',
|
65 |
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['tags_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
|
70 |
-
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags',
|
71 |
|
72 |
<select class="sui-select fui-multi-select" name="tags[]" id="tags"
|
73 |
multiple="multiple"
|
@@ -96,7 +96,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
96 |
<span class="sui-error-message"><?php echo esc_html( $vars['tags_error'] ); ?></span>
|
97 |
<?php endif; ?>
|
98 |
|
99 |
-
<span class="sui-description"><?php echo ( sprintf( __( 'Available fields value or free text can be used as tags. Have a campaign that’s triggered when a subscriber is tagged? Enter the appropriate tag to add the subscriber to the campaign, and they will immediately begin receiving your messages. More info about AWeber subscriber tags can be found %1$shere%2$s.',
|
100 |
|
101 |
</div>
|
102 |
|
18 |
?>
|
19 |
<div class="integration-header">
|
20 |
|
21 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
22 |
|
23 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for AWeber integration.', 'forminator' ); ?></span>
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
34 |
|
35 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['ad_tracking_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
36 |
|
37 |
+
<label class="sui-label"><?php esc_html_e( 'Ad Tracking', 'forminator' ); ?></label>
|
38 |
|
39 |
<div class="sui-insert-variables">
|
40 |
|
41 |
<input name="ad_tracking"
|
42 |
+
placeholder="<?php echo esc_attr( __( 'Ad Tracking', 'forminator' ) ); ?>"
|
43 |
value="<?php echo esc_attr( $vars['ad_tracking'] ); ?>"
|
44 |
id="ad_tracking"
|
45 |
class="sui-form-control" />
|
61 |
<span class="sui-error-message"><?php echo esc_html( $vars['ad_tracking_error'] ); ?></span>
|
62 |
<?php endif; ?>
|
63 |
|
64 |
+
<span class="sui-description"><?php echo ( sprintf( __( 'Use 20 or fewer characters to label subscribers based on how they signed up. Find complete article %1$shere%2$s.', 'forminator' ), '<a href="https://help.aweber.com/hc/en-us/articles/204028836-What-is-Ad-Tracking-" target="_blank">', '</a>' ) ); // phpcs:ignore ?></span>
|
65 |
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['tags_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
|
70 |
+
<label class="sui-label" for="tags"><?php esc_html_e( 'Tags', 'forminator' ); ?></label>
|
71 |
|
72 |
<select class="sui-select fui-multi-select" name="tags[]" id="tags"
|
73 |
multiple="multiple"
|
96 |
<span class="sui-error-message"><?php echo esc_html( $vars['tags_error'] ); ?></span>
|
97 |
<?php endif; ?>
|
98 |
|
99 |
+
<span class="sui-description"><?php echo ( sprintf( __( 'Available fields value or free text can be used as tags. Have a campaign that’s triggered when a subscriber is tagged? Enter the appropriate tag to add the subscriber to the campaign, and they will immediately begin receiving your messages. More info about AWeber subscriber tags can be found %1$shere%2$s.', 'forminator' ), '<a href="https://help.aweber.com/hc/en-us/articles/212677877-How-do-I-use-Tags-with-Campaigns-" target="_blank">', '</a>' ) ); // phpcs:ignore ?></span>
|
100 |
|
101 |
</div>
|
102 |
|
addons/pro/aweber/views/sections/authorize.php
CHANGED
@@ -13,7 +13,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing AWeber',
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
@@ -24,14 +24,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized AWeber, you can go back to integration settings.',
|
27 |
-
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice sui-notice-loading">
|
34 |
-
<p><?php esc_html_e( 'Please Wait...',
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing AWeber', 'forminator' ); ?></h2>
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized AWeber, you can go back to integration settings.',
|
27 |
+
'forminator'
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice sui-notice-loading">
|
34 |
+
<p><?php esc_html_e( 'Please Wait...', 'forminator' ); ?></p>
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
addons/pro/aweber/views/settings/authorize.php
CHANGED
@@ -16,7 +16,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
<h3 class="sui-box-title" id="dialogTitle2">
|
17 |
<?php
|
18 |
/* translators: ... */
|
19 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
20 |
?>
|
21 |
</h3>
|
22 |
|
@@ -25,12 +25,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
25 |
<p>
|
26 |
<?php
|
27 |
/* translators: ... */
|
28 |
-
echo esc_html( sprintf( __( 'Your %1$s account is already authorized.',
|
29 |
?>
|
30 |
</p>
|
31 |
</div>
|
32 |
<?php else : ?>
|
33 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Authorize Forminator to connect with your AWeber account in order to send data from your forms.',
|
34 |
<?php endif; ?>
|
35 |
|
36 |
</div>
|
@@ -42,7 +42,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
42 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
43 |
target="_blank"
|
44 |
class="sui-button sui-button-blue forminator-addon-connect">
|
45 |
-
<?php esc_html_e( 'Authorize',
|
46 |
</a>
|
47 |
|
48 |
</div>
|
@@ -50,5 +50,5 @@ foreach ( $template_vars as $key => $val ) {
|
|
50 |
<?php endif; ?>
|
51 |
|
52 |
<?php if ( $vars['is_connected'] ) : ?>
|
53 |
-
<button class="sui-button sui-button-ghost forminator-addon-disconnect"><?php esc_html_e( 'Disconnect',
|
54 |
<?php endif; ?>
|
16 |
<h3 class="sui-box-title" id="dialogTitle2">
|
17 |
<?php
|
18 |
/* translators: ... */
|
19 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'AWeber' ) );
|
20 |
?>
|
21 |
</h3>
|
22 |
|
25 |
<p>
|
26 |
<?php
|
27 |
/* translators: ... */
|
28 |
+
echo esc_html( sprintf( __( 'Your %1$s account is already authorized.', 'forminator' ), 'AWeber' ) );
|
29 |
?>
|
30 |
</p>
|
31 |
</div>
|
32 |
<?php else : ?>
|
33 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Authorize Forminator to connect with your AWeber account in order to send data from your forms.', 'forminator' ); ?></span>
|
34 |
<?php endif; ?>
|
35 |
|
36 |
</div>
|
42 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
43 |
target="_blank"
|
44 |
class="sui-button sui-button-blue forminator-addon-connect">
|
45 |
+
<?php esc_html_e( 'Authorize', 'forminator' ); ?>
|
46 |
</a>
|
47 |
|
48 |
</div>
|
50 |
<?php endif; ?>
|
51 |
|
52 |
<?php if ( $vars['is_connected'] ) : ?>
|
53 |
+
<button class="sui-button sui-button-ghost forminator-addon-disconnect"><?php esc_html_e( 'Disconnect', 'forminator' ); ?></button>
|
54 |
<?php endif; ?>
|
addons/pro/aweber/views/settings/success-authorize.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
<h3 class="sui-box-title" id="dialogTitle2">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
11 |
|
12 |
</div>
|
13 |
|
14 |
-
<button class="sui-button forminator-addon-close"><?php esc_html_e( 'Close',
|
3 |
<h3 class="sui-box-title" id="dialogTitle2">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'AWeber' ) );
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></span>
|
11 |
|
12 |
</div>
|
13 |
|
14 |
+
<button class="sui-button forminator-addon-close"><?php esc_html_e( 'Close', 'forminator' ); ?></button>
|
addons/pro/aweber/views/settings/wait-authorize.php
CHANGED
@@ -15,7 +15,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
<h3 class="sui-box-title" id="dialogTitle2">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
19 |
?>
|
20 |
</h3>
|
21 |
|
@@ -28,7 +28,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
28 |
<p>
|
29 |
<?php
|
30 |
/* translators: ... */
|
31 |
-
echo esc_html( sprintf( __( 'We are waiting %1$s authorization...',
|
32 |
?>
|
33 |
</p>
|
34 |
|
@@ -39,7 +39,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
39 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
40 |
target="_blank"
|
41 |
class="sui-button sui-button-ghost disable-loader">
|
42 |
-
<?php esc_html_e( 'Retry',
|
43 |
</a>
|
44 |
</div>
|
45 |
<?php endif; ?>
|
15 |
<h3 class="sui-box-title" id="dialogTitle2">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'AWeber' ) );
|
19 |
?>
|
20 |
</h3>
|
21 |
|
28 |
<p>
|
29 |
<?php
|
30 |
/* translators: ... */
|
31 |
+
echo esc_html( sprintf( __( 'We are waiting %1$s authorization...', 'forminator' ), 'AWeber' ) );
|
32 |
?>
|
33 |
</p>
|
34 |
|
39 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
40 |
target="_blank"
|
41 |
class="sui-button sui-button-ghost disable-loader">
|
42 |
+
<?php esc_html_e( 'Retry', 'forminator' ); ?>
|
43 |
</a>
|
44 |
</div>
|
45 |
<?php endif; ?>
|
addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'Campaign Monitor failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -153,7 +153,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
153 |
$args = array();
|
154 |
|
155 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
156 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'List ID not properly setup.',
|
157 |
}
|
158 |
|
159 |
$list_id = $connection_settings['list_id'];
|
@@ -163,7 +163,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
163 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
164 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
165 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
166 |
-
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.',
|
167 |
);
|
168 |
}
|
169 |
$email = $submitted_data[ $email_element_id ];
|
@@ -183,7 +183,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
183 |
$name = $element_value;
|
184 |
} elseif ( ! isset( $submitted_data[ $name_element_id ] ) || empty( $submitted_data[ $name_element_id ] ) ) {
|
185 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
186 |
-
sprintf( __( 'Name on element %1$s not found or not filled on submitted data.',
|
187 |
);
|
188 |
}
|
189 |
|
@@ -271,7 +271,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
271 |
return array(
|
272 |
'is_sent' => true,
|
273 |
'connection_name' => $connection_settings['name'],
|
274 |
-
'description' => __( 'Successfully send data to Campaign Monitor',
|
275 |
'data_sent' => $api->get_last_data_sent(),
|
276 |
'data_received' => $api->get_last_data_received(),
|
277 |
'url_request' => $api->get_last_url_request(),
|
@@ -377,29 +377,29 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
377 |
}
|
378 |
$status = $addon_meta_data['value'];
|
379 |
$additional_entry_item = array(
|
380 |
-
'label' => __( 'Campaign Monitor Integration',
|
381 |
'value' => '',
|
382 |
);
|
383 |
|
384 |
$sub_entries = array();
|
385 |
if ( isset( $status['connection_name'] ) ) {
|
386 |
$sub_entries[] = array(
|
387 |
-
'label' => __( 'Integration Name',
|
388 |
'value' => $status['connection_name'],
|
389 |
);
|
390 |
}
|
391 |
|
392 |
if ( isset( $status['is_sent'] ) ) {
|
393 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
394 |
$sub_entries[] = array(
|
395 |
-
'label' => __( 'Sent To Campaign Monitor',
|
396 |
'value' => $is_sent,
|
397 |
);
|
398 |
}
|
399 |
|
400 |
if ( isset( $status['description'] ) ) {
|
401 |
$sub_entries[] = array(
|
402 |
-
'label' => __( 'Info',
|
403 |
'value' => $status['description'],
|
404 |
);
|
405 |
}
|
@@ -408,21 +408,21 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
408 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_CAMPAIGNMONITOR_SHOW_FULL_LOG', true)`
|
409 |
if ( isset( $status['url_request'] ) ) {
|
410 |
$sub_entries[] = array(
|
411 |
-
'label' => __( 'API URL',
|
412 |
'value' => $status['url_request'],
|
413 |
);
|
414 |
}
|
415 |
|
416 |
if ( isset( $status['data_sent'] ) ) {
|
417 |
$sub_entries[] = array(
|
418 |
-
'label' => __( 'Data sent to Campaign Monitor',
|
419 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
420 |
);
|
421 |
}
|
422 |
|
423 |
if ( isset( $status['data_received'] ) ) {
|
424 |
$sub_entries[] = array(
|
425 |
-
'label' => __( 'Data received from Campaign Monitor',
|
426 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
427 |
);
|
428 |
}
|
@@ -444,7 +444,7 @@ class Forminator_Addon_Campaignmonitor_Form_Hooks extends Forminator_Addon_Form_
|
|
444 |
public function on_export_render_title_row() {
|
445 |
|
446 |
$export_headers = array(
|
447 |
-
'info' => __( 'Campaign Monitor Info',
|
448 |
);
|
449 |
|
450 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'Campaign Monitor failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
153 |
$args = array();
|
154 |
|
155 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
156 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
157 |
}
|
158 |
|
159 |
$list_id = $connection_settings['list_id'];
|
163 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
164 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
165 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
166 |
+
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.', 'forminator' ), $email_element_id )
|
167 |
);
|
168 |
}
|
169 |
$email = $submitted_data[ $email_element_id ];
|
183 |
$name = $element_value;
|
184 |
} elseif ( ! isset( $submitted_data[ $name_element_id ] ) || empty( $submitted_data[ $name_element_id ] ) ) {
|
185 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
186 |
+
sprintf( __( 'Name on element %1$s not found or not filled on submitted data.', 'forminator' ), $name_element_id )
|
187 |
);
|
188 |
}
|
189 |
|
271 |
return array(
|
272 |
'is_sent' => true,
|
273 |
'connection_name' => $connection_settings['name'],
|
274 |
+
'description' => __( 'Successfully send data to Campaign Monitor', 'forminator' ),
|
275 |
'data_sent' => $api->get_last_data_sent(),
|
276 |
'data_received' => $api->get_last_data_received(),
|
277 |
'url_request' => $api->get_last_url_request(),
|
377 |
}
|
378 |
$status = $addon_meta_data['value'];
|
379 |
$additional_entry_item = array(
|
380 |
+
'label' => __( 'Campaign Monitor Integration', 'forminator' ),
|
381 |
'value' => '',
|
382 |
);
|
383 |
|
384 |
$sub_entries = array();
|
385 |
if ( isset( $status['connection_name'] ) ) {
|
386 |
$sub_entries[] = array(
|
387 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
388 |
'value' => $status['connection_name'],
|
389 |
);
|
390 |
}
|
391 |
|
392 |
if ( isset( $status['is_sent'] ) ) {
|
393 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
394 |
$sub_entries[] = array(
|
395 |
+
'label' => __( 'Sent To Campaign Monitor', 'forminator' ),
|
396 |
'value' => $is_sent,
|
397 |
);
|
398 |
}
|
399 |
|
400 |
if ( isset( $status['description'] ) ) {
|
401 |
$sub_entries[] = array(
|
402 |
+
'label' => __( 'Info', 'forminator' ),
|
403 |
'value' => $status['description'],
|
404 |
);
|
405 |
}
|
408 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_CAMPAIGNMONITOR_SHOW_FULL_LOG', true)`
|
409 |
if ( isset( $status['url_request'] ) ) {
|
410 |
$sub_entries[] = array(
|
411 |
+
'label' => __( 'API URL', 'forminator' ),
|
412 |
'value' => $status['url_request'],
|
413 |
);
|
414 |
}
|
415 |
|
416 |
if ( isset( $status['data_sent'] ) ) {
|
417 |
$sub_entries[] = array(
|
418 |
+
'label' => __( 'Data sent to Campaign Monitor', 'forminator' ),
|
419 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
420 |
);
|
421 |
}
|
422 |
|
423 |
if ( isset( $status['data_received'] ) ) {
|
424 |
$sub_entries[] = array(
|
425 |
+
'label' => __( 'Data received from Campaign Monitor', 'forminator' ),
|
426 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
427 |
);
|
428 |
}
|
444 |
public function on_export_render_title_row() {
|
445 |
|
446 |
$export_headers = array(
|
447 |
+
'info' => __( 'Campaign Monitor Info', 'forminator' ),
|
448 |
);
|
449 |
|
450 |
$form_id = $this->form_id;
|
addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-form-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,14 +118,14 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
-
esc_html__( 'Deactivate',
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.',
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
@@ -177,7 +177,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
177 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
@@ -208,7 +208,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
208 |
}
|
209 |
|
210 |
if ( empty( $lists ) ) {
|
211 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No lists found on your Campaign Monitor. Please create one.',
|
212 |
}
|
213 |
|
214 |
$template_params['lists'] = $lists;
|
@@ -252,14 +252,14 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
252 |
$buttons = array();
|
253 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
254 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
255 |
-
esc_html__( 'Deactivate',
|
256 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
257 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.',
|
258 |
);
|
259 |
}
|
260 |
|
261 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
262 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
263 |
'</div>';
|
264 |
|
265 |
return array(
|
@@ -312,7 +312,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
312 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/map-fields.php';
|
313 |
|
314 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
315 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
316 |
}
|
317 |
|
318 |
$multi_id = $submitted_data['multi_id'];
|
@@ -342,8 +342,8 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
342 |
$has_errors = false;
|
343 |
|
344 |
$fields = array(
|
345 |
-
'default_field_email' => __( 'Email Address',
|
346 |
-
'default_field_name' => __( 'Name',
|
347 |
);
|
348 |
|
349 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
@@ -354,7 +354,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
354 |
$list_custom_fields = $api->get_list_custom_field( $list_id );
|
355 |
|
356 |
if ( ! is_array( $list_custom_fields ) ) {
|
357 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor list\'s custom fields could not be found',
|
358 |
}
|
359 |
|
360 |
foreach ( $list_custom_fields as $field ) {
|
@@ -381,7 +381,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
381 |
|
382 |
try {
|
383 |
if ( empty( $fields_map ) ) {
|
384 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please assign fields.',
|
385 |
}
|
386 |
|
387 |
$input_exceptions = new Forminator_Addon_Campaignmonitor_Form_Settings_Exception();
|
@@ -399,7 +399,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
399 |
$element_id = $fields_map[ $key ];
|
400 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
401 |
$input_exceptions->add_input_exception(/* translators: ... */
|
402 |
-
sprintf( __( 'Please assign valid field for %s',
|
403 |
$key . '_error'
|
404 |
);
|
405 |
continue;
|
@@ -427,14 +427,14 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
427 |
$buttons = array();
|
428 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
429 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
430 |
-
esc_html__( 'Deactivate',
|
431 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
432 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.',
|
433 |
);
|
434 |
}
|
435 |
|
436 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
437 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
438 |
'</div>';
|
439 |
|
440 |
return array(
|
@@ -501,7 +501,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
501 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/setup-options.php';
|
502 |
|
503 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
504 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
505 |
}
|
506 |
|
507 |
$multi_id = $submitted_data['multi_id'];
|
@@ -540,7 +540,7 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
540 |
);
|
541 |
|
542 |
if ( ! in_array( $consent_to_track, $available_consents, true ) ) {
|
543 |
-
$input_exceptions->add_input_exception( __( 'Please pick valid Consent To Track options',
|
544 |
}
|
545 |
|
546 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
@@ -574,14 +574,14 @@ class Forminator_Addon_Campaignmonitor_Form_Settings extends Forminator_Addon_Fo
|
|
574 |
$buttons = array();
|
575 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
576 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
577 |
-
esc_html__( 'Deactivate',
|
578 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
579 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.',
|
580 |
);
|
581 |
}
|
582 |
|
583 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
584 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
585 |
'</div>';
|
586 |
|
587 |
return array(
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.', 'forminator' )
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
177 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
208 |
}
|
209 |
|
210 |
if ( empty( $lists ) ) {
|
211 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No lists found on your Campaign Monitor. Please create one.', 'forminator' ) );
|
212 |
}
|
213 |
|
214 |
$template_params['lists'] = $lists;
|
252 |
$buttons = array();
|
253 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
254 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
255 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
256 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
257 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.', 'forminator' )
|
258 |
);
|
259 |
}
|
260 |
|
261 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
262 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
263 |
'</div>';
|
264 |
|
265 |
return array(
|
312 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/map-fields.php';
|
313 |
|
314 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
315 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
316 |
}
|
317 |
|
318 |
$multi_id = $submitted_data['multi_id'];
|
342 |
$has_errors = false;
|
343 |
|
344 |
$fields = array(
|
345 |
+
'default_field_email' => __( 'Email Address', 'forminator' ),
|
346 |
+
'default_field_name' => __( 'Name', 'forminator' ),
|
347 |
);
|
348 |
|
349 |
$list_id = $this->get_multi_id_form_settings_value( $multi_id, 'list_id', 0 );
|
354 |
$list_custom_fields = $api->get_list_custom_field( $list_id );
|
355 |
|
356 |
if ( ! is_array( $list_custom_fields ) ) {
|
357 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor list\'s custom fields could not be found', 'forminator' ) );
|
358 |
}
|
359 |
|
360 |
foreach ( $list_custom_fields as $field ) {
|
381 |
|
382 |
try {
|
383 |
if ( empty( $fields_map ) ) {
|
384 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please assign fields.', 'forminator' ) );
|
385 |
}
|
386 |
|
387 |
$input_exceptions = new Forminator_Addon_Campaignmonitor_Form_Settings_Exception();
|
399 |
$element_id = $fields_map[ $key ];
|
400 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
401 |
$input_exceptions->add_input_exception(/* translators: ... */
|
402 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
403 |
$key . '_error'
|
404 |
);
|
405 |
continue;
|
427 |
$buttons = array();
|
428 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
429 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
430 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
431 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
432 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.', 'forminator' )
|
433 |
);
|
434 |
}
|
435 |
|
436 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
437 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
438 |
'</div>';
|
439 |
|
440 |
return array(
|
501 |
$template = forminator_addon_campaignmonitor_dir() . 'views/form-settings/setup-options.php';
|
502 |
|
503 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
504 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
505 |
}
|
506 |
|
507 |
$multi_id = $submitted_data['multi_id'];
|
540 |
);
|
541 |
|
542 |
if ( ! in_array( $consent_to_track, $available_consents, true ) ) {
|
543 |
+
$input_exceptions->add_input_exception( __( 'Please pick valid Consent To Track options', 'forminator' ), 'consent_to_track_error' );
|
544 |
}
|
545 |
|
546 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
574 |
$buttons = array();
|
575 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
576 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
577 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
578 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
579 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Form.', 'forminator' )
|
580 |
);
|
581 |
}
|
582 |
|
583 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
584 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
585 |
'</div>';
|
586 |
|
587 |
return array(
|
addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'Campaign Monitor failed to process submitted data. Please check your quiz and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -160,7 +160,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
160 |
$args = array();
|
161 |
|
162 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
163 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'List ID not properly setup.',
|
164 |
}
|
165 |
|
166 |
$list_id = $connection_settings['list_id'];
|
@@ -170,7 +170,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
170 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
171 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
172 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
173 |
-
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.',
|
174 |
);
|
175 |
}
|
176 |
$email = $submitted_data[ $email_element_id ];
|
@@ -182,7 +182,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
182 |
$name_element_id = $connection_settings['fields_map']['default_field_name'];
|
183 |
if ( ! isset( $submitted_data[ $name_element_id ] ) || empty( $submitted_data[ $name_element_id ] ) ) {
|
184 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
185 |
-
sprintf( __( 'Name on element %1$s not found or not filled on submitted data.',
|
186 |
);
|
187 |
}
|
188 |
|
@@ -264,7 +264,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
264 |
return array(
|
265 |
'is_sent' => true,
|
266 |
'connection_name' => $connection_settings['name'],
|
267 |
-
'description' => __( 'Successfully send data to Campaign Monitor',
|
268 |
'data_sent' => $api->get_last_data_sent(),
|
269 |
'data_received' => $api->get_last_data_received(),
|
270 |
'url_request' => $api->get_last_url_request(),
|
@@ -370,29 +370,29 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
370 |
}
|
371 |
$status = $addon_meta_data['value'];
|
372 |
$additional_entry_item = array(
|
373 |
-
'label' => __( 'Campaign Monitor Integration',
|
374 |
'value' => '',
|
375 |
);
|
376 |
|
377 |
$sub_entries = array();
|
378 |
if ( isset( $status['connection_name'] ) ) {
|
379 |
$sub_entries[] = array(
|
380 |
-
'label' => __( 'Integration Name',
|
381 |
'value' => $status['connection_name'],
|
382 |
);
|
383 |
}
|
384 |
|
385 |
if ( isset( $status['is_sent'] ) ) {
|
386 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
387 |
$sub_entries[] = array(
|
388 |
-
'label' => __( 'Sent To Campaign Monitor',
|
389 |
'value' => $is_sent,
|
390 |
);
|
391 |
}
|
392 |
|
393 |
if ( isset( $status['description'] ) ) {
|
394 |
$sub_entries[] = array(
|
395 |
-
'label' => __( 'Info',
|
396 |
'value' => $status['description'],
|
397 |
);
|
398 |
}
|
@@ -401,21 +401,21 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
401 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_CAMPAIGNMONITOR_SHOW_FULL_LOG', true)`
|
402 |
if ( isset( $status['url_request'] ) ) {
|
403 |
$sub_entries[] = array(
|
404 |
-
'label' => __( 'API URL',
|
405 |
'value' => $status['url_request'],
|
406 |
);
|
407 |
}
|
408 |
|
409 |
if ( isset( $status['data_sent'] ) ) {
|
410 |
$sub_entries[] = array(
|
411 |
-
'label' => __( 'Data sent to Campaign Monitor',
|
412 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
413 |
);
|
414 |
}
|
415 |
|
416 |
if ( isset( $status['data_received'] ) ) {
|
417 |
$sub_entries[] = array(
|
418 |
-
'label' => __( 'Data received from Campaign Monitor',
|
419 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
420 |
);
|
421 |
}
|
@@ -437,7 +437,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Hooks extends Forminator_Addon_Quiz_
|
|
437 |
public function on_export_render_title_row() {
|
438 |
|
439 |
$export_headers = array(
|
440 |
-
'info' => __( 'Campaign Monitor Info',
|
441 |
);
|
442 |
|
443 |
$quiz_id = $this->quiz_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'Campaign Monitor failed to process submitted data. Please check your quiz and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
160 |
$args = array();
|
161 |
|
162 |
if ( ! isset( $connection_settings['list_id'] ) ) {
|
163 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'List ID not properly setup.', 'forminator' ) );
|
164 |
}
|
165 |
|
166 |
$list_id = $connection_settings['list_id'];
|
170 |
$email_element_id = $connection_settings['fields_map']['default_field_email'];
|
171 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
172 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
173 |
+
sprintf( __( 'Email Address on element %1$s not found or not filled on submitted data.', 'forminator' ), $email_element_id )
|
174 |
);
|
175 |
}
|
176 |
$email = $submitted_data[ $email_element_id ];
|
182 |
$name_element_id = $connection_settings['fields_map']['default_field_name'];
|
183 |
if ( ! isset( $submitted_data[ $name_element_id ] ) || empty( $submitted_data[ $name_element_id ] ) ) {
|
184 |
throw new Forminator_Addon_Campaignmonitor_Exception(/* translators: ... */
|
185 |
+
sprintf( __( 'Name on element %1$s not found or not filled on submitted data.', 'forminator' ), $name_element_id )
|
186 |
);
|
187 |
}
|
188 |
|
264 |
return array(
|
265 |
'is_sent' => true,
|
266 |
'connection_name' => $connection_settings['name'],
|
267 |
+
'description' => __( 'Successfully send data to Campaign Monitor', 'forminator' ),
|
268 |
'data_sent' => $api->get_last_data_sent(),
|
269 |
'data_received' => $api->get_last_data_received(),
|
270 |
'url_request' => $api->get_last_url_request(),
|
370 |
}
|
371 |
$status = $addon_meta_data['value'];
|
372 |
$additional_entry_item = array(
|
373 |
+
'label' => __( 'Campaign Monitor Integration', 'forminator' ),
|
374 |
'value' => '',
|
375 |
);
|
376 |
|
377 |
$sub_entries = array();
|
378 |
if ( isset( $status['connection_name'] ) ) {
|
379 |
$sub_entries[] = array(
|
380 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
381 |
'value' => $status['connection_name'],
|
382 |
);
|
383 |
}
|
384 |
|
385 |
if ( isset( $status['is_sent'] ) ) {
|
386 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
387 |
$sub_entries[] = array(
|
388 |
+
'label' => __( 'Sent To Campaign Monitor', 'forminator' ),
|
389 |
'value' => $is_sent,
|
390 |
);
|
391 |
}
|
392 |
|
393 |
if ( isset( $status['description'] ) ) {
|
394 |
$sub_entries[] = array(
|
395 |
+
'label' => __( 'Info', 'forminator' ),
|
396 |
'value' => $status['description'],
|
397 |
);
|
398 |
}
|
401 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_CAMPAIGNMONITOR_SHOW_FULL_LOG', true)`
|
402 |
if ( isset( $status['url_request'] ) ) {
|
403 |
$sub_entries[] = array(
|
404 |
+
'label' => __( 'API URL', 'forminator' ),
|
405 |
'value' => $status['url_request'],
|
406 |
);
|
407 |
}
|
408 |
|
409 |
if ( isset( $status['data_sent'] ) ) {
|
410 |
$sub_entries[] = array(
|
411 |
+
'label' => __( 'Data sent to Campaign Monitor', 'forminator' ),
|
412 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
413 |
);
|
414 |
}
|
415 |
|
416 |
if ( isset( $status['data_received'] ) ) {
|
417 |
$sub_entries[] = array(
|
418 |
+
'label' => __( 'Data received from Campaign Monitor', 'forminator' ),
|
419 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
420 |
);
|
421 |
}
|
437 |
public function on_export_render_title_row() {
|
438 |
|
439 |
$export_headers = array(
|
440 |
+
'info' => __( 'Campaign Monitor Info', 'forminator' ),
|
441 |
);
|
442 |
|
443 |
$quiz_id = $this->quiz_id;
|
addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor-quiz-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,14 +118,14 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
-
esc_html__( 'Deactivate',
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.',
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
@@ -177,7 +177,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
177 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
@@ -208,7 +208,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
208 |
}
|
209 |
|
210 |
if ( empty( $lists ) ) {
|
211 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No lists found on your Campaign Monitor. Please create one.',
|
212 |
}
|
213 |
|
214 |
$template_params['lists'] = $lists;
|
@@ -252,14 +252,14 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
252 |
$buttons = array();
|
253 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
254 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
255 |
-
esc_html__( 'Deactivate',
|
256 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
257 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.',
|
258 |
);
|
259 |
}
|
260 |
|
261 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
262 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
263 |
'</div>';
|
264 |
|
265 |
return array(
|
@@ -312,7 +312,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
312 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/map-fields.php';
|
313 |
|
314 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
315 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
316 |
}
|
317 |
|
318 |
$multi_id = $submitted_data['multi_id'];
|
@@ -332,7 +332,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
332 |
|
333 |
$quiz_questions = $this->get_quiz_fields();
|
334 |
$quiz_fields = array(
|
335 |
-
'quiz-name' => __( 'Quiz Name',
|
336 |
);
|
337 |
foreach ( $quiz_questions as $quiz_question ) {
|
338 |
// collect element ids
|
@@ -340,11 +340,11 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
340 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
341 |
}
|
342 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
343 |
-
$quiz_fields['correct-answers'] = __( 'Correct Answers',
|
344 |
-
$quiz_fields['total-answers'] = __( 'Total Answers',
|
345 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'correct-answers', 'total-answers' );
|
346 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
347 |
-
$quiz_fields['result-answers'] = __( 'Result Answer',
|
348 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'result-answers' );
|
349 |
}
|
350 |
|
@@ -364,8 +364,8 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
364 |
$has_errors = false;
|
365 |
|
366 |
$fields = array(
|
367 |
-
'default_field_email' => __( 'Email Address',
|
368 |
-
'default_field_name' => __( 'Name',
|
369 |
);
|
370 |
|
371 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
@@ -376,7 +376,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
376 |
$list_custom_fields = $api->get_list_custom_field( $list_id );
|
377 |
|
378 |
if ( ! is_array( $list_custom_fields ) ) {
|
379 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor list\'s custom fields could not be found',
|
380 |
}
|
381 |
|
382 |
foreach ( $list_custom_fields as $field ) {
|
@@ -403,7 +403,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
403 |
|
404 |
try {
|
405 |
if ( empty( $fields_map ) ) {
|
406 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please assign fields.',
|
407 |
}
|
408 |
|
409 |
$input_exceptions = new Forminator_Addon_Campaignmonitor_Quiz_Settings_Exception();
|
@@ -421,7 +421,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
421 |
$element_id = $fields_map[ $key ];
|
422 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
423 |
$input_exceptions->add_input_exception(/* translators: ... */
|
424 |
-
sprintf( __( 'Please assign valid field for %s',
|
425 |
$key . '_error'
|
426 |
);
|
427 |
continue;
|
@@ -449,14 +449,14 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
449 |
$buttons = array();
|
450 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
451 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
452 |
-
esc_html__( 'Deactivate',
|
453 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
454 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.',
|
455 |
);
|
456 |
}
|
457 |
|
458 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
459 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
460 |
'</div>';
|
461 |
|
462 |
return array(
|
@@ -523,7 +523,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
523 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/setup-options.php';
|
524 |
|
525 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
526 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
527 |
}
|
528 |
|
529 |
$multi_id = $submitted_data['multi_id'];
|
@@ -562,7 +562,7 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
562 |
);
|
563 |
|
564 |
if ( ! in_array( $consent_to_track, $available_consents, true ) ) {
|
565 |
-
$input_exceptions->add_input_exception( __( 'Please pick valid Consent To Track options',
|
566 |
}
|
567 |
|
568 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
@@ -596,14 +596,14 @@ class Forminator_Addon_Campaignmonitor_Quiz_Settings extends Forminator_Addon_Qu
|
|
596 |
$buttons = array();
|
597 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
598 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
599 |
-
esc_html__( 'Deactivate',
|
600 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
601 |
-
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.',
|
602 |
);
|
603 |
}
|
604 |
|
605 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
606 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
607 |
'</div>';
|
608 |
|
609 |
return array(
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$buttons = array();
|
119 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
120 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
121 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
122 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
123 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.', 'forminator' )
|
124 |
);
|
125 |
}
|
126 |
|
127 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
128 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
129 |
'</div>';
|
130 |
|
131 |
return array(
|
177 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/setup-list.php';
|
178 |
|
179 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
180 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
181 |
}
|
182 |
|
183 |
$multi_id = $submitted_data['multi_id'];
|
208 |
}
|
209 |
|
210 |
if ( empty( $lists ) ) {
|
211 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No lists found on your Campaign Monitor. Please create one.', 'forminator' ) );
|
212 |
}
|
213 |
|
214 |
$template_params['lists'] = $lists;
|
252 |
$buttons = array();
|
253 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
254 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
255 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
256 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
257 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.', 'forminator' )
|
258 |
);
|
259 |
}
|
260 |
|
261 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
262 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
263 |
'</div>';
|
264 |
|
265 |
return array(
|
312 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/map-fields.php';
|
313 |
|
314 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
315 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
316 |
}
|
317 |
|
318 |
$multi_id = $submitted_data['multi_id'];
|
332 |
|
333 |
$quiz_questions = $this->get_quiz_fields();
|
334 |
$quiz_fields = array(
|
335 |
+
'quiz-name' => __( 'Quiz Name', 'forminator' ),
|
336 |
);
|
337 |
foreach ( $quiz_questions as $quiz_question ) {
|
338 |
// collect element ids
|
340 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
341 |
}
|
342 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
343 |
+
$quiz_fields['correct-answers'] = __( 'Correct Answers', 'forminator' );
|
344 |
+
$quiz_fields['total-answers'] = __( 'Total Answers', 'forminator' );
|
345 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'correct-answers', 'total-answers' );
|
346 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
347 |
+
$quiz_fields['result-answers'] = __( 'Result Answer', 'forminator' );
|
348 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'result-answers' );
|
349 |
}
|
350 |
|
364 |
$has_errors = false;
|
365 |
|
366 |
$fields = array(
|
367 |
+
'default_field_email' => __( 'Email Address', 'forminator' ),
|
368 |
+
'default_field_name' => __( 'Name', 'forminator' ),
|
369 |
);
|
370 |
|
371 |
$list_id = $this->get_multi_id_quiz_settings_value( $multi_id, 'list_id', 0 );
|
376 |
$list_custom_fields = $api->get_list_custom_field( $list_id );
|
377 |
|
378 |
if ( ! is_array( $list_custom_fields ) ) {
|
379 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor list\'s custom fields could not be found', 'forminator' ) );
|
380 |
}
|
381 |
|
382 |
foreach ( $list_custom_fields as $field ) {
|
403 |
|
404 |
try {
|
405 |
if ( empty( $fields_map ) ) {
|
406 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please assign fields.', 'forminator' ) );
|
407 |
}
|
408 |
|
409 |
$input_exceptions = new Forminator_Addon_Campaignmonitor_Quiz_Settings_Exception();
|
421 |
$element_id = $fields_map[ $key ];
|
422 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
423 |
$input_exceptions->add_input_exception(/* translators: ... */
|
424 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
425 |
$key . '_error'
|
426 |
);
|
427 |
continue;
|
449 |
$buttons = array();
|
450 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
451 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
452 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
453 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
454 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.', 'forminator' )
|
455 |
);
|
456 |
}
|
457 |
|
458 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
459 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
460 |
'</div>';
|
461 |
|
462 |
return array(
|
523 |
$template = forminator_addon_campaignmonitor_dir() . 'views/quiz-settings/setup-options.php';
|
524 |
|
525 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
526 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
527 |
}
|
528 |
|
529 |
$multi_id = $submitted_data['multi_id'];
|
562 |
);
|
563 |
|
564 |
if ( ! in_array( $consent_to_track, $available_consents, true ) ) {
|
565 |
+
$input_exceptions->add_input_exception( __( 'Please pick valid Consent To Track options', 'forminator' ), 'consent_to_track_error' );
|
566 |
}
|
567 |
|
568 |
if ( $input_exceptions->input_exceptions_is_available() ) {
|
596 |
$buttons = array();
|
597 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
598 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
599 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
600 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
601 |
+
esc_html__( 'Deactivate this Campaign Monitor Integration from this Quiz.', 'forminator' )
|
602 |
);
|
603 |
}
|
604 |
|
605 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
606 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
607 |
'</div>';
|
608 |
|
609 |
return array(
|
addons/pro/campaignmonitor/class-forminator-addon-campaignmonitor.php
CHANGED
@@ -45,13 +45,13 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
// late init to allow translation
|
48 |
-
$this->_description = __( 'Get awesome by your form.',
|
49 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Campaign Monitor Integration, don\'t hesitate to contact us',
|
50 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Campaign Monitor Integration, please try again',
|
51 |
|
52 |
$this->_update_settings_error_message = __(
|
53 |
'Sorry, we failed to update settings, please check your form and try again',
|
54 |
-
|
55 |
);
|
56 |
|
57 |
$this->_icon = forminator_addon_campaignmonitor_assets_url() . 'icons/campaignmonitor.png';
|
@@ -85,7 +85,7 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
85 |
try {
|
86 |
// check if its active
|
87 |
if ( ! $this->is_active() ) {
|
88 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor is not active',
|
89 |
}
|
90 |
|
91 |
// if user completed api setup
|
@@ -120,17 +120,17 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
120 |
try {
|
121 |
$form_settings_instance = null;
|
122 |
if ( ! $this->is_connected() ) {
|
123 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected',
|
124 |
}
|
125 |
|
126 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
127 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Campaignmonitor_Form_Settings ) {
|
128 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Form Settings of Campaign Monitor',
|
129 |
}
|
130 |
|
131 |
// Mark as active when there is at least one active connection
|
132 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
133 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No active Campaign Monitor connection found in this form',
|
134 |
}
|
135 |
|
136 |
$is_form_connected = true;
|
@@ -314,7 +314,7 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
314 |
if ( ! isset( $client_details->BasicDetails ) //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
315 |
|| ! isset( $client_details->BasicDetails->ClientID ) //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
316 |
|| ! isset( $client_details->BasicDetails->CompanyName ) ) { //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
317 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Could not find client details, please try again',
|
318 |
}
|
319 |
|
320 |
$client_name = $client_details->BasicDetails->CompanyName; //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
@@ -352,22 +352,22 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
352 |
|
353 |
if ( $show_success ) {
|
354 |
$buttons['close'] = array(
|
355 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
356 |
);
|
357 |
} else {
|
358 |
if ( $this->is_connected() ) {
|
359 |
$buttons['disconnect'] = array(
|
360 |
-
'markup' => self::get_button_markup( esc_html__( 'Disconnect',
|
361 |
);
|
362 |
$buttons['submit'] = array(
|
363 |
'markup' => '<div class="sui-actions-right">' .
|
364 |
-
self::get_button_markup( esc_html__( 'Save',
|
365 |
'</div>',
|
366 |
);
|
367 |
} else {
|
368 |
$buttons['submit'] = array(
|
369 |
'markup' => '<div class="sui-actions-right">' .
|
370 |
-
self::get_button_markup( esc_html__( 'CONNECT',
|
371 |
'</div>',
|
372 |
);
|
373 |
}
|
@@ -432,7 +432,7 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
432 |
*/
|
433 |
public function validate_api_key( $api_key ) {
|
434 |
if ( empty( $api_key ) ) {
|
435 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please put a valid Campaign Monitor API Key',
|
436 |
}
|
437 |
|
438 |
return $api_key;
|
@@ -455,7 +455,7 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
455 |
$system_date = $api->get_system_date();
|
456 |
|
457 |
if ( ! isset( $system_date->SystemDate ) || empty( $system_date->SystemDate ) ) { //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
458 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Failed to validate API Key.',
|
459 |
}
|
460 |
}
|
461 |
|
@@ -535,17 +535,17 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
535 |
try {
|
536 |
$quiz_settings_instance = null;
|
537 |
if ( ! $this->is_connected() ) {
|
538 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected',
|
539 |
}
|
540 |
|
541 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
542 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Campaignmonitor_Quiz_Settings ) {
|
543 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Quiz Settings of Campaign Monitor',
|
544 |
}
|
545 |
|
546 |
// Mark as active when there is at least one active connection
|
547 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
548 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No active Campaign Monitor connection found in this quiz',
|
549 |
}
|
550 |
|
551 |
$is_quiz_connected = true;
|
@@ -586,12 +586,12 @@ final class Forminator_Addon_Campaignmonitor extends Forminator_Addon_Abstract {
|
|
586 |
// initialize with null
|
587 |
$quiz_settings_instance = null;
|
588 |
if ( ! $this->is_connected() ) {
|
589 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected',
|
590 |
}
|
591 |
|
592 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
593 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Campaignmonitor_Quiz_Settings ) {
|
594 |
-
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Quiz Settings of Campaign Monitor',
|
595 |
}
|
596 |
|
597 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
45 |
*/
|
46 |
public function __construct() {
|
47 |
// late init to allow translation
|
48 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
49 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Campaign Monitor Integration, don\'t hesitate to contact us', 'forminator' );
|
50 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Campaign Monitor Integration, please try again', 'forminator' );
|
51 |
|
52 |
$this->_update_settings_error_message = __(
|
53 |
'Sorry, we failed to update settings, please check your form and try again',
|
54 |
+
'forminator'
|
55 |
);
|
56 |
|
57 |
$this->_icon = forminator_addon_campaignmonitor_assets_url() . 'icons/campaignmonitor.png';
|
85 |
try {
|
86 |
// check if its active
|
87 |
if ( ! $this->is_active() ) {
|
88 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Campaign Monitor is not active', 'forminator' ) );
|
89 |
}
|
90 |
|
91 |
// if user completed api setup
|
120 |
try {
|
121 |
$form_settings_instance = null;
|
122 |
if ( ! $this->is_connected() ) {
|
123 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected', 'forminator' ) );
|
124 |
}
|
125 |
|
126 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
127 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Campaignmonitor_Form_Settings ) {
|
128 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Form Settings of Campaign Monitor', 'forminator' ) );
|
129 |
}
|
130 |
|
131 |
// Mark as active when there is at least one active connection
|
132 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
133 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No active Campaign Monitor connection found in this form', 'forminator' ) );
|
134 |
}
|
135 |
|
136 |
$is_form_connected = true;
|
314 |
if ( ! isset( $client_details->BasicDetails ) //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
315 |
|| ! isset( $client_details->BasicDetails->ClientID ) //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
316 |
|| ! isset( $client_details->BasicDetails->CompanyName ) ) { //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
317 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Could not find client details, please try again', 'forminator' ) );
|
318 |
}
|
319 |
|
320 |
$client_name = $client_details->BasicDetails->CompanyName; //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
352 |
|
353 |
if ( $show_success ) {
|
354 |
$buttons['close'] = array(
|
355 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'sui-button-ghost forminator-addon-close' ),
|
356 |
);
|
357 |
} else {
|
358 |
if ( $this->is_connected() ) {
|
359 |
$buttons['disconnect'] = array(
|
360 |
+
'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
361 |
);
|
362 |
$buttons['submit'] = array(
|
363 |
'markup' => '<div class="sui-actions-right">' .
|
364 |
+
self::get_button_markup( esc_html__( 'Save', 'forminator' ), 'forminator-addon-connect' ) .
|
365 |
'</div>',
|
366 |
);
|
367 |
} else {
|
368 |
$buttons['submit'] = array(
|
369 |
'markup' => '<div class="sui-actions-right">' .
|
370 |
+
self::get_button_markup( esc_html__( 'CONNECT', 'forminator' ), 'forminator-addon-connect' ) .
|
371 |
'</div>',
|
372 |
);
|
373 |
}
|
432 |
*/
|
433 |
public function validate_api_key( $api_key ) {
|
434 |
if ( empty( $api_key ) ) {
|
435 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Please put a valid Campaign Monitor API Key', 'forminator' ) );
|
436 |
}
|
437 |
|
438 |
return $api_key;
|
455 |
$system_date = $api->get_system_date();
|
456 |
|
457 |
if ( ! isset( $system_date->SystemDate ) || empty( $system_date->SystemDate ) ) { //phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
458 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Failed to validate API Key.', 'forminator' ) );
|
459 |
}
|
460 |
}
|
461 |
|
535 |
try {
|
536 |
$quiz_settings_instance = null;
|
537 |
if ( ! $this->is_connected() ) {
|
538 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected', 'forminator' ) );
|
539 |
}
|
540 |
|
541 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
542 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Campaignmonitor_Quiz_Settings ) {
|
543 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Quiz Settings of Campaign Monitor', 'forminator' ) );
|
544 |
}
|
545 |
|
546 |
// Mark as active when there is at least one active connection
|
547 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
548 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'No active Campaign Monitor connection found in this quiz', 'forminator' ) );
|
549 |
}
|
550 |
|
551 |
$is_quiz_connected = true;
|
586 |
// initialize with null
|
587 |
$quiz_settings_instance = null;
|
588 |
if ( ! $this->is_connected() ) {
|
589 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( ' Campaign Monitor is not connected', 'forminator' ) );
|
590 |
}
|
591 |
|
592 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
593 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Campaignmonitor_Quiz_Settings ) {
|
594 |
+
throw new Forminator_Addon_Campaignmonitor_Exception( __( 'Invalid Quiz Settings of Campaign Monitor', 'forminator' ) );
|
595 |
}
|
596 |
|
597 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
addons/pro/campaignmonitor/lib/class-forminator-addon-campaignmonitor-wp-api.php
CHANGED
@@ -66,7 +66,7 @@ class Forminator_Addon_Campaignmonitor_Wp_Api {
|
|
66 |
public function __construct( $api_key ) {
|
67 |
//prerequisites
|
68 |
if ( ! $api_key ) {
|
69 |
-
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception( __( 'Missing required API Key',
|
70 |
}
|
71 |
|
72 |
$this->_api_key = $api_key;
|
@@ -198,7 +198,7 @@ class Forminator_Addon_Campaignmonitor_Wp_Api {
|
|
198 |
if ( is_wp_error( $res ) || ! $res ) {
|
199 |
forminator_addon_maybe_log( __METHOD__, $res );
|
200 |
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception(
|
201 |
-
__( 'Failed to process request, make sure your Webhook URL is correct and your server has internet connection.',
|
202 |
);
|
203 |
}
|
204 |
|
@@ -218,10 +218,10 @@ class Forminator_Addon_Campaignmonitor_Wp_Api {
|
|
218 |
|
219 |
if ( 404 === $status_code ) {
|
220 |
/* translators: ... */
|
221 |
-
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
222 |
}
|
223 |
/* translators: ... */
|
224 |
-
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
225 |
}
|
226 |
}
|
227 |
|
66 |
public function __construct( $api_key ) {
|
67 |
//prerequisites
|
68 |
if ( ! $api_key ) {
|
69 |
+
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception( __( 'Missing required API Key', 'forminator' ) );
|
70 |
}
|
71 |
|
72 |
$this->_api_key = $api_key;
|
198 |
if ( is_wp_error( $res ) || ! $res ) {
|
199 |
forminator_addon_maybe_log( __METHOD__, $res );
|
200 |
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception(
|
201 |
+
__( 'Failed to process request, make sure your Webhook URL is correct and your server has internet connection.', 'forminator' )
|
202 |
);
|
203 |
}
|
204 |
|
218 |
|
219 |
if ( 404 === $status_code ) {
|
220 |
/* translators: ... */
|
221 |
+
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
222 |
}
|
223 |
/* translators: ... */
|
224 |
+
throw new Forminator_Addon_Campaignmonitor_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
225 |
}
|
226 |
}
|
227 |
|
addons/pro/campaignmonitor/views/form-settings/map-fields.php
CHANGED
@@ -16,9 +16,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Assign Fields',
|
20 |
|
21 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( "Match up your form fields with your Campaign Monitor fields to make sure we're sending data to the right place.",
|
22 |
|
23 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<div class="sui-notice sui-notice-error">
|
@@ -35,8 +35,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
35 |
<thead>
|
36 |
|
37 |
<tr>
|
38 |
-
<th><?php esc_html_e( 'Campaign Monitor Field',
|
39 |
-
<th><?php esc_html_e( 'Forminator Field',
|
40 |
</tr>
|
41 |
|
42 |
</thead>
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
20 |
|
21 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( "Match up your form fields with your Campaign Monitor fields to make sure we're sending data to the right place.", 'forminator' ); ?></span>
|
22 |
|
23 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<div class="sui-notice sui-notice-error">
|
35 |
<thead>
|
36 |
|
37 |
<tr>
|
38 |
+
<th><?php esc_html_e( 'Campaign Monitor Field', 'forminator' ); ?></th>
|
39 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
40 |
</tr>
|
41 |
|
42 |
</thead>
|
addons/pro/campaignmonitor/views/form-settings/pick-name.php
CHANGED
@@ -14,9 +14,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
<div class="integration-header">
|
16 |
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
18 |
|
19 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
20 |
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -29,10 +29,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['name_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
30 |
style="margin-bottom: 0;">
|
31 |
|
32 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
33 |
|
34 |
<input name="name"
|
35 |
-
placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
36 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
37 |
class="sui-form-control" />
|
38 |
|
14 |
|
15 |
<div class="integration-header">
|
16 |
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
18 |
|
19 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></span>
|
20 |
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
29 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['name_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
30 |
style="margin-bottom: 0;">
|
31 |
|
32 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
33 |
|
34 |
<input name="name"
|
35 |
+
placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
36 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
37 |
class="sui-form-control" />
|
38 |
|
addons/pro/campaignmonitor/views/form-settings/setup-list.php
CHANGED
@@ -15,9 +15,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
|
16 |
<div class="integration-header">
|
17 |
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List',
|
19 |
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick Campaign Monitor List for new subscriber to be added to.',
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
@@ -32,10 +32,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
33 |
style="margin-bottom: 0;">
|
34 |
|
35 |
-
<label class="sui-label"><?php esc_html_e( 'List',
|
36 |
|
37 |
<select name="list_id" class="sui-select sui-form-control">
|
38 |
-
<option><?php esc_html_e( 'Please select a list',
|
39 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
40 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
41 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
15 |
|
16 |
<div class="integration-header">
|
17 |
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List', 'forminator' ) ); ?></h3>
|
19 |
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick Campaign Monitor List for new subscriber to be added to.', 'forminator' ); ?></span>
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
33 |
style="margin-bottom: 0;">
|
34 |
|
35 |
+
<label class="sui-label"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
36 |
|
37 |
<select name="list_id" class="sui-select sui-form-control">
|
38 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
39 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
40 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
41 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
addons/pro/campaignmonitor/views/form-settings/setup-options.php
CHANGED
@@ -18,9 +18,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
|
19 |
<div class="integration-header">
|
20 |
|
21 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
22 |
|
23 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for Campaign Monitor integration.',
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
@@ -46,13 +46,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
46 |
|
47 |
</label>
|
48 |
|
49 |
-
<label for="resubscribe" class="sui-toggle-label"><?php esc_html_e( 'Re-subscribe',
|
50 |
|
51 |
<?php if ( ! empty( $vars['resubscribe_error'] ) ) : ?>
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['resubscribe_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
|
55 |
-
<span class="sui-description"><?php esc_html_e( 'If the subscriber is in an inactive state or has previously been unsubscribed or added to the suppression list and you enabled Re-subscribe, they will be re-added to the list. Therefore, this options should be used with caution and only where suitable. If Re-subscribe is disabled, the subscriber will not be re-added to the active list.',
|
56 |
|
57 |
</div>
|
58 |
|
@@ -70,19 +70,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
70 |
|
71 |
</label>
|
72 |
|
73 |
-
<label class="sui-toggle-label" for="restart_subscription_based_autoresponders"><?php esc_html_e( 'Restart Subscription based Autoresponders',
|
74 |
|
75 |
<?php if ( ! empty( $vars['restart_subscription_based_autoresponders_error'] ) ) : ?>
|
76 |
<span class="sui-error-message"><?php echo esc_html( $vars['restart_subscription_based_autoresponders_error'] ); ?></span>
|
77 |
<?php endif; ?>
|
78 |
|
79 |
-
<span class="sui-description"><?php esc_html_e( 'By default, resubscribed subscribers will not restart any automated workflows, but they will receive any remaining emails. However, if you enable the Restart Subscription based Autoresponders, any sequences will be restarted. Restart Subscription based Autoresponders only affects resubscribing subscribers.',
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['consent_to_track_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
84 |
|
85 |
-
<label class="sui-label" for="consent_to_track"><?php esc_html_e( 'Consent to Track',
|
86 |
|
87 |
<select name="consent_to_track" id="consent_to_track" class="sui-select sui-form-control">
|
88 |
<option value="Unchanged" <?php selected( 'Unchanged', $vars['consent_to_track'] ); ?>>Unchanged</option>
|
@@ -94,7 +94,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
94 |
<span class="sui-error-message"><?php echo esc_html( $vars['consent_to_track_error'] ); ?></span>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
-
<span class="sui-description"><?php esc_html_e( 'Whether or not the subscriber has consented to having their email opens and clicks tracked. This value applies to all subscribers with the same email address, within the same client. If an email address has no value stored for Consent to Track, it is assumed that the subscriber has given consent. You can find more information ',
|
98 |
</span>
|
99 |
</div>
|
100 |
|
18 |
|
19 |
<div class="integration-header">
|
20 |
|
21 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
22 |
|
23 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for Campaign Monitor integration.', 'forminator' ); ?></span>
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
46 |
|
47 |
</label>
|
48 |
|
49 |
+
<label for="resubscribe" class="sui-toggle-label"><?php esc_html_e( 'Re-subscribe', 'forminator' ); ?></label>
|
50 |
|
51 |
<?php if ( ! empty( $vars['resubscribe_error'] ) ) : ?>
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['resubscribe_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
|
55 |
+
<span class="sui-description"><?php esc_html_e( 'If the subscriber is in an inactive state or has previously been unsubscribed or added to the suppression list and you enabled Re-subscribe, they will be re-added to the list. Therefore, this options should be used with caution and only where suitable. If Re-subscribe is disabled, the subscriber will not be re-added to the active list.', 'forminator' ); ?></span>
|
56 |
|
57 |
</div>
|
58 |
|
70 |
|
71 |
</label>
|
72 |
|
73 |
+
<label class="sui-toggle-label" for="restart_subscription_based_autoresponders"><?php esc_html_e( 'Restart Subscription based Autoresponders', 'forminator' ); ?></label>
|
74 |
|
75 |
<?php if ( ! empty( $vars['restart_subscription_based_autoresponders_error'] ) ) : ?>
|
76 |
<span class="sui-error-message"><?php echo esc_html( $vars['restart_subscription_based_autoresponders_error'] ); ?></span>
|
77 |
<?php endif; ?>
|
78 |
|
79 |
+
<span class="sui-description"><?php esc_html_e( 'By default, resubscribed subscribers will not restart any automated workflows, but they will receive any remaining emails. However, if you enable the Restart Subscription based Autoresponders, any sequences will be restarted. Restart Subscription based Autoresponders only affects resubscribing subscribers.', 'forminator' ); ?></span>
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['consent_to_track_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
84 |
|
85 |
+
<label class="sui-label" for="consent_to_track"><?php esc_html_e( 'Consent to Track', 'forminator' ); ?></label>
|
86 |
|
87 |
<select name="consent_to_track" id="consent_to_track" class="sui-select sui-form-control">
|
88 |
<option value="Unchanged" <?php selected( 'Unchanged', $vars['consent_to_track'] ); ?>>Unchanged</option>
|
94 |
<span class="sui-error-message"><?php echo esc_html( $vars['consent_to_track_error'] ); ?></span>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
+
<span class="sui-description"><?php esc_html_e( 'Whether or not the subscriber has consented to having their email opens and clicks tracked. This value applies to all subscribers with the same email address, within the same client. If an email address has no value stored for Consent to Track, it is assumed that the subscriber has given consent. You can find more information ', 'forminator' ); ?><a href="https://help.campaignmonitor.com/gdpr-faqs" target="_blank">here</a>.
|
98 |
</span>
|
99 |
</div>
|
100 |
|
addons/pro/campaignmonitor/views/quiz-settings/map-fields.php
CHANGED
@@ -17,9 +17,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Assign Fields',
|
21 |
|
22 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( "Match up your quiz lead fields with your Campaign Monitor fields to make sure we're sending data to the right place.",
|
23 |
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<div class="sui-notice sui-notice-error">
|
@@ -36,8 +36,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
36 |
<thead>
|
37 |
|
38 |
<tr>
|
39 |
-
<th><?php esc_html_e( 'Campaign Monitor Field',
|
40 |
-
<th><?php esc_html_e( 'Forminator Field',
|
41 |
</tr>
|
42 |
|
43 |
</thead>
|
@@ -73,7 +73,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
73 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
74 |
<label>
|
75 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
76 |
-
<option value=""><?php esc_html_e( 'None',
|
77 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
78 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
79 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Assign Fields', 'forminator' ) ); ?></h3>
|
21 |
|
22 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( "Match up your quiz lead fields with your Campaign Monitor fields to make sure we're sending data to the right place.", 'forminator' ); ?></span>
|
23 |
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<div class="sui-notice sui-notice-error">
|
36 |
<thead>
|
37 |
|
38 |
<tr>
|
39 |
+
<th><?php esc_html_e( 'Campaign Monitor Field', 'forminator' ); ?></th>
|
40 |
+
<th><?php esc_html_e( 'Forminator Field', 'forminator' ); ?></th>
|
41 |
</tr>
|
42 |
|
43 |
</thead>
|
73 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>">
|
74 |
<label>
|
75 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
76 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
77 |
<?php foreach ( $forminator_fields as $forminator_field ) : ?>
|
78 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
79 |
<?php selected( $current_selected, $forminator_field['element_id'] ); ?>>
|
addons/pro/campaignmonitor/views/quiz-settings/pick-name.php
CHANGED
@@ -14,9 +14,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
<div class="integration-header">
|
16 |
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
18 |
|
19 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
20 |
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -29,10 +29,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['name_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
30 |
style="margin-bottom: 0;">
|
31 |
|
32 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
33 |
|
34 |
<input name="name"
|
35 |
-
placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
36 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
37 |
class="sui-form-control" />
|
38 |
|
14 |
|
15 |
<div class="integration-header">
|
16 |
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
18 |
|
19 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></span>
|
20 |
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
29 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['name_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
30 |
style="margin-bottom: 0;">
|
31 |
|
32 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
33 |
|
34 |
<input name="name"
|
35 |
+
placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
36 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
37 |
class="sui-form-control" />
|
38 |
|
addons/pro/campaignmonitor/views/quiz-settings/setup-list.php
CHANGED
@@ -15,9 +15,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
|
16 |
<div class="integration-header">
|
17 |
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List',
|
19 |
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick Campaign Monitor List for new subscriber to be added to.',
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
@@ -32,10 +32,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
33 |
style="margin-bottom: 0;">
|
34 |
|
35 |
-
<label class="sui-label"><?php esc_html_e( 'List',
|
36 |
|
37 |
<select name="list_id" class="sui-select sui-form-control">
|
38 |
-
<option><?php esc_html_e( 'Please select a list',
|
39 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
40 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
41 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
15 |
|
16 |
<div class="integration-header">
|
17 |
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Choose List', 'forminator' ) ); ?></h3>
|
19 |
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Pick Campaign Monitor List for new subscriber to be added to.', 'forminator' ); ?></span>
|
21 |
|
22 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
23 |
<div class="sui-notice sui-notice-error">
|
32 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"
|
33 |
style="margin-bottom: 0;">
|
34 |
|
35 |
+
<label class="sui-label"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
36 |
|
37 |
<select name="list_id" class="sui-select sui-form-control">
|
38 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
39 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
40 |
<option value="<?php echo esc_attr( $list_id ); ?>"
|
41 |
<?php selected( $vars['list_id'], $list_id ); ?>>
|
addons/pro/campaignmonitor/views/quiz-settings/setup-options.php
CHANGED
@@ -18,9 +18,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
|
19 |
<div class="integration-header">
|
20 |
|
21 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options',
|
22 |
|
23 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for Campaign Monitor integration.',
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
@@ -46,13 +46,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
46 |
|
47 |
</label>
|
48 |
|
49 |
-
<label for="resubscribe" class="sui-toggle-label"><?php esc_html_e( 'Re-subscribe',
|
50 |
|
51 |
<?php if ( ! empty( $vars['resubscribe_error'] ) ) : ?>
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['resubscribe_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
|
55 |
-
<span class="sui-description"><?php esc_html_e( 'If the subscriber is in an inactive state or has previously been unsubscribed or added to the suppression list and you enabled Re-subscribe, they will be re-added to the list. Therefore, this options should be used with caution and only where suitable. If Re-subscribe is disabled, the subscriber will not be re-added to the active list.',
|
56 |
|
57 |
</div>
|
58 |
|
@@ -70,19 +70,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
70 |
|
71 |
</label>
|
72 |
|
73 |
-
<label class="sui-toggle-label" for="restart_subscription_based_autoresponders"><?php esc_html_e( 'Restart Subscription based Autoresponders',
|
74 |
|
75 |
<?php if ( ! empty( $vars['restart_subscription_based_autoresponders_error'] ) ) : ?>
|
76 |
<span class="sui-error-message"><?php echo esc_html( $vars['restart_subscription_based_autoresponders_error'] ); ?></span>
|
77 |
<?php endif; ?>
|
78 |
|
79 |
-
<span class="sui-description"><?php esc_html_e( 'By default, resubscribed subscribers will not restart any automated workflows, but they will receive any remaining emails. However, if you enable the Restart Subscription based Autoresponders, any sequences will be restarted. Restart Subscription based Autoresponders only affects resubscribing subscribers.',
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['consent_to_track_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
84 |
|
85 |
-
<label class="sui-label" for="consent_to_track"><?php esc_html_e( 'Consent to Track',
|
86 |
|
87 |
<select name="consent_to_track" id="consent_to_track" class="sui-select sui-form-control">
|
88 |
<option value="Unchanged" <?php selected( 'Unchanged', $vars['consent_to_track'] ); ?>>Unchanged</option>
|
@@ -94,7 +94,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
94 |
<span class="sui-error-message"><?php echo esc_html( $vars['consent_to_track_error'] ); ?></span>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
-
<span class="sui-description"><?php esc_html_e( 'Whether or not the subscriber has consented to having their email opens and clicks tracked. This value applies to all subscribers with the same email address, within the same client. If an email address has no value stored for Consent to Track, it is assumed that the subscriber has given consent. You can find more information ',
|
98 |
</span>
|
99 |
</div>
|
100 |
|
18 |
|
19 |
<div class="integration-header">
|
20 |
|
21 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Additional Options', 'forminator' ) ); ?></h3>
|
22 |
|
23 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Configure additional options for Campaign Monitor integration.', 'forminator' ); ?></span>
|
24 |
|
25 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
26 |
<div class="sui-notice sui-notice-error">
|
46 |
|
47 |
</label>
|
48 |
|
49 |
+
<label for="resubscribe" class="sui-toggle-label"><?php esc_html_e( 'Re-subscribe', 'forminator' ); ?></label>
|
50 |
|
51 |
<?php if ( ! empty( $vars['resubscribe_error'] ) ) : ?>
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['resubscribe_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
|
55 |
+
<span class="sui-description"><?php esc_html_e( 'If the subscriber is in an inactive state or has previously been unsubscribed or added to the suppression list and you enabled Re-subscribe, they will be re-added to the list. Therefore, this options should be used with caution and only where suitable. If Re-subscribe is disabled, the subscriber will not be re-added to the active list.', 'forminator' ); ?></span>
|
56 |
|
57 |
</div>
|
58 |
|
70 |
|
71 |
</label>
|
72 |
|
73 |
+
<label class="sui-toggle-label" for="restart_subscription_based_autoresponders"><?php esc_html_e( 'Restart Subscription based Autoresponders', 'forminator' ); ?></label>
|
74 |
|
75 |
<?php if ( ! empty( $vars['restart_subscription_based_autoresponders_error'] ) ) : ?>
|
76 |
<span class="sui-error-message"><?php echo esc_html( $vars['restart_subscription_based_autoresponders_error'] ); ?></span>
|
77 |
<?php endif; ?>
|
78 |
|
79 |
+
<span class="sui-description"><?php esc_html_e( 'By default, resubscribed subscribers will not restart any automated workflows, but they will receive any remaining emails. However, if you enable the Restart Subscription based Autoresponders, any sequences will be restarted. Restart Subscription based Autoresponders only affects resubscribing subscribers.', 'forminator' ); ?></span>
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['consent_to_track_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
84 |
|
85 |
+
<label class="sui-label" for="consent_to_track"><?php esc_html_e( 'Consent to Track', 'forminator' ); ?></label>
|
86 |
|
87 |
<select name="consent_to_track" id="consent_to_track" class="sui-select sui-form-control">
|
88 |
<option value="Unchanged" <?php selected( 'Unchanged', $vars['consent_to_track'] ); ?>>Unchanged</option>
|
94 |
<span class="sui-error-message"><?php echo esc_html( $vars['consent_to_track_error'] ); ?></span>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
+
<span class="sui-description"><?php esc_html_e( 'Whether or not the subscriber has consented to having their email opens and clicks tracked. This value applies to all subscribers with the same email address, within the same client. If an email address has no value stored for Consent to Track, it is assumed that the subscriber has given consent. You can find more information ', 'forminator' ); ?><a href="https://help.campaignmonitor.com/gdpr-faqs" target="_blank">here</a>.
|
98 |
</span>
|
99 |
</div>
|
100 |
|
addons/pro/campaignmonitor/views/settings/setup-api-success.php
CHANGED
@@ -3,10 +3,10 @@
|
|
3 |
<h3 id="dialogTitle2" class="sui-box-title">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
11 |
|
12 |
</div>
|
3 |
<h3 id="dialogTitle2" class="sui-box-title">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'Campaign Monitor' ) );
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></span>
|
11 |
|
12 |
</div>
|
addons/pro/campaignmonitor/views/settings/setup-api.php
CHANGED
@@ -19,15 +19,15 @@ foreach ( $template_vars as $key => $val ) {
|
|
19 |
<h3 id="dialogTitle2" class="sui-box-title">
|
20 |
<?php
|
21 |
/* translators: ... */
|
22 |
-
echo esc_html( sprintf( __( 'Configure %1$s API',
|
23 |
?>
|
24 |
</h3>
|
25 |
|
26 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup Campaign Monitor API Access.',
|
27 |
|
28 |
<?php if ( ! empty( $vars['client_name'] ) ) : ?>
|
29 |
<div class="sui-notice sui-notice-success">
|
30 |
-
<p><?php esc_html_e( 'Campaign Monitor Integrations currently connected to API Client: ',
|
31 |
</div>
|
32 |
<?php endif; ?>
|
33 |
|
@@ -43,12 +43,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
43 |
|
44 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_key_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
45 |
|
46 |
-
<label class="sui-label"><?php esc_html_e( 'API Key',
|
47 |
|
48 |
<div class="sui-control-with-icon">
|
49 |
|
50 |
<input name="api_key"
|
51 |
-
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API Key',
|
52 |
value="<?php echo esc_attr( $vars['api_key'] ); ?>"
|
53 |
class="sui-form-control" />
|
54 |
|
@@ -61,12 +61,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
61 |
<?php endif; ?>
|
62 |
|
63 |
<div class="sui-description">
|
64 |
-
<?php esc_html_e( 'To obtain Campaign Monitor API Credentials, follow these steps :',
|
65 |
<ol class="instructions" id="apikey-instructions">
|
66 |
<li>
|
67 |
<?php
|
68 |
echo sprintf(/* translators: ... */
|
69 |
-
esc_html__( 'Login to your Campaign Monitor account %1$shere%2$s.',
|
70 |
'<a href="https://login.createsend.com/l" target="_blank">',
|
71 |
'</a>'
|
72 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
@@ -75,7 +75,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
75 |
<li>
|
76 |
<?php
|
77 |
echo sprintf(/* translators: ... */
|
78 |
-
esc_html__( 'Go to Account Settings, then navigate to %1$sAPI Keys%2$s section.',
|
79 |
'<strong>',
|
80 |
'</strong>'
|
81 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
@@ -84,7 +84,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
84 |
<li>
|
85 |
<?php
|
86 |
echo sprintf(/* translators: ... */
|
87 |
-
esc_html__( 'Click on %1$sShow API Key%2$s, select and copy on the shown up value.',
|
88 |
'<strong>',
|
89 |
'</strong>'
|
90 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
@@ -97,12 +97,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
97 |
|
98 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
99 |
|
100 |
-
<label class="sui-label"><?php esc_html_e( 'Client ID',
|
101 |
|
102 |
<div class="sui-control-with-icon">
|
103 |
|
104 |
<input name="client_id"
|
105 |
-
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s Client ID',
|
106 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>"
|
107 |
class="sui-form-control" />
|
108 |
|
@@ -117,7 +117,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
117 |
<span class="sui-description">
|
118 |
<?php
|
119 |
echo sprintf(/* translators: ... */
|
120 |
-
esc_html__( 'Client ID is optional, unless you are on %1$sAgency-Mode%2$s, then you can find your desired Client ID on the %3$sAccount Settings%4$s > %5$sAPI Keys%6$s',
|
121 |
'<strong>',
|
122 |
'</strong>',
|
123 |
'<strong>',
|
19 |
<h3 id="dialogTitle2" class="sui-box-title">
|
20 |
<?php
|
21 |
/* translators: ... */
|
22 |
+
echo esc_html( sprintf( __( 'Configure %1$s API', 'forminator' ), 'Campaign Monitor' ) );
|
23 |
?>
|
24 |
</h3>
|
25 |
|
26 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Setup Campaign Monitor API Access.', 'forminator' ); ?></span>
|
27 |
|
28 |
<?php if ( ! empty( $vars['client_name'] ) ) : ?>
|
29 |
<div class="sui-notice sui-notice-success">
|
30 |
+
<p><?php esc_html_e( 'Campaign Monitor Integrations currently connected to API Client: ', 'forminator' ); ?> <strong><?php echo esc_html( $vars['client_name'] ); ?></strong></p>
|
31 |
</div>
|
32 |
<?php endif; ?>
|
33 |
|
43 |
|
44 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['api_key_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
45 |
|
46 |
+
<label class="sui-label"><?php esc_html_e( 'API Key', 'forminator' ); ?></label>
|
47 |
|
48 |
<div class="sui-control-with-icon">
|
49 |
|
50 |
<input name="api_key"
|
51 |
+
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s API Key', 'forminator' ), 'Campaign Monitor' ) ); ?>"
|
52 |
value="<?php echo esc_attr( $vars['api_key'] ); ?>"
|
53 |
class="sui-form-control" />
|
54 |
|
61 |
<?php endif; ?>
|
62 |
|
63 |
<div class="sui-description">
|
64 |
+
<?php esc_html_e( 'To obtain Campaign Monitor API Credentials, follow these steps :', 'forminator' ); ?>
|
65 |
<ol class="instructions" id="apikey-instructions">
|
66 |
<li>
|
67 |
<?php
|
68 |
echo sprintf(/* translators: ... */
|
69 |
+
esc_html__( 'Login to your Campaign Monitor account %1$shere%2$s.', 'forminator' ),
|
70 |
'<a href="https://login.createsend.com/l" target="_blank">',
|
71 |
'</a>'
|
72 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
75 |
<li>
|
76 |
<?php
|
77 |
echo sprintf(/* translators: ... */
|
78 |
+
esc_html__( 'Go to Account Settings, then navigate to %1$sAPI Keys%2$s section.', 'forminator' ),
|
79 |
'<strong>',
|
80 |
'</strong>'
|
81 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
84 |
<li>
|
85 |
<?php
|
86 |
echo sprintf(/* translators: ... */
|
87 |
+
esc_html__( 'Click on %1$sShow API Key%2$s, select and copy on the shown up value.', 'forminator' ),
|
88 |
'<strong>',
|
89 |
'</strong>'
|
90 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
97 |
|
98 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
99 |
|
100 |
+
<label class="sui-label"><?php esc_html_e( 'Client ID', 'forminator' ); ?></label>
|
101 |
|
102 |
<div class="sui-control-with-icon">
|
103 |
|
104 |
<input name="client_id"
|
105 |
+
placeholder="<?php /* translators: ... */ echo esc_attr( sprintf( __( 'Enter %1$s Client ID', 'forminator' ), 'Campaign Monitor' ) ); ?>"
|
106 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>"
|
107 |
class="sui-form-control" />
|
108 |
|
117 |
<span class="sui-description">
|
118 |
<?php
|
119 |
echo sprintf(/* translators: ... */
|
120 |
+
esc_html__( 'Client ID is optional, unless you are on %1$sAgency-Mode%2$s, then you can find your desired Client ID on the %3$sAccount Settings%4$s > %5$sAPI Keys%6$s', 'forminator' ),
|
121 |
'<strong>',
|
122 |
'</strong>',
|
123 |
'<strong>',
|
addons/pro/fortressdb/class-fortressdb-forminator.php
CHANGED
@@ -117,11 +117,11 @@ final class FortressDB_Forminator_Addon extends Forminator_Addon_Abstract {
|
|
117 |
<h3 id="dialogTitle2" class="sui-box-title">
|
118 |
<?php
|
119 |
/* translators: ... */
|
120 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
121 |
?>
|
122 |
</h3>
|
123 |
|
124 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Install the FortressDB plugin and sign-in to your FortressDB account to automatically connect it to Forminator. If you do not have an account, you can create a new free account within the FortressDB plugin.',
|
125 |
|
126 |
</div>
|
127 |
|
@@ -135,7 +135,7 @@ final class FortressDB_Forminator_Addon extends Forminator_Addon_Abstract {
|
|
135 |
admin_url( 'plugin-install.php?s=fortressdb&tab=search&type=term' );
|
136 |
|
137 |
$buttons['close'] = array(
|
138 |
-
'markup' => self::get_link_markup( $fortress_install_url, esc_html__( 'Install FortressDB',
|
139 |
);
|
140 |
|
141 |
$has_errors = false;
|
117 |
<h3 id="dialogTitle2" class="sui-box-title">
|
118 |
<?php
|
119 |
/* translators: ... */
|
120 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'FortressDB' ) );
|
121 |
?>
|
122 |
</h3>
|
123 |
|
124 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Install the FortressDB plugin and sign-in to your FortressDB account to automatically connect it to Forminator. If you do not have an account, you can create a new free account within the FortressDB plugin.', 'forminator' ); ?></span>
|
125 |
|
126 |
</div>
|
127 |
|
135 |
admin_url( 'plugin-install.php?s=fortressdb&tab=search&type=term' );
|
136 |
|
137 |
$buttons['close'] = array(
|
138 |
+
'markup' => self::get_link_markup( $fortress_install_url, esc_html__( 'Install FortressDB', 'forminator' ), '_self', 'forminator-addon-close' ),
|
139 |
);
|
140 |
|
141 |
$has_errors = false;
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Googlesheet_Form_Hooks extends Forminator_Addon_Form_Hook
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'Google Sheets failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -306,7 +306,7 @@ class Forminator_Addon_Googlesheet_Form_Hooks extends Forminator_Addon_Form_Hook
|
|
306 |
return array(
|
307 |
'is_sent' => true,
|
308 |
'connection_name' => $connection_settings['name'],
|
309 |
-
'description' => __( 'Successfully send data to Google Sheets',
|
310 |
);
|
311 |
|
312 |
} catch ( Forminator_Google_Exception $e ) {
|
@@ -347,16 +347,16 @@ class Forminator_Addon_Googlesheet_Form_Hooks extends Forminator_Addon_Form_Hook
|
|
347 |
$sheets = $spreadsheet->getSheets();
|
348 |
|
349 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
350 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found',
|
351 |
}
|
352 |
$sheet_id = $sheets[0]->properties->sheetId;
|
353 |
|
354 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
355 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found',
|
356 |
}
|
357 |
|
358 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
359 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet',
|
360 |
}
|
361 |
|
362 |
$sheet_title = $sheets[0]->properties->title;
|
@@ -564,29 +564,29 @@ class Forminator_Addon_Googlesheet_Form_Hooks extends Forminator_Addon_Form_Hook
|
|
564 |
}
|
565 |
$status = $addon_meta_data['value'];
|
566 |
$additional_entry_item = array(
|
567 |
-
'label' => __( 'Google Sheets Integration',
|
568 |
'value' => '',
|
569 |
);
|
570 |
|
571 |
$sub_entries = array();
|
572 |
if ( isset( $status['connection_name'] ) ) {
|
573 |
$sub_entries[] = array(
|
574 |
-
'label' => __( 'Integration Name',
|
575 |
'value' => $status['connection_name'],
|
576 |
);
|
577 |
}
|
578 |
|
579 |
if ( isset( $status['is_sent'] ) ) {
|
580 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
581 |
$sub_entries[] = array(
|
582 |
-
'label' => __( 'Sent To Google Sheets',
|
583 |
'value' => $is_sent,
|
584 |
);
|
585 |
}
|
586 |
|
587 |
if ( isset( $status['description'] ) ) {
|
588 |
$sub_entries[] = array(
|
589 |
-
'label' => __( 'Info',
|
590 |
'value' => $status['description'],
|
591 |
);
|
592 |
}
|
@@ -607,7 +607,7 @@ class Forminator_Addon_Googlesheet_Form_Hooks extends Forminator_Addon_Form_Hook
|
|
607 |
public function on_export_render_title_row() {
|
608 |
|
609 |
$export_headers = array(
|
610 |
-
'info' => __( 'Google Sheets Info',
|
611 |
);
|
612 |
|
613 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'Google Sheets failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
306 |
return array(
|
307 |
'is_sent' => true,
|
308 |
'connection_name' => $connection_settings['name'],
|
309 |
+
'description' => __( 'Successfully send data to Google Sheets', 'forminator' ),
|
310 |
);
|
311 |
|
312 |
} catch ( Forminator_Google_Exception $e ) {
|
347 |
$sheets = $spreadsheet->getSheets();
|
348 |
|
349 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
350 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found', 'forminator' ) );
|
351 |
}
|
352 |
$sheet_id = $sheets[0]->properties->sheetId;
|
353 |
|
354 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
355 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found', 'forminator' ) );
|
356 |
}
|
357 |
|
358 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
359 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet', 'forminator' ) );
|
360 |
}
|
361 |
|
362 |
$sheet_title = $sheets[0]->properties->title;
|
564 |
}
|
565 |
$status = $addon_meta_data['value'];
|
566 |
$additional_entry_item = array(
|
567 |
+
'label' => __( 'Google Sheets Integration', 'forminator' ),
|
568 |
'value' => '',
|
569 |
);
|
570 |
|
571 |
$sub_entries = array();
|
572 |
if ( isset( $status['connection_name'] ) ) {
|
573 |
$sub_entries[] = array(
|
574 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
575 |
'value' => $status['connection_name'],
|
576 |
);
|
577 |
}
|
578 |
|
579 |
if ( isset( $status['is_sent'] ) ) {
|
580 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
581 |
$sub_entries[] = array(
|
582 |
+
'label' => __( 'Sent To Google Sheets', 'forminator' ),
|
583 |
'value' => $is_sent,
|
584 |
);
|
585 |
}
|
586 |
|
587 |
if ( isset( $status['description'] ) ) {
|
588 |
$sub_entries[] = array(
|
589 |
+
'label' => __( 'Info', 'forminator' ),
|
590 |
'value' => $status['description'],
|
591 |
);
|
592 |
}
|
607 |
public function on_export_render_title_row() {
|
608 |
|
609 |
$export_headers = array(
|
610 |
+
'info' => __( 'Google Sheets Info', 'forminator' ),
|
611 |
);
|
612 |
|
613 |
$form_id = $this->form_id;
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-form-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -110,14 +110,14 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
-
esc_html__( 'Deactivate',
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
-
esc_html__( 'Deactivate Google Sheets Integration from this Form.',
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
@@ -170,7 +170,7 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
170 |
$template = forminator_addon_googlesheet_dir() . 'views/form-settings/setup-sheet.php';
|
171 |
|
172 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
173 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
174 |
}
|
175 |
|
176 |
$multi_id = $submitted_data['multi_id'];
|
@@ -199,7 +199,7 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
199 |
try {
|
200 |
$input_exceptions = new Forminator_Addon_Googlesheet_Form_Settings_Exception();
|
201 |
if ( empty( $file_name ) ) {
|
202 |
-
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name',
|
203 |
}
|
204 |
|
205 |
$google_client = $this->addon->get_google_client();
|
@@ -213,12 +213,12 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
213 |
// its from API var
|
214 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
215 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
216 |
-
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.',
|
217 |
}
|
218 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
219 |
// catch 404
|
220 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
221 |
-
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.',
|
222 |
} else {
|
223 |
throw $google_exception;
|
224 |
}
|
@@ -271,14 +271,14 @@ class Forminator_Addon_Googlesheet_Form_Settings extends Forminator_Addon_Form_S
|
|
271 |
$buttons = array();
|
272 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
273 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
274 |
-
esc_html__( 'Deactivate',
|
275 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
276 |
-
esc_html__( 'Deactivate Google Sheets Integration from this Form.',
|
277 |
);
|
278 |
}
|
279 |
|
280 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
281 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create',
|
282 |
'</div>';
|
283 |
|
284 |
return array(
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
+
esc_html__( 'Deactivate Google Sheets Integration from this Form.', 'forminator' )
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
170 |
$template = forminator_addon_googlesheet_dir() . 'views/form-settings/setup-sheet.php';
|
171 |
|
172 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
173 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
174 |
}
|
175 |
|
176 |
$multi_id = $submitted_data['multi_id'];
|
199 |
try {
|
200 |
$input_exceptions = new Forminator_Addon_Googlesheet_Form_Settings_Exception();
|
201 |
if ( empty( $file_name ) ) {
|
202 |
+
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name', 'forminator' ), 'file_name_error' );
|
203 |
}
|
204 |
|
205 |
$google_client = $this->addon->get_google_client();
|
213 |
// its from API var
|
214 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
215 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
216 |
+
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.', 'forminator' ), 'folder_id_error' );
|
217 |
}
|
218 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
219 |
// catch 404
|
220 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
221 |
+
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.', 'forminator' ), 'folder_id_error' );
|
222 |
} else {
|
223 |
throw $google_exception;
|
224 |
}
|
271 |
$buttons = array();
|
272 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
273 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
274 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
275 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
276 |
+
esc_html__( 'Deactivate Google Sheets Integration from this Form.', 'forminator' )
|
277 |
);
|
278 |
}
|
279 |
|
280 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
281 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create', 'forminator' ), 'forminator-addon-next' ) .
|
282 |
'</div>';
|
283 |
|
284 |
return array(
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-poll-hooks.php
CHANGED
@@ -45,7 +45,7 @@ class Forminator_Addon_Googlesheet_Poll_Hooks extends Forminator_Addon_Poll_Hook
|
|
45 |
*/
|
46 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
47 |
parent::__construct( $addon, $poll_id );
|
48 |
-
$this->_submit_poll_error_message = __( 'Google Sheets failed to process submitted data. Please check your poll and try again',
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -299,7 +299,7 @@ class Forminator_Addon_Googlesheet_Poll_Hooks extends Forminator_Addon_Poll_Hook
|
|
299 |
return array(
|
300 |
'is_sent' => true,
|
301 |
'connection_name' => $connection_settings['name'],
|
302 |
-
'description' => __( 'Successfully send data to Google Sheets',
|
303 |
);
|
304 |
|
305 |
} catch ( Forminator_Google_Exception $e ) {
|
@@ -350,15 +350,15 @@ class Forminator_Addon_Googlesheet_Poll_Hooks extends Forminator_Addon_Poll_Hook
|
|
350 |
$sheets = $spreadsheet->getSheets();
|
351 |
|
352 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
353 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found',
|
354 |
}
|
355 |
|
356 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
357 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found',
|
358 |
}
|
359 |
|
360 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
361 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet',
|
362 |
}
|
363 |
|
364 |
$sheet_title = $sheets[0]->properties->title;
|
@@ -496,7 +496,7 @@ class Forminator_Addon_Googlesheet_Poll_Hooks extends Forminator_Addon_Poll_Hook
|
|
496 |
public function on_export_render_title_row() {
|
497 |
|
498 |
$export_headers = array(
|
499 |
-
'info' => __( 'Google Sheets Info',
|
500 |
);
|
501 |
|
502 |
$poll_id = $this->poll_id;
|
45 |
*/
|
46 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
47 |
parent::__construct( $addon, $poll_id );
|
48 |
+
$this->_submit_poll_error_message = __( 'Google Sheets failed to process submitted data. Please check your poll and try again', 'forminator' );
|
49 |
}
|
50 |
|
51 |
/**
|
299 |
return array(
|
300 |
'is_sent' => true,
|
301 |
'connection_name' => $connection_settings['name'],
|
302 |
+
'description' => __( 'Successfully send data to Google Sheets', 'forminator' ),
|
303 |
);
|
304 |
|
305 |
} catch ( Forminator_Google_Exception $e ) {
|
350 |
$sheets = $spreadsheet->getSheets();
|
351 |
|
352 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
353 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found', 'forminator' ) );
|
354 |
}
|
355 |
|
356 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
357 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found', 'forminator' ) );
|
358 |
}
|
359 |
|
360 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
361 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet', 'forminator' ) );
|
362 |
}
|
363 |
|
364 |
$sheet_title = $sheets[0]->properties->title;
|
496 |
public function on_export_render_title_row() {
|
497 |
|
498 |
$export_headers = array(
|
499 |
+
'info' => __( 'Google Sheets Info', 'forminator' ),
|
500 |
);
|
501 |
|
502 |
$poll_id = $this->poll_id;
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-poll-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
31 |
|
32 |
$this->_update_poll_settings_error_message = __(
|
33 |
'The update to your settings for this poll failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -110,14 +110,14 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
-
esc_html__( 'Deactivate',
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
-
esc_html__( 'Deactivate this Google Sheets Integration from this Poll.',
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
@@ -142,7 +142,7 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
142 |
$template = forminator_addon_googlesheet_dir() . 'views/poll-settings/setup-sheet.php';
|
143 |
|
144 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
145 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
146 |
}
|
147 |
|
148 |
$multi_id = $submitted_data['multi_id'];
|
@@ -171,7 +171,7 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
171 |
try {
|
172 |
$input_exceptions = new Forminator_Addon_Googlesheet_Poll_Settings_Exception();
|
173 |
if ( empty( $file_name ) ) {
|
174 |
-
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name',
|
175 |
}
|
176 |
|
177 |
$google_client = $this->addon->get_google_client();
|
@@ -185,12 +185,12 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
185 |
// its from API var
|
186 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
187 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
188 |
-
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.',
|
189 |
}
|
190 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
191 |
// catch 404
|
192 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
193 |
-
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.',
|
194 |
} else {
|
195 |
throw $google_exception;
|
196 |
}
|
@@ -243,14 +243,14 @@ class Forminator_Addon_Googlesheet_Poll_Settings extends Forminator_Addon_Poll_S
|
|
243 |
$buttons = array();
|
244 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
245 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
246 |
-
esc_html__( 'Deactivate',
|
247 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
248 |
-
esc_html__( 'Deactivate this Google Sheets Integration from this Poll.',
|
249 |
);
|
250 |
}
|
251 |
|
252 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
253 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create',
|
254 |
'</div>';
|
255 |
|
256 |
return array(
|
31 |
|
32 |
$this->_update_poll_settings_error_message = __(
|
33 |
'The update to your settings for this poll failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
+
esc_html__( 'Deactivate this Google Sheets Integration from this Poll.', 'forminator' )
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
142 |
$template = forminator_addon_googlesheet_dir() . 'views/poll-settings/setup-sheet.php';
|
143 |
|
144 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
145 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
146 |
}
|
147 |
|
148 |
$multi_id = $submitted_data['multi_id'];
|
171 |
try {
|
172 |
$input_exceptions = new Forminator_Addon_Googlesheet_Poll_Settings_Exception();
|
173 |
if ( empty( $file_name ) ) {
|
174 |
+
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name', 'forminator' ), 'file_name_error' );
|
175 |
}
|
176 |
|
177 |
$google_client = $this->addon->get_google_client();
|
185 |
// its from API var
|
186 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
187 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
188 |
+
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.', 'forminator' ), 'folder_id_error' );
|
189 |
}
|
190 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
191 |
// catch 404
|
192 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
193 |
+
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.', 'forminator' ), 'folder_id_error' );
|
194 |
} else {
|
195 |
throw $google_exception;
|
196 |
}
|
243 |
$buttons = array();
|
244 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
245 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
246 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
247 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
248 |
+
esc_html__( 'Deactivate this Google Sheets Integration from this Poll.', 'forminator' )
|
249 |
);
|
250 |
}
|
251 |
|
252 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
253 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create', 'forminator' ), 'forminator-addon-next' ) .
|
254 |
'</div>';
|
255 |
|
256 |
return array(
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-quiz-hooks.php
CHANGED
@@ -47,7 +47,7 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
47 |
*/
|
48 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
49 |
parent::__construct( $addon, $quiz_id );
|
50 |
-
$this->_submit_quiz_error_message = __( 'Google Sheets failed to process submitted data. Please check your quiz and try again',
|
51 |
}
|
52 |
|
53 |
/**
|
@@ -244,7 +244,7 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
244 |
$answers[] = array(
|
245 |
'question' => $question,
|
246 |
'answer' => $answer,
|
247 |
-
'result' => $is_correct ? __( 'Correct',
|
248 |
);
|
249 |
}
|
250 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
@@ -380,7 +380,7 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
380 |
}
|
381 |
|
382 |
if ( empty( $requests ) ) {
|
383 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No data to be send to GoogleSheet',
|
384 |
}
|
385 |
|
386 |
// Prepare the update
|
@@ -404,7 +404,7 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
404 |
return array(
|
405 |
'is_sent' => true,
|
406 |
'connection_name' => $connection_settings['name'],
|
407 |
-
'description' => __( 'Successfully send data to Google Sheets',
|
408 |
);
|
409 |
|
410 |
} catch ( Forminator_Google_Exception $e ) {
|
@@ -456,15 +456,15 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
456 |
$sheets = $spreadsheet->getSheets();
|
457 |
|
458 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
459 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found',
|
460 |
}
|
461 |
|
462 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
463 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found',
|
464 |
}
|
465 |
|
466 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
467 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet',
|
468 |
}
|
469 |
|
470 |
$sheet_title = $sheets[0]->properties->title;
|
@@ -619,7 +619,7 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
619 |
public function on_export_render_title_row() {
|
620 |
|
621 |
$export_headers = array(
|
622 |
-
'info' => __( 'Google Sheets Info',
|
623 |
);
|
624 |
|
625 |
$quiz_id = $this->quiz;
|
@@ -784,29 +784,29 @@ class Forminator_Addon_Googlesheet_Quiz_Hooks extends Forminator_Addon_Quiz_Hook
|
|
784 |
}
|
785 |
$status = $addon_meta_data['value'];
|
786 |
$additional_entry_item = array(
|
787 |
-
'label' => __( 'Google Sheets Integration',
|
788 |
'value' => '',
|
789 |
);
|
790 |
|
791 |
$sub_entries = array();
|
792 |
if ( isset( $status['connection_name'] ) ) {
|
793 |
$sub_entries[] = array(
|
794 |
-
'label' => __( 'Integration Name',
|
795 |
'value' => $status['connection_name'],
|
796 |
);
|
797 |
}
|
798 |
|
799 |
if ( isset( $status['is_sent'] ) ) {
|
800 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
801 |
$sub_entries[] = array(
|
802 |
-
'label' => __( 'Sent To Google Sheets',
|
803 |
'value' => $is_sent,
|
804 |
);
|
805 |
}
|
806 |
|
807 |
if ( isset( $status['description'] ) ) {
|
808 |
$sub_entries[] = array(
|
809 |
-
'label' => __( 'Info',
|
810 |
'value' => $status['description'],
|
811 |
);
|
812 |
}
|
47 |
*/
|
48 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
49 |
parent::__construct( $addon, $quiz_id );
|
50 |
+
$this->_submit_quiz_error_message = __( 'Google Sheets failed to process submitted data. Please check your quiz and try again', 'forminator' );
|
51 |
}
|
52 |
|
53 |
/**
|
244 |
$answers[] = array(
|
245 |
'question' => $question,
|
246 |
'answer' => $answer,
|
247 |
+
'result' => $is_correct ? __( 'Correct', 'forminator' ) : __( 'Incorrect', 'forminator' ),
|
248 |
);
|
249 |
}
|
250 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
380 |
}
|
381 |
|
382 |
if ( empty( $requests ) ) {
|
383 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No data to be send to GoogleSheet', 'forminator' ) );
|
384 |
}
|
385 |
|
386 |
// Prepare the update
|
404 |
return array(
|
405 |
'is_sent' => true,
|
406 |
'connection_name' => $connection_settings['name'],
|
407 |
+
'description' => __( 'Successfully send data to Google Sheets', 'forminator' ),
|
408 |
);
|
409 |
|
410 |
} catch ( Forminator_Google_Exception $e ) {
|
456 |
$sheets = $spreadsheet->getSheets();
|
457 |
|
458 |
if ( ! isset( $sheets[0] ) || ! isset( $sheets[0]->properties ) ) {
|
459 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No sheet found', 'forminator' ) );
|
460 |
}
|
461 |
|
462 |
if ( ! isset( $sheets[0]->properties->title ) || empty( $sheets[0]->properties->title ) ) {
|
463 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Sheet title not found', 'forminator' ) );
|
464 |
}
|
465 |
|
466 |
if ( ! isset( $sheets[0]->properties->gridProperties ) || ! isset( $sheets[0]->properties->gridProperties->columnCount ) ) {
|
467 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get column count of the sheet', 'forminator' ) );
|
468 |
}
|
469 |
|
470 |
$sheet_title = $sheets[0]->properties->title;
|
619 |
public function on_export_render_title_row() {
|
620 |
|
621 |
$export_headers = array(
|
622 |
+
'info' => __( 'Google Sheets Info', 'forminator' ),
|
623 |
);
|
624 |
|
625 |
$quiz_id = $this->quiz;
|
784 |
}
|
785 |
$status = $addon_meta_data['value'];
|
786 |
$additional_entry_item = array(
|
787 |
+
'label' => __( 'Google Sheets Integration', 'forminator' ),
|
788 |
'value' => '',
|
789 |
);
|
790 |
|
791 |
$sub_entries = array();
|
792 |
if ( isset( $status['connection_name'] ) ) {
|
793 |
$sub_entries[] = array(
|
794 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
795 |
'value' => $status['connection_name'],
|
796 |
);
|
797 |
}
|
798 |
|
799 |
if ( isset( $status['is_sent'] ) ) {
|
800 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
801 |
$sub_entries[] = array(
|
802 |
+
'label' => __( 'Sent To Google Sheets', 'forminator' ),
|
803 |
'value' => $is_sent,
|
804 |
);
|
805 |
}
|
806 |
|
807 |
if ( isset( $status['description'] ) ) {
|
808 |
$sub_entries[] = array(
|
809 |
+
'label' => __( 'Info', 'forminator' ),
|
810 |
'value' => $status['description'],
|
811 |
);
|
812 |
}
|
addons/pro/googlesheet/class-forminator-addon-googlesheet-quiz-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -110,14 +110,14 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
-
esc_html__( 'Deactivate',
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
-
esc_html__( 'Deactivate Google Sheets Integration from this Quiz.',
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
@@ -142,7 +142,7 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
142 |
$template = forminator_addon_googlesheet_dir() . 'views/quiz-settings/setup-sheet.php';
|
143 |
|
144 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
145 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
146 |
}
|
147 |
|
148 |
$multi_id = $submitted_data['multi_id'];
|
@@ -171,7 +171,7 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
171 |
try {
|
172 |
$input_exceptions = new Forminator_Addon_Googlesheet_Quiz_Settings_Exception();
|
173 |
if ( empty( $file_name ) ) {
|
174 |
-
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name',
|
175 |
}
|
176 |
|
177 |
$google_client = $this->addon->get_google_client();
|
@@ -185,12 +185,12 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
185 |
// its from API var
|
186 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
187 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
188 |
-
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.',
|
189 |
}
|
190 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
191 |
// catch 404
|
192 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
193 |
-
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.',
|
194 |
} else {
|
195 |
throw $google_exception;
|
196 |
}
|
@@ -243,14 +243,14 @@ class Forminator_Addon_Googlesheet_Quiz_Settings extends Forminator_Addon_Quiz_S
|
|
243 |
$buttons = array();
|
244 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
245 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
246 |
-
esc_html__( 'Deactivate',
|
247 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
248 |
-
esc_html__( 'Deactivate Google Sheets Integration from this quiz.',
|
249 |
);
|
250 |
}
|
251 |
|
252 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
253 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create',
|
254 |
'</div>';
|
255 |
|
256 |
return array(
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
110 |
$buttons = array();
|
111 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
112 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
113 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
114 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
115 |
+
esc_html__( 'Deactivate Google Sheets Integration from this Quiz.', 'forminator' )
|
116 |
);
|
117 |
}
|
118 |
|
119 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
120 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
121 |
'</div>';
|
122 |
|
123 |
return array(
|
142 |
$template = forminator_addon_googlesheet_dir() . 'views/quiz-settings/setup-sheet.php';
|
143 |
|
144 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
145 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
146 |
}
|
147 |
|
148 |
$multi_id = $submitted_data['multi_id'];
|
171 |
try {
|
172 |
$input_exceptions = new Forminator_Addon_Googlesheet_Quiz_Settings_Exception();
|
173 |
if ( empty( $file_name ) ) {
|
174 |
+
$input_exceptions->add_input_exception( __( 'Please put valid spread sheet name', 'forminator' ), 'file_name_error' );
|
175 |
}
|
176 |
|
177 |
$google_client = $this->addon->get_google_client();
|
185 |
// its from API var
|
186 |
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.NotSnakeCaseMemberVar
|
187 |
if ( Forminator_Addon_Googlesheet::MIME_TYPE_GOOGLE_DRIVE_FOLDER !== $folder->mimeType ) {
|
188 |
+
$input_exceptions->add_input_exception( __( 'This is not a folder, please use a valid Folder ID.', 'forminator' ), 'folder_id_error' );
|
189 |
}
|
190 |
} catch ( Forminator_Google_Exception $google_exception ) {
|
191 |
// catch 404
|
192 |
if ( false !== stripos( $google_exception->getMessage(), 'File not found' ) ) {
|
193 |
+
$input_exceptions->add_input_exception( __( 'Folder not found, please put Folder ID.', 'forminator' ), 'folder_id_error' );
|
194 |
} else {
|
195 |
throw $google_exception;
|
196 |
}
|
243 |
$buttons = array();
|
244 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
245 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
246 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
247 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
248 |
+
esc_html__( 'Deactivate Google Sheets Integration from this quiz.', 'forminator' )
|
249 |
);
|
250 |
}
|
251 |
|
252 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
253 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Create', 'forminator' ), 'forminator-addon-next' ) .
|
254 |
'</div>';
|
255 |
|
256 |
return array(
|
addons/pro/googlesheet/class-forminator-addon-googlesheet.php
CHANGED
@@ -46,13 +46,13 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
46 |
*/
|
47 |
public function __construct() {
|
48 |
// late init to allow translation
|
49 |
-
$this->_description = __( 'Get awesome by your form.',
|
50 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate GoogleSheet Integration, don\'t hesitate to contact us',
|
51 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate GoogleSheet Integration, please try again',
|
52 |
|
53 |
$this->_update_settings_error_message = __(
|
54 |
'Sorry, we failed to update settings, please check your form and try again',
|
55 |
-
|
56 |
);
|
57 |
|
58 |
$this->_icon = forminator_addon_googlesheet_assets_url() . 'icons/googlesheet.png';
|
@@ -86,7 +86,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
86 |
try {
|
87 |
// check if its active
|
88 |
if ( ! $this->is_active() ) {
|
89 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Google Sheets is not active',
|
90 |
}
|
91 |
|
92 |
$is_connected = false;
|
@@ -124,17 +124,17 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
124 |
try {
|
125 |
$form_settings_instance = null;
|
126 |
if ( ! $this->is_connected() ) {
|
127 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected',
|
128 |
}
|
129 |
|
130 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
131 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Googlesheet_Form_Settings ) {
|
132 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Form Settings of GoogleSheet',
|
133 |
}
|
134 |
|
135 |
// Mark as active when there is at least one active connection
|
136 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
137 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this form',
|
138 |
}
|
139 |
|
140 |
$is_form_connected = true;
|
@@ -241,14 +241,14 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
241 |
$buttons = array();
|
242 |
if ( $this->is_connected() ) {
|
243 |
$buttons['disconnect'] = array(
|
244 |
-
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT',
|
245 |
);
|
246 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
247 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'RE-AUTHORIZE',
|
248 |
'</div>';
|
249 |
} else {
|
250 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
251 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next',
|
252 |
'</div>';
|
253 |
}
|
254 |
|
@@ -293,12 +293,12 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
293 |
$client_secret = isset( $submitted_data['client_secret'] ) ? $submitted_data['client_secret'] : '';
|
294 |
|
295 |
if ( empty( $client_id ) ) {
|
296 |
-
$template_params['client_id_error'] = __( 'Please input valid Client ID',
|
297 |
$has_errors = true;
|
298 |
}
|
299 |
|
300 |
if ( empty( $client_secret ) ) {
|
301 |
-
$template_params['client_secret_error'] = __( 'Please input valid Client Secret',
|
302 |
$has_errors = true;
|
303 |
}
|
304 |
|
@@ -362,7 +362,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
362 |
$buttons = array();
|
363 |
if ( $this->is_connected() ) {
|
364 |
$buttons['disconnect'] = array(
|
365 |
-
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT',
|
366 |
);
|
367 |
}
|
368 |
|
@@ -405,7 +405,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
405 |
|
406 |
if ( $this->_token ) {
|
407 |
$buttons['close'] = array(
|
408 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
409 |
);
|
410 |
$is_poll = false;
|
411 |
|
@@ -577,7 +577,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
577 |
$google_client->authenticate( $query_args['code'] );
|
578 |
$token = $google_client->getAccessToken();
|
579 |
if ( empty( $token ) ) {
|
580 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get token',
|
581 |
}
|
582 |
|
583 |
if ( ! $this->is_active() ) {
|
@@ -620,7 +620,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
620 |
$config = new Forminator_Google_Config();
|
621 |
$config->setLoggerClass( 'Forminator_Addon_Wp_Googlesheet_Client_Logger' );
|
622 |
$google_client = new Forminator_Google_Client( $config );
|
623 |
-
$google_client->setApplicationName( __( 'Forminator Pro',
|
624 |
$google_client->setClientId( $client_id );
|
625 |
$google_client->setClientSecret( $client_secret );
|
626 |
$google_client->setScopes( $scopes );
|
@@ -677,7 +677,7 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
677 |
$revoked = $google_client->revokeToken();
|
678 |
|
679 |
if ( ! $revoked ) {
|
680 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to revoke access token',
|
681 |
}
|
682 |
$this->_token = '';
|
683 |
} catch ( Forminator_Addon_Googlesheet_Exception $e ) {
|
@@ -704,17 +704,17 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
704 |
try {
|
705 |
$poll_settings_instance = null;
|
706 |
if ( ! $this->is_connected() ) {
|
707 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected',
|
708 |
}
|
709 |
|
710 |
$poll_settings_instance = $this->get_addon_poll_settings( $poll_id );
|
711 |
if ( ! $poll_settings_instance instanceof Forminator_Addon_Googlesheet_Poll_Settings ) {
|
712 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Poll Settings of GoogleSheet',
|
713 |
}
|
714 |
|
715 |
// Mark as active when there is at least one active connection
|
716 |
if ( false === $poll_settings_instance->find_one_active_connection() ) {
|
717 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this poll',
|
718 |
}
|
719 |
|
720 |
$is_poll_connected = true;
|
@@ -764,17 +764,17 @@ final class Forminator_Addon_Googlesheet extends Forminator_Addon_Abstract {
|
|
764 |
try {
|
765 |
$quiz_settings_instance = null;
|
766 |
if ( ! $this->is_connected() ) {
|
767 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected',
|
768 |
}
|
769 |
|
770 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
771 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Googlesheet_Quiz_Settings ) {
|
772 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Quiz Settings of GoogleSheet',
|
773 |
}
|
774 |
|
775 |
// Mark as active when there is at least one active connection
|
776 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
777 |
-
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this quiz',
|
778 |
}
|
779 |
|
780 |
$is_quiz_connected = true;
|
46 |
*/
|
47 |
public function __construct() {
|
48 |
// late init to allow translation
|
49 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
50 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate GoogleSheet Integration, don\'t hesitate to contact us', 'forminator' );
|
51 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate GoogleSheet Integration, please try again', 'forminator' );
|
52 |
|
53 |
$this->_update_settings_error_message = __(
|
54 |
'Sorry, we failed to update settings, please check your form and try again',
|
55 |
+
'forminator'
|
56 |
);
|
57 |
|
58 |
$this->_icon = forminator_addon_googlesheet_assets_url() . 'icons/googlesheet.png';
|
86 |
try {
|
87 |
// check if its active
|
88 |
if ( ! $this->is_active() ) {
|
89 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Google Sheets is not active', 'forminator' ) );
|
90 |
}
|
91 |
|
92 |
$is_connected = false;
|
124 |
try {
|
125 |
$form_settings_instance = null;
|
126 |
if ( ! $this->is_connected() ) {
|
127 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected', 'forminator' ) );
|
128 |
}
|
129 |
|
130 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
131 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Googlesheet_Form_Settings ) {
|
132 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Form Settings of GoogleSheet', 'forminator' ) );
|
133 |
}
|
134 |
|
135 |
// Mark as active when there is at least one active connection
|
136 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
137 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this form', 'forminator' ) );
|
138 |
}
|
139 |
|
140 |
$is_form_connected = true;
|
241 |
$buttons = array();
|
242 |
if ( $this->is_connected() ) {
|
243 |
$buttons['disconnect'] = array(
|
244 |
+
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
245 |
);
|
246 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
247 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'RE-AUTHORIZE', 'forminator' ), 'forminator-addon-next' ) .
|
248 |
'</div>';
|
249 |
} else {
|
250 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
251 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
252 |
'</div>';
|
253 |
}
|
254 |
|
293 |
$client_secret = isset( $submitted_data['client_secret'] ) ? $submitted_data['client_secret'] : '';
|
294 |
|
295 |
if ( empty( $client_id ) ) {
|
296 |
+
$template_params['client_id_error'] = __( 'Please input valid Client ID', 'forminator' );
|
297 |
$has_errors = true;
|
298 |
}
|
299 |
|
300 |
if ( empty( $client_secret ) ) {
|
301 |
+
$template_params['client_secret_error'] = __( 'Please input valid Client Secret', 'forminator' );
|
302 |
$has_errors = true;
|
303 |
}
|
304 |
|
362 |
$buttons = array();
|
363 |
if ( $this->is_connected() ) {
|
364 |
$buttons['disconnect'] = array(
|
365 |
+
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
366 |
);
|
367 |
}
|
368 |
|
405 |
|
406 |
if ( $this->_token ) {
|
407 |
$buttons['close'] = array(
|
408 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'sui-button-ghost forminator-addon-close' ),
|
409 |
);
|
410 |
$is_poll = false;
|
411 |
|
577 |
$google_client->authenticate( $query_args['code'] );
|
578 |
$token = $google_client->getAccessToken();
|
579 |
if ( empty( $token ) ) {
|
580 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to get token', 'forminator' ) );
|
581 |
}
|
582 |
|
583 |
if ( ! $this->is_active() ) {
|
620 |
$config = new Forminator_Google_Config();
|
621 |
$config->setLoggerClass( 'Forminator_Addon_Wp_Googlesheet_Client_Logger' );
|
622 |
$google_client = new Forminator_Google_Client( $config );
|
623 |
+
$google_client->setApplicationName( __( 'Forminator Pro', 'forminator' ) );
|
624 |
$google_client->setClientId( $client_id );
|
625 |
$google_client->setClientSecret( $client_secret );
|
626 |
$google_client->setScopes( $scopes );
|
677 |
$revoked = $google_client->revokeToken();
|
678 |
|
679 |
if ( ! $revoked ) {
|
680 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Failed to revoke access token', 'forminator' ) );
|
681 |
}
|
682 |
$this->_token = '';
|
683 |
} catch ( Forminator_Addon_Googlesheet_Exception $e ) {
|
704 |
try {
|
705 |
$poll_settings_instance = null;
|
706 |
if ( ! $this->is_connected() ) {
|
707 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected', 'forminator' ) );
|
708 |
}
|
709 |
|
710 |
$poll_settings_instance = $this->get_addon_poll_settings( $poll_id );
|
711 |
if ( ! $poll_settings_instance instanceof Forminator_Addon_Googlesheet_Poll_Settings ) {
|
712 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Poll Settings of GoogleSheet', 'forminator' ) );
|
713 |
}
|
714 |
|
715 |
// Mark as active when there is at least one active connection
|
716 |
if ( false === $poll_settings_instance->find_one_active_connection() ) {
|
717 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this poll', 'forminator' ) );
|
718 |
}
|
719 |
|
720 |
$is_poll_connected = true;
|
764 |
try {
|
765 |
$quiz_settings_instance = null;
|
766 |
if ( ! $this->is_connected() ) {
|
767 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'GoogleSheet is not connected', 'forminator' ) );
|
768 |
}
|
769 |
|
770 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
771 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Googlesheet_Quiz_Settings ) {
|
772 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'Invalid Quiz Settings of GoogleSheet', 'forminator' ) );
|
773 |
}
|
774 |
|
775 |
// Mark as active when there is at least one active connection
|
776 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
777 |
+
throw new Forminator_Addon_Googlesheet_Exception( __( 'No active GoogleSheet connection found in this quiz', 'forminator' ) );
|
778 |
}
|
779 |
|
780 |
$is_quiz_connected = true;
|
addons/pro/googlesheet/views/form-settings/pick-name.php
CHANGED
@@ -14,12 +14,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
18 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
22 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -27,10 +27,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
22 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/googlesheet/views/form-settings/setup-sheet.php
CHANGED
@@ -16,12 +16,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet',
|
20 |
-
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.',
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
24 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -29,10 +29,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
-
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID',
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
-
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID',
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
@@ -40,21 +40,21 @@ foreach ( $template_vars as $key => $val ) {
|
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
-
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.',
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
-
esc_html__( 'Go to your %1$s.',
|
49 |
-
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account',
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
-
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.',
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
-
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.',
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
@@ -66,10 +66,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
-
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name',
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
-
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name',
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet', 'forminator' ) ); ?></h3>
|
20 |
+
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.', 'forminator' ); ?></p>
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
24 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
+
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID', 'forminator' ); ?></label>
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
+
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID', 'forminator' ) ); ?>"
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
+
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.', 'forminator' ); ?>
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
+
esc_html__( 'Go to your %1$s.', 'forminator' ),
|
49 |
+
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account', 'forminator' ) . '</a>'
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
+
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.', 'forminator' ); ?>
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
+
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.', 'forminator' ),
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
+
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name', 'forminator' ); ?></label>
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
+
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name', 'forminator' ) ); ?>"
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
addons/pro/googlesheet/views/poll-settings/pick-name.php
CHANGED
@@ -14,12 +14,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
18 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
22 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -27,10 +27,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
22 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/googlesheet/views/poll-settings/setup-sheet.php
CHANGED
@@ -16,12 +16,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet',
|
20 |
-
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.',
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
24 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -29,10 +29,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
-
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID',
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
-
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID',
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
@@ -40,21 +40,21 @@ foreach ( $template_vars as $key => $val ) {
|
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
-
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.',
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
-
esc_html__( 'Go to your %1$s.',
|
49 |
-
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account',
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
-
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.',
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
-
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.',
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
@@ -66,10 +66,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
-
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name',
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
-
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name',
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet', 'forminator' ) ); ?></h3>
|
20 |
+
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.', 'forminator' ); ?></p>
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
24 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
+
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID', 'forminator' ); ?></label>
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
+
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID', 'forminator' ) ); ?>"
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
+
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.', 'forminator' ); ?>
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
+
esc_html__( 'Go to your %1$s.', 'forminator' ),
|
49 |
+
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account', 'forminator' ) . '</a>'
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
+
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.', 'forminator' ); ?>
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
+
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.', 'forminator' ),
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
+
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name', 'forminator' ); ?></label>
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
+
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name', 'forminator' ) ); ?>"
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
addons/pro/googlesheet/views/quiz-settings/pick-name.php
CHANGED
@@ -14,12 +14,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
18 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
22 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -27,10 +27,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-info"><p>
|
21 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
22 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
23 |
<?php endif; ?>
|
24 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
27 |
</div>
|
28 |
<form>
|
29 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
30 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
31 |
<input
|
32 |
class="sui-form-control"
|
33 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
34 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
35 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
36 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/googlesheet/views/quiz-settings/setup-sheet.php
CHANGED
@@ -16,12 +16,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet',
|
20 |
-
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.',
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
-
<?php esc_html_e( 'You can open your current spread sheet',
|
24 |
-
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here',
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -29,10 +29,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
-
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID',
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
-
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID',
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
@@ -40,21 +40,21 @@ foreach ( $template_vars as $key => $val ) {
|
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
-
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.',
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
-
esc_html__( 'Go to your %1$s.',
|
49 |
-
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account',
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
-
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.',
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
-
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.',
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
@@ -66,10 +66,10 @@ foreach ( $template_vars as $key => $val ) {
|
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
-
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name',
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
-
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name',
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
16 |
|
17 |
<div class="integration-header">
|
18 |
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Create Spread Sheet', 'forminator' ) ); ?></h3>
|
20 |
+
<p><?php esc_html_e( 'Create Spreadsheet that will be used to send submissions.', 'forminator' ); ?></p>
|
21 |
<?php if ( ! empty( $vars['file_id'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-info"><p>
|
23 |
+
<?php esc_html_e( 'You can open your current spread sheet', 'forminator' ); ?>
|
24 |
+
<a target="_blank" href="https://docs.google.com/spreadsheets/d/<?php echo esc_attr( $vars['file_id'] ); ?>"><?php esc_html_e( 'here', 'forminator' ); ?></a>.</p></span>
|
25 |
<?php endif; ?>
|
26 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
27 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
29 |
</div>
|
30 |
<form>
|
31 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['folder_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
32 |
+
<label class="sui-label"><?php esc_html_e( 'Drive Folder ID', 'forminator' ); ?></label>
|
33 |
<input
|
34 |
class="sui-form-control"
|
35 |
+
name="folder_id" placeholder="<?php echo esc_attr( __( 'Folder ID', 'forminator' ) ); ?>"
|
36 |
value="<?php echo esc_attr( $vars['folder_id'] ); ?>">
|
37 |
<?php if ( ! empty( $vars['folder_id_error'] ) ) : ?>
|
38 |
<span class="sui-error-message"><?php echo esc_html( $vars['folder_id_error'] ); ?></span>
|
40 |
<span class="sui-description">
|
41 |
<ol class="instructions" id="directory-instructions" style="display: block;">
|
42 |
<li>
|
43 |
+
<?php esc_html_e( 'It is optional, if Drive Folder ID omitted / empty, new spreadsheet will be created in your Google Drive home / root folder.', 'forminator' ); ?>
|
44 |
</li>
|
45 |
<li>
|
46 |
<?php
|
47 |
echo sprintf(/* translators: ... */
|
48 |
+
esc_html__( 'Go to your %1$s.', 'forminator' ),
|
49 |
+
'<a href="https://drive.google.com/#my-drive" target="_blank">' . esc_html__( 'Drive account', 'forminator' ) . '</a>'
|
50 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
51 |
?>
|
52 |
+
<?php esc_html_e( 'Navigate to or create a new directory where you want to create a new spreadsheet. Make sure you are viewing the destination directory.', 'forminator' ); ?>
|
53 |
</li>
|
54 |
<li>
|
55 |
<?php
|
56 |
echo sprintf(/* translators: ... */
|
57 |
+
esc_html__( 'The URL for the directory will be something similar to %1$s. The Directory ID would be the last part after %2$s, which is %3$s in this case.', 'forminator' ),
|
58 |
'<em>https://drive.google.com/#folders/0B6GD66ctHXdCOWZKNDRIRGJJXS3</em>',
|
59 |
'<em>/#folders/</em>',
|
60 |
'<strong>0B6GD66ctHXdCOWZKNDRIRGJJXS3</strong>'
|
66 |
</div>
|
67 |
|
68 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['file_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
69 |
+
<label class="sui-label"><?php esc_html_e( 'Spreadsheet File Name', 'forminator' ); ?></label>
|
70 |
<input
|
71 |
class="sui-form-control"
|
72 |
+
name="file_name" placeholder="<?php echo esc_attr( __( 'File Name', 'forminator' ) ); ?>"
|
73 |
value="<?php echo esc_attr( $vars['file_name'] ); ?>">
|
74 |
<?php if ( ! empty( $vars['file_name_error'] ) ) : ?>
|
75 |
<span class="sui-error-message"><?php echo esc_html( $vars['file_name_error'] ); ?></span>
|
addons/pro/googlesheet/views/sections/authorize.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
<div class="sui-box">
|
16 |
<div class="sui-box-header">
|
17 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Google SpreadSheets',
|
18 |
</div>
|
19 |
<div class="sui-box-body">
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
@@ -25,14 +25,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
25 |
<?php
|
26 |
esc_html_e(
|
27 |
'Successfully authorized Google SpreadSheets, you can go back to integration settings.',
|
28 |
-
|
29 |
);
|
30 |
?>
|
31 |
</p>
|
32 |
</span>
|
33 |
<?php else : ?>
|
34 |
<span class="sui-notice sui-notice-loading">
|
35 |
-
<p><?php esc_html_e( 'Please Wait...',
|
36 |
</span>
|
37 |
<?php endif; ?>
|
38 |
</div>
|
14 |
|
15 |
<div class="sui-box">
|
16 |
<div class="sui-box-header">
|
17 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Google SpreadSheets', 'forminator' ); ?></h2>
|
18 |
</div>
|
19 |
<div class="sui-box-body">
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<?php
|
26 |
esc_html_e(
|
27 |
'Successfully authorized Google SpreadSheets, you can go back to integration settings.',
|
28 |
+
'forminator'
|
29 |
);
|
30 |
?>
|
31 |
</p>
|
32 |
</span>
|
33 |
<?php else : ?>
|
34 |
<span class="sui-notice sui-notice-loading">
|
35 |
+
<p><?php esc_html_e( 'Please Wait...', 'forminator' ); ?></p>
|
36 |
</span>
|
37 |
<?php endif; ?>
|
38 |
</div>
|
addons/pro/googlesheet/views/settings/authorize.php
CHANGED
@@ -12,12 +12,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
12 |
|
13 |
<div class="integration-header">
|
14 |
|
15 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( sprintf( /* translators: ... */ __( 'Connect %1$s',
|
16 |
|
17 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
18 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Click button below to re-authorize.',
|
19 |
<?php else : ?>
|
20 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Authorize Forminator to connect with your Google account in order to send data from your forms.',
|
21 |
<?php endif; ?>
|
22 |
|
23 |
</div>
|
@@ -26,12 +26,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
26 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
27 |
target="_blank"
|
28 |
class="sui-button sui-button-blue forminator-addon-connect">
|
29 |
-
<?php esc_html_e( 'AUTHORIZE',
|
30 |
</a>
|
31 |
<?php else : ?>
|
32 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
33 |
target="_blank"
|
34 |
class="sui-button sui-button-blue forminator-addon-connect">
|
35 |
-
<?php esc_html_e( 'RE-AUTHORIZE',
|
36 |
</a>
|
37 |
<?php endif; ?>
|
12 |
|
13 |
<div class="integration-header">
|
14 |
|
15 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( sprintf( /* translators: ... */ __( 'Connect %1$s', 'forminator' ), 'Google Sheets' ) ); ?></h3>
|
16 |
|
17 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
18 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Click button below to re-authorize.', 'forminator' ); ?></span>
|
19 |
<?php else : ?>
|
20 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Authorize Forminator to connect with your Google account in order to send data from your forms.', 'forminator' ); ?></span>
|
21 |
<?php endif; ?>
|
22 |
|
23 |
</div>
|
26 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
27 |
target="_blank"
|
28 |
class="sui-button sui-button-blue forminator-addon-connect">
|
29 |
+
<?php esc_html_e( 'AUTHORIZE', 'forminator' ); ?>
|
30 |
</a>
|
31 |
<?php else : ?>
|
32 |
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>"
|
33 |
target="_blank"
|
34 |
class="sui-button sui-button-blue forminator-addon-connect">
|
35 |
+
<?php esc_html_e( 'RE-AUTHORIZE', 'forminator' ); ?>
|
36 |
</a>
|
37 |
<?php endif; ?>
|
addons/pro/googlesheet/views/settings/setup-client.php
CHANGED
@@ -17,17 +17,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( sprintf( /* translators: ... */ __( 'Setup %1$s Client',
|
21 |
|
22 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
23 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Your Google Sheets account is already authorized. Edit info below to re-authorize.',
|
24 |
<?php else : ?>
|
25 |
<span class="sui-description" style="margin-top: 20px;">
|
26 |
-
<?php esc_html_e( 'Set up your Google Sheets oAuth 2.0 client by entering your credentials below.',
|
27 |
if ( forminator_is_show_addons_documentation_link() ) { ?>
|
28 |
<br/>
|
29 |
<?php echo sprintf(/* translators: ... */
|
30 |
-
esc_html__( '%1$sGuide to generate credentials%2$s.',
|
31 |
'<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#google-sheets" target="_blank">',
|
32 |
'</a>'
|
33 |
);
|
@@ -46,28 +46,28 @@ foreach ( $template_vars as $key => $val ) {
|
|
46 |
|
47 |
<div class="sui-form-field">
|
48 |
|
49 |
-
<label class="sui-label"><?php esc_html_e( 'Authorized Redirect URI',
|
50 |
|
51 |
<div class="sui-with-button sui-with-button-icon">
|
52 |
<input type="text" id="forminator-form-shortcode" class="sui-form-control" value="<?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?>">
|
53 |
<a class="sui-button-icon copy-clipboard-integration" data-shortcode="<?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?>">
|
54 |
<i aria-hidden="true" class="sui-icon-copy"></i>
|
55 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Copy shortcode',
|
56 |
</a>
|
57 |
</div>
|
58 |
|
59 |
-
<span class="sui-description"><?php esc_html_e( 'Please use this redirect URI while generating your client credentials on the Google API console.',
|
60 |
|
61 |
</div>
|
62 |
|
63 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
64 |
|
65 |
-
<label class="sui-label"><?php esc_html_e( 'Client ID',
|
66 |
|
67 |
<div class="sui-control-with-icon">
|
68 |
|
69 |
<input name="client_id"
|
70 |
-
placeholder="<?php echo esc_attr( __( 'Client ID',
|
71 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>"
|
72 |
class="sui-form-control" />
|
73 |
|
@@ -83,12 +83,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
83 |
|
84 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_secret_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
85 |
|
86 |
-
<label class="sui-label"><?php esc_html_e( 'Client Secret',
|
87 |
|
88 |
<div class="sui-control-with-icon">
|
89 |
|
90 |
<input name="client_secret"
|
91 |
-
placeholder="<?php echo esc_attr( __( 'Client Secret',
|
92 |
value="<?php echo esc_attr( $vars['client_secret'] ); ?>"
|
93 |
class="sui-form-control" />
|
94 |
|
17 |
|
18 |
<div class="integration-header">
|
19 |
|
20 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( sprintf( /* translators: ... */ __( 'Setup %1$s Client', 'forminator' ), 'Google Sheets' ) ); ?></h3>
|
21 |
|
22 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
23 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Your Google Sheets account is already authorized. Edit info below to re-authorize.', 'forminator' ); ?></span>
|
24 |
<?php else : ?>
|
25 |
<span class="sui-description" style="margin-top: 20px;">
|
26 |
+
<?php esc_html_e( 'Set up your Google Sheets oAuth 2.0 client by entering your credentials below.', 'forminator' );
|
27 |
if ( forminator_is_show_addons_documentation_link() ) { ?>
|
28 |
<br/>
|
29 |
<?php echo sprintf(/* translators: ... */
|
30 |
+
esc_html__( '%1$sGuide to generate credentials%2$s.', 'forminator' ),
|
31 |
'<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#google-sheets" target="_blank">',
|
32 |
'</a>'
|
33 |
);
|
46 |
|
47 |
<div class="sui-form-field">
|
48 |
|
49 |
+
<label class="sui-label"><?php esc_html_e( 'Authorized Redirect URI', 'forminator' ); ?></label>
|
50 |
|
51 |
<div class="sui-with-button sui-with-button-icon">
|
52 |
<input type="text" id="forminator-form-shortcode" class="sui-form-control" value="<?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?>">
|
53 |
<a class="sui-button-icon copy-clipboard-integration" data-shortcode="<?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?>">
|
54 |
<i aria-hidden="true" class="sui-icon-copy"></i>
|
55 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Copy shortcode', 'forminator' ); ?></span>
|
56 |
</a>
|
57 |
</div>
|
58 |
|
59 |
+
<span class="sui-description"><?php esc_html_e( 'Please use this redirect URI while generating your client credentials on the Google API console.', 'forminator' ); ?></span>
|
60 |
|
61 |
</div>
|
62 |
|
63 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
64 |
|
65 |
+
<label class="sui-label"><?php esc_html_e( 'Client ID', 'forminator' ); ?></label>
|
66 |
|
67 |
<div class="sui-control-with-icon">
|
68 |
|
69 |
<input name="client_id"
|
70 |
+
placeholder="<?php echo esc_attr( __( 'Client ID', 'forminator' ) ); ?>"
|
71 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>"
|
72 |
class="sui-form-control" />
|
73 |
|
83 |
|
84 |
<div class="sui-form-field<?php echo esc_attr( ! empty( $vars['client_secret_error'] ) ? ' sui-form-field-error' : '' ); ?>">
|
85 |
|
86 |
+
<label class="sui-label"><?php esc_html_e( 'Client Secret', 'forminator' ); ?></label>
|
87 |
|
88 |
<div class="sui-control-with-icon">
|
89 |
|
90 |
<input name="client_secret"
|
91 |
+
placeholder="<?php echo esc_attr( __( 'Client Secret', 'forminator' ) ); ?>"
|
92 |
value="<?php echo esc_attr( $vars['client_secret'] ); ?>"
|
93 |
class="sui-form-control" />
|
94 |
|
addons/pro/googlesheet/views/settings/success-authorize.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="integration-header">
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
-
<?php echo esc_html( sprintf( /* translators: ... */ __( '%1$s Added',
|
4 |
</h3>
|
5 |
-
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
6 |
</div>
|
1 |
<div class="integration-header">
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
+
<?php echo esc_html( sprintf( /* translators: ... */ __( '%1$s Added', 'forminator' ), 'Google Sheets' ) ); ?>
|
4 |
</h3>
|
5 |
+
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></p>
|
6 |
</div>
|
addons/pro/googlesheet/views/settings/wait-authorize.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
<p class="" aria-label="Loading content">
|
15 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
16 |
</p>
|
17 |
-
<p><?php esc_html_e( 'We are waiting for authorization from Google...',
|
18 |
</div>
|
19 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button"><?php esc_html_e( 'RETRY',
|
20 |
|
14 |
<p class="" aria-label="Loading content">
|
15 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
16 |
</p>
|
17 |
+
<p><?php esc_html_e( 'We are waiting for authorization from Google...', 'forminator' ); ?></p>
|
18 |
</div>
|
19 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button"><?php esc_html_e( 'RETRY', 'forminator' ); ?></a>
|
20 |
|
addons/pro/gutenberg/library/blocks/class-forminator-gfblock-forms.php
CHANGED
@@ -102,8 +102,8 @@ class Forminator_GFBlock_Forms extends Forminator_GFBlock_Abstract {
|
|
102 |
)
|
103 |
);
|
104 |
|
105 |
-
|
106 |
-
forminator_print_front_scripts(
|
107 |
|
108 |
wp_enqueue_script(
|
109 |
'select2-forminator',
|
@@ -148,11 +148,11 @@ class Forminator_GFBlock_Forms extends Forminator_GFBlock_Abstract {
|
|
148 |
* @return array
|
149 |
*/
|
150 |
public function get_forms() {
|
151 |
-
$forms = Forminator_API::get_forms( null, 1, 100,
|
152 |
$form_list = array(
|
153 |
array(
|
154 |
'value' => '',
|
155 |
-
'label' => esc_html__( 'Select a form',
|
156 |
),
|
157 |
);
|
158 |
|
@@ -176,11 +176,11 @@ class Forminator_GFBlock_Forms extends Forminator_GFBlock_Abstract {
|
|
176 |
|
177 |
public function localize() {
|
178 |
return array(
|
179 |
-
'choose_form' => esc_html__( 'Choose Form',
|
180 |
-
'customize_form' => esc_html__( 'Customize form',
|
181 |
-
'rendering' => esc_html__( 'Rendering...',
|
182 |
-
'form' => esc_html__( 'Form',
|
183 |
-
'form_description' => esc_html__( 'Embed and display your custom Forminator forms in this block',
|
184 |
);
|
185 |
}
|
186 |
}
|
102 |
)
|
103 |
);
|
104 |
|
105 |
+
forminator_print_front_styles();
|
106 |
+
forminator_print_front_scripts();
|
107 |
|
108 |
wp_enqueue_script(
|
109 |
'select2-forminator',
|
148 |
* @return array
|
149 |
*/
|
150 |
public function get_forms() {
|
151 |
+
$forms = Forminator_API::get_forms( null, 1, 100, Forminator_Form_Model::STATUS_PUBLISH );
|
152 |
$form_list = array(
|
153 |
array(
|
154 |
'value' => '',
|
155 |
+
'label' => esc_html__( 'Select a form', 'forminator' ),
|
156 |
),
|
157 |
);
|
158 |
|
176 |
|
177 |
public function localize() {
|
178 |
return array(
|
179 |
+
'choose_form' => esc_html__( 'Choose Form', 'forminator' ),
|
180 |
+
'customize_form' => esc_html__( 'Customize form', 'forminator' ),
|
181 |
+
'rendering' => esc_html__( 'Rendering...', 'forminator' ),
|
182 |
+
'form' => esc_html__( 'Form', 'forminator' ),
|
183 |
+
'form_description' => esc_html__( 'Embed and display your custom Forminator forms in this block', 'forminator' ),
|
184 |
);
|
185 |
}
|
186 |
}
|
addons/pro/gutenberg/library/blocks/class-forminator-gfblock-polls.php
CHANGED
@@ -100,8 +100,8 @@ class Forminator_GFBlock_Polls extends Forminator_GFBlock_Abstract {
|
|
100 |
)
|
101 |
);
|
102 |
|
103 |
-
|
104 |
-
forminator_print_front_scripts(
|
105 |
}
|
106 |
|
107 |
/**
|
@@ -111,11 +111,11 @@ class Forminator_GFBlock_Polls extends Forminator_GFBlock_Abstract {
|
|
111 |
* @return array
|
112 |
*/
|
113 |
public function get_forms() {
|
114 |
-
$forms = Forminator_API::get_polls( null, 1, 100,
|
115 |
$form_list = array(
|
116 |
array(
|
117 |
'value' => '',
|
118 |
-
'label' => esc_html__( 'Select a poll',
|
119 |
),
|
120 |
);
|
121 |
|
@@ -139,11 +139,11 @@ class Forminator_GFBlock_Polls extends Forminator_GFBlock_Abstract {
|
|
139 |
|
140 |
public function localize() {
|
141 |
return array(
|
142 |
-
'choose_poll' => esc_html__( 'Choose Poll',
|
143 |
-
'customize_poll' => esc_html__( 'Customize poll',
|
144 |
-
'rendering' => esc_html__( 'Rendering...',
|
145 |
-
'poll' => esc_html__( 'Poll',
|
146 |
-
'poll_description' => esc_html__( 'Embed and display your Forminator polls in this block',
|
147 |
);
|
148 |
}
|
149 |
}
|
100 |
)
|
101 |
);
|
102 |
|
103 |
+
forminator_print_front_styles();
|
104 |
+
forminator_print_front_scripts();
|
105 |
}
|
106 |
|
107 |
/**
|
111 |
* @return array
|
112 |
*/
|
113 |
public function get_forms() {
|
114 |
+
$forms = Forminator_API::get_polls( null, 1, 100, Forminator_Form_Model::STATUS_PUBLISH );
|
115 |
$form_list = array(
|
116 |
array(
|
117 |
'value' => '',
|
118 |
+
'label' => esc_html__( 'Select a poll', 'forminator' ),
|
119 |
),
|
120 |
);
|
121 |
|
139 |
|
140 |
public function localize() {
|
141 |
return array(
|
142 |
+
'choose_poll' => esc_html__( 'Choose Poll', 'forminator' ),
|
143 |
+
'customize_poll' => esc_html__( 'Customize poll', 'forminator' ),
|
144 |
+
'rendering' => esc_html__( 'Rendering...', 'forminator' ),
|
145 |
+
'poll' => esc_html__( 'Poll', 'forminator' ),
|
146 |
+
'poll_description' => esc_html__( 'Embed and display your Forminator polls in this block', 'forminator' ),
|
147 |
);
|
148 |
}
|
149 |
}
|
addons/pro/gutenberg/library/blocks/class-forminator-gfblock-quizzes.php
CHANGED
@@ -100,8 +100,8 @@ class Forminator_GFBlock_Quizzes extends Forminator_GFBlock_Abstract {
|
|
100 |
)
|
101 |
);
|
102 |
|
103 |
-
forminator_print_front_styles(
|
104 |
-
forminator_print_front_scripts(
|
105 |
}
|
106 |
|
107 |
/**
|
@@ -121,7 +121,7 @@ class Forminator_GFBlock_Quizzes extends Forminator_GFBlock_Abstract {
|
|
121 |
$markup = $this->preview_block( $properties );
|
122 |
|
123 |
// Get quiz
|
124 |
-
$quiz = Forminator_API::
|
125 |
|
126 |
if ( $markup ) {
|
127 |
wp_send_json_success(
|
@@ -142,12 +142,12 @@ class Forminator_GFBlock_Quizzes extends Forminator_GFBlock_Abstract {
|
|
142 |
* @return array
|
143 |
*/
|
144 |
public function get_forms() {
|
145 |
-
$forms = Forminator_API::get_quizzes( null, 1, 100,
|
146 |
|
147 |
$form_list = array(
|
148 |
array(
|
149 |
'value' => '',
|
150 |
-
'label' => esc_html__( 'Select a quiz',
|
151 |
),
|
152 |
);
|
153 |
|
@@ -171,11 +171,11 @@ class Forminator_GFBlock_Quizzes extends Forminator_GFBlock_Abstract {
|
|
171 |
|
172 |
public function localize() {
|
173 |
return array(
|
174 |
-
'choose_quiz' => esc_html__( 'Choose Quiz',
|
175 |
-
'customize_quiz' => esc_html__( 'Customize quiz',
|
176 |
-
'rendering' => esc_html__( 'Rendering...',
|
177 |
-
'quiz' => esc_html__( 'Quiz',
|
178 |
-
'quiz_description' => esc_html__( 'Embed and display your Forminator quiz in this block',
|
179 |
);
|
180 |
}
|
181 |
}
|
100 |
)
|
101 |
);
|
102 |
|
103 |
+
forminator_print_front_styles();
|
104 |
+
forminator_print_front_scripts();
|
105 |
}
|
106 |
|
107 |
/**
|
121 |
$markup = $this->preview_block( $properties );
|
122 |
|
123 |
// Get quiz
|
124 |
+
$quiz = Forminator_API::get_module( $id );
|
125 |
|
126 |
if ( $markup ) {
|
127 |
wp_send_json_success(
|
142 |
* @return array
|
143 |
*/
|
144 |
public function get_forms() {
|
145 |
+
$forms = Forminator_API::get_quizzes( null, 1, 100, Forminator_Form_Model::STATUS_PUBLISH );
|
146 |
|
147 |
$form_list = array(
|
148 |
array(
|
149 |
'value' => '',
|
150 |
+
'label' => esc_html__( 'Select a quiz', 'forminator' ),
|
151 |
),
|
152 |
);
|
153 |
|
171 |
|
172 |
public function localize() {
|
173 |
return array(
|
174 |
+
'choose_quiz' => esc_html__( 'Choose Quiz', 'forminator' ),
|
175 |
+
'customize_quiz' => esc_html__( 'Customize quiz', 'forminator' ),
|
176 |
+
'rendering' => esc_html__( 'Rendering...', 'forminator' ),
|
177 |
+
'quiz' => esc_html__( 'Quiz', 'forminator' ),
|
178 |
+
'quiz_description' => esc_html__( 'Embed and display your Forminator quiz in this block', 'forminator' ),
|
179 |
);
|
180 |
}
|
181 |
}
|
addons/pro/hubspot/class-forminator-addon-hubspot-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'HubSpot failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -143,7 +143,7 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
143 |
$form_settings = $this->form_settings_instance->get_form_settings();
|
144 |
|
145 |
if ( empty( $connection_settings['name'] ) ) {
|
146 |
-
$connection_settings['name'] = __( 'HubSpot',
|
147 |
}
|
148 |
//check required fields
|
149 |
try {
|
@@ -160,7 +160,7 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
160 |
$email_element_id = $connection_settings['fields_map']['email'];
|
161 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
162 |
/* translators: ... */
|
163 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Email on element %1$s not found or not filled on submitted data.',
|
164 |
}
|
165 |
$email = $submitted_data[ $email_element_id ];
|
166 |
$email = strtolower( trim( $email ) );
|
@@ -279,7 +279,7 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
279 |
return array(
|
280 |
'is_sent' => true,
|
281 |
'connection_name' => $connection_settings['name'],
|
282 |
-
'description' => __( 'Successfully send data to HubSpot',
|
283 |
'data_sent' => $api->get_last_data_sent(),
|
284 |
'data_received' => $api->get_last_data_received(),
|
285 |
'url_request' => $api->get_last_url_request(),
|
@@ -391,29 +391,29 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
391 |
}
|
392 |
$status = $addon_meta_data['value'];
|
393 |
$additional_entry_item = array(
|
394 |
-
'label' => __( 'HubSpot Integration',
|
395 |
'value' => '',
|
396 |
);
|
397 |
|
398 |
$sub_entries = array();
|
399 |
if ( isset( $status['connection_name'] ) ) {
|
400 |
$sub_entries[] = array(
|
401 |
-
'label' => __( 'Integration Name',
|
402 |
'value' => $status['connection_name'],
|
403 |
);
|
404 |
}
|
405 |
|
406 |
if ( isset( $status['is_sent'] ) ) {
|
407 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
408 |
$sub_entries[] = array(
|
409 |
-
'label' => __( 'Sent To HubSpot',
|
410 |
'value' => $is_sent,
|
411 |
);
|
412 |
}
|
413 |
|
414 |
if ( isset( $status['description'] ) ) {
|
415 |
$sub_entries[] = array(
|
416 |
-
'label' => __( 'Info',
|
417 |
'value' => $status['description'],
|
418 |
);
|
419 |
}
|
@@ -422,21 +422,21 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
422 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_HUBSPOT_SHOW_FULL_LOG', true)`
|
423 |
if ( isset( $status['url_request'] ) ) {
|
424 |
$sub_entries[] = array(
|
425 |
-
'label' => __( 'API URL',
|
426 |
'value' => $status['url_request'],
|
427 |
);
|
428 |
}
|
429 |
|
430 |
if ( isset( $status['data_sent'] ) ) {
|
431 |
$sub_entries[] = array(
|
432 |
-
'label' => __( 'Data sent to HubSpot',
|
433 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
434 |
);
|
435 |
}
|
436 |
|
437 |
if ( isset( $status['data_received'] ) ) {
|
438 |
$sub_entries[] = array(
|
439 |
-
'label' => __( 'Data received from HubSpot',
|
440 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
441 |
);
|
442 |
}
|
@@ -458,7 +458,7 @@ class Forminator_Addon_Hubspot_Form_Hooks extends Forminator_Addon_Form_Hooks_Ab
|
|
458 |
public function on_export_render_title_row() {
|
459 |
|
460 |
$export_headers = array(
|
461 |
-
'info' => __( 'HubSpot Info',
|
462 |
);
|
463 |
|
464 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'HubSpot failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
143 |
$form_settings = $this->form_settings_instance->get_form_settings();
|
144 |
|
145 |
if ( empty( $connection_settings['name'] ) ) {
|
146 |
+
$connection_settings['name'] = __( 'HubSpot', 'forminator' );
|
147 |
}
|
148 |
//check required fields
|
149 |
try {
|
160 |
$email_element_id = $connection_settings['fields_map']['email'];
|
161 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
162 |
/* translators: ... */
|
163 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Email on element %1$s not found or not filled on submitted data.', 'forminator' ) );
|
164 |
}
|
165 |
$email = $submitted_data[ $email_element_id ];
|
166 |
$email = strtolower( trim( $email ) );
|
279 |
return array(
|
280 |
'is_sent' => true,
|
281 |
'connection_name' => $connection_settings['name'],
|
282 |
+
'description' => __( 'Successfully send data to HubSpot', 'forminator' ),
|
283 |
'data_sent' => $api->get_last_data_sent(),
|
284 |
'data_received' => $api->get_last_data_received(),
|
285 |
'url_request' => $api->get_last_url_request(),
|
391 |
}
|
392 |
$status = $addon_meta_data['value'];
|
393 |
$additional_entry_item = array(
|
394 |
+
'label' => __( 'HubSpot Integration', 'forminator' ),
|
395 |
'value' => '',
|
396 |
);
|
397 |
|
398 |
$sub_entries = array();
|
399 |
if ( isset( $status['connection_name'] ) ) {
|
400 |
$sub_entries[] = array(
|
401 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
402 |
'value' => $status['connection_name'],
|
403 |
);
|
404 |
}
|
405 |
|
406 |
if ( isset( $status['is_sent'] ) ) {
|
407 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
408 |
$sub_entries[] = array(
|
409 |
+
'label' => __( 'Sent To HubSpot', 'forminator' ),
|
410 |
'value' => $is_sent,
|
411 |
);
|
412 |
}
|
413 |
|
414 |
if ( isset( $status['description'] ) ) {
|
415 |
$sub_entries[] = array(
|
416 |
+
'label' => __( 'Info', 'forminator' ),
|
417 |
'value' => $status['description'],
|
418 |
);
|
419 |
}
|
422 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_HUBSPOT_SHOW_FULL_LOG', true)`
|
423 |
if ( isset( $status['url_request'] ) ) {
|
424 |
$sub_entries[] = array(
|
425 |
+
'label' => __( 'API URL', 'forminator' ),
|
426 |
'value' => $status['url_request'],
|
427 |
);
|
428 |
}
|
429 |
|
430 |
if ( isset( $status['data_sent'] ) ) {
|
431 |
$sub_entries[] = array(
|
432 |
+
'label' => __( 'Data sent to HubSpot', 'forminator' ),
|
433 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
434 |
);
|
435 |
}
|
436 |
|
437 |
if ( isset( $status['data_received'] ) ) {
|
438 |
$sub_entries[] = array(
|
439 |
+
'label' => __( 'Data received from HubSpot', 'forminator' ),
|
440 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
441 |
);
|
442 |
}
|
458 |
public function on_export_render_title_row() {
|
459 |
|
460 |
$export_headers = array(
|
461 |
+
'info' => __( 'HubSpot Info', 'forminator' ),
|
462 |
);
|
463 |
|
464 |
$form_id = $this->form_id;
|
addons/pro/hubspot/class-forminator-addon-hubspot-form-settings.php
CHANGED
@@ -33,7 +33,7 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
33 |
|
34 |
$this->_update_form_settings_error_message = __(
|
35 |
'The update to your settings for this form failed, check the form input and try again.',
|
36 |
-
|
37 |
);
|
38 |
}
|
39 |
|
@@ -103,10 +103,10 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
103 |
unset( $submitted_data['multi_id'] );
|
104 |
|
105 |
$fields = array(
|
106 |
-
'email' => __( 'Email Address',
|
107 |
-
'firstname' => __( 'First Name',
|
108 |
-
'lastname' => __( 'Last Name',
|
109 |
-
'jobtitle' => __( 'Job Title',
|
110 |
);
|
111 |
$template_params['fields'] = $fields;
|
112 |
try {
|
@@ -156,7 +156,7 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
156 |
$element_id = $fields_map[ $key ];
|
157 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
158 |
$input_exceptions->add_input_exception(/* translators: ... */
|
159 |
-
sprintf( __( 'Please assign valid field for %s',
|
160 |
$key . '_error'
|
161 |
);
|
162 |
continue;
|
@@ -196,14 +196,14 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
196 |
$buttons = array();
|
197 |
if ( $this->map_fields_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
198 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
199 |
-
esc_html__( 'Deactivate',
|
200 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
201 |
-
esc_html__( 'Deactivate this HubSpot Integration from this Form.',
|
202 |
);
|
203 |
}
|
204 |
|
205 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
206 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Continue',
|
207 |
'</div>';
|
208 |
|
209 |
return array(
|
@@ -259,7 +259,7 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
259 |
$template = forminator_addon_hubspot_dir() . 'views/form-settings/create-ticket.php';
|
260 |
|
261 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
262 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
263 |
}
|
264 |
|
265 |
$multi_id = $submitted_data['multi_id'];
|
@@ -347,11 +347,11 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
347 |
}
|
348 |
}
|
349 |
if ( empty( $pipeline ) ) {
|
350 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No pipeline found on your HubSpot account. Please create one.',
|
351 |
}
|
352 |
|
353 |
if ( empty( $status ) ) {
|
354 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No status found on your HubSpot account. Please create one.',
|
355 |
}
|
356 |
|
357 |
$template_params['status'] = $status;
|
@@ -430,18 +430,18 @@ class Forminator_Addon_Hubspot_Form_Settings extends Forminator_Addon_Form_Setti
|
|
430 |
$buttons = array();
|
431 |
if ( $this->create_ticket_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
432 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
433 |
-
esc_html__( 'Deactivate',
|
434 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
435 |
-
esc_html__( 'Deactivate this HubSpot Integration from this Form.',
|
436 |
);
|
437 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
438 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Update',
|
439 |
'</div>';
|
440 |
} else if ( ( isset( $submitted_data['create_ticket'] ) && '1' === $submitted_data['create_ticket'] ) && empty( $settings['re-authorize'] ) ) {
|
441 |
$buttons = array();
|
442 |
} else {
|
443 |
$buttons['next']['markup'] = '<div class="sui-actions-right" id="' . $buttonID . '">' .
|
444 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Activate',
|
445 |
'</div>';
|
446 |
}
|
447 |
|
33 |
|
34 |
$this->_update_form_settings_error_message = __(
|
35 |
'The update to your settings for this form failed, check the form input and try again.',
|
36 |
+
'forminator'
|
37 |
);
|
38 |
}
|
39 |
|
103 |
unset( $submitted_data['multi_id'] );
|
104 |
|
105 |
$fields = array(
|
106 |
+
'email' => __( 'Email Address', 'forminator' ),
|
107 |
+
'firstname' => __( 'First Name', 'forminator' ),
|
108 |
+
'lastname' => __( 'Last Name', 'forminator' ),
|
109 |
+
'jobtitle' => __( 'Job Title', 'forminator' ),
|
110 |
);
|
111 |
$template_params['fields'] = $fields;
|
112 |
try {
|
156 |
$element_id = $fields_map[ $key ];
|
157 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
158 |
$input_exceptions->add_input_exception(/* translators: ... */
|
159 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
160 |
$key . '_error'
|
161 |
);
|
162 |
continue;
|
196 |
$buttons = array();
|
197 |
if ( $this->map_fields_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
198 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
199 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
200 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
201 |
+
esc_html__( 'Deactivate this HubSpot Integration from this Form.', 'forminator' )
|
202 |
);
|
203 |
}
|
204 |
|
205 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
206 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Continue', 'forminator' ), 'forminator-addon-next' ) .
|
207 |
'</div>';
|
208 |
|
209 |
return array(
|
259 |
$template = forminator_addon_hubspot_dir() . 'views/form-settings/create-ticket.php';
|
260 |
|
261 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
262 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
263 |
}
|
264 |
|
265 |
$multi_id = $submitted_data['multi_id'];
|
347 |
}
|
348 |
}
|
349 |
if ( empty( $pipeline ) ) {
|
350 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No pipeline found on your HubSpot account. Please create one.', 'forminator' ) );
|
351 |
}
|
352 |
|
353 |
if ( empty( $status ) ) {
|
354 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No status found on your HubSpot account. Please create one.', 'forminator' ) );
|
355 |
}
|
356 |
|
357 |
$template_params['status'] = $status;
|
430 |
$buttons = array();
|
431 |
if ( $this->create_ticket_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
432 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
433 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
434 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
435 |
+
esc_html__( 'Deactivate this HubSpot Integration from this Form.', 'forminator' )
|
436 |
);
|
437 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
438 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Update', 'forminator' ), 'forminator-addon-next sui-button-blue' ) .
|
439 |
'</div>';
|
440 |
} else if ( ( isset( $submitted_data['create_ticket'] ) && '1' === $submitted_data['create_ticket'] ) && empty( $settings['re-authorize'] ) ) {
|
441 |
$buttons = array();
|
442 |
} else {
|
443 |
$buttons['next']['markup'] = '<div class="sui-actions-right" id="' . $buttonID . '">' .
|
444 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Activate', 'forminator' ), 'forminator-addon-next sui-button-blue' ) .
|
445 |
'</div>';
|
446 |
}
|
447 |
|
addons/pro/hubspot/class-forminator-addon-hubspot-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'HubSpot failed to process submitted data. Please check your quiz and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -165,7 +165,7 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
165 |
$email_element_id = $connection_settings['fields_map']['email'];
|
166 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
167 |
/* translators: ... */
|
168 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Email on element %1$s not found or not filled on submitted data.',
|
169 |
}
|
170 |
$email = $submitted_data[ $email_element_id ];
|
171 |
$email = strtolower( trim( $email ) );
|
@@ -284,7 +284,7 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
284 |
return array(
|
285 |
'is_sent' => true,
|
286 |
'connection_name' => $connection_settings['name'],
|
287 |
-
'description' => __( 'Successfully send data to HubSpot',
|
288 |
'data_sent' => $api->get_last_data_sent(),
|
289 |
'data_received' => $api->get_last_data_received(),
|
290 |
'url_request' => $api->get_last_url_request(),
|
@@ -396,29 +396,29 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
396 |
}
|
397 |
$status = $addon_meta_data['value'];
|
398 |
$additional_entry_item = array(
|
399 |
-
'label' => __( 'HubSpot Integration',
|
400 |
'value' => '',
|
401 |
);
|
402 |
|
403 |
$sub_entries = array();
|
404 |
if ( isset( $status['connection_name'] ) ) {
|
405 |
$sub_entries[] = array(
|
406 |
-
'label' => __( 'Integration Name',
|
407 |
'value' => $status['connection_name'],
|
408 |
);
|
409 |
}
|
410 |
|
411 |
if ( isset( $status['is_sent'] ) ) {
|
412 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
413 |
$sub_entries[] = array(
|
414 |
-
'label' => __( 'Sent To HubSpot',
|
415 |
'value' => $is_sent,
|
416 |
);
|
417 |
}
|
418 |
|
419 |
if ( isset( $status['description'] ) ) {
|
420 |
$sub_entries[] = array(
|
421 |
-
'label' => __( 'Info',
|
422 |
'value' => $status['description'],
|
423 |
);
|
424 |
}
|
@@ -427,21 +427,21 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
427 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_HUBSPOT_SHOW_FULL_LOG', true)`
|
428 |
if ( isset( $status['url_request'] ) ) {
|
429 |
$sub_entries[] = array(
|
430 |
-
'label' => __( 'API URL',
|
431 |
'value' => $status['url_request'],
|
432 |
);
|
433 |
}
|
434 |
|
435 |
if ( isset( $status['data_sent'] ) ) {
|
436 |
$sub_entries[] = array(
|
437 |
-
'label' => __( 'Data sent to HubSpot',
|
438 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
439 |
);
|
440 |
}
|
441 |
|
442 |
if ( isset( $status['data_received'] ) ) {
|
443 |
$sub_entries[] = array(
|
444 |
-
'label' => __( 'Data received from HubSpot',
|
445 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
446 |
);
|
447 |
}
|
@@ -463,7 +463,7 @@ class Forminator_Addon_Hubspot_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Ab
|
|
463 |
public function on_export_render_title_row() {
|
464 |
|
465 |
$export_headers = array(
|
466 |
-
'info' => __( 'HubSpot Info',
|
467 |
);
|
468 |
|
469 |
$quiz_id = $this->quiz_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'HubSpot failed to process submitted data. Please check your quiz and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
165 |
$email_element_id = $connection_settings['fields_map']['email'];
|
166 |
if ( ! isset( $submitted_data[ $email_element_id ] ) || empty( $submitted_data[ $email_element_id ] ) ) {
|
167 |
/* translators: ... */
|
168 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Email on element %1$s not found or not filled on submitted data.', 'forminator' ) );
|
169 |
}
|
170 |
$email = $submitted_data[ $email_element_id ];
|
171 |
$email = strtolower( trim( $email ) );
|
284 |
return array(
|
285 |
'is_sent' => true,
|
286 |
'connection_name' => $connection_settings['name'],
|
287 |
+
'description' => __( 'Successfully send data to HubSpot', 'forminator' ),
|
288 |
'data_sent' => $api->get_last_data_sent(),
|
289 |
'data_received' => $api->get_last_data_received(),
|
290 |
'url_request' => $api->get_last_url_request(),
|
396 |
}
|
397 |
$status = $addon_meta_data['value'];
|
398 |
$additional_entry_item = array(
|
399 |
+
'label' => __( 'HubSpot Integration', 'forminator' ),
|
400 |
'value' => '',
|
401 |
);
|
402 |
|
403 |
$sub_entries = array();
|
404 |
if ( isset( $status['connection_name'] ) ) {
|
405 |
$sub_entries[] = array(
|
406 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
407 |
'value' => $status['connection_name'],
|
408 |
);
|
409 |
}
|
410 |
|
411 |
if ( isset( $status['is_sent'] ) ) {
|
412 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
413 |
$sub_entries[] = array(
|
414 |
+
'label' => __( 'Sent To HubSpot', 'forminator' ),
|
415 |
'value' => $is_sent,
|
416 |
);
|
417 |
}
|
418 |
|
419 |
if ( isset( $status['description'] ) ) {
|
420 |
$sub_entries[] = array(
|
421 |
+
'label' => __( 'Info', 'forminator' ),
|
422 |
'value' => $status['description'],
|
423 |
);
|
424 |
}
|
427 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_HUBSPOT_SHOW_FULL_LOG', true)`
|
428 |
if ( isset( $status['url_request'] ) ) {
|
429 |
$sub_entries[] = array(
|
430 |
+
'label' => __( 'API URL', 'forminator' ),
|
431 |
'value' => $status['url_request'],
|
432 |
);
|
433 |
}
|
434 |
|
435 |
if ( isset( $status['data_sent'] ) ) {
|
436 |
$sub_entries[] = array(
|
437 |
+
'label' => __( 'Data sent to HubSpot', 'forminator' ),
|
438 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
439 |
);
|
440 |
}
|
441 |
|
442 |
if ( isset( $status['data_received'] ) ) {
|
443 |
$sub_entries[] = array(
|
444 |
+
'label' => __( 'Data received from HubSpot', 'forminator' ),
|
445 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
446 |
);
|
447 |
}
|
463 |
public function on_export_render_title_row() {
|
464 |
|
465 |
$export_headers = array(
|
466 |
+
'info' => __( 'HubSpot Info', 'forminator' ),
|
467 |
);
|
468 |
|
469 |
$quiz_id = $this->quiz_id;
|
addons/pro/hubspot/class-forminator-addon-hubspot-quiz-settings.php
CHANGED
@@ -33,7 +33,7 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
33 |
|
34 |
$this->_update_quiz_settings_error_message = __(
|
35 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
36 |
-
|
37 |
);
|
38 |
}
|
39 |
|
@@ -91,7 +91,7 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
91 |
|
92 |
$quiz_questions = $this->get_quiz_fields();
|
93 |
$quiz_fields = array(
|
94 |
-
'quiz-name' => __( 'Quiz Name',
|
95 |
);
|
96 |
foreach ( $quiz_questions as $quiz_question ) {
|
97 |
// collect element ids
|
@@ -99,11 +99,11 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
99 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
100 |
}
|
101 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
102 |
-
$quiz_fields['correct-answers'] = __( 'Correct Answers',
|
103 |
-
$quiz_fields['total-answers'] = __( 'Total Answers',
|
104 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'correct-answers', 'total-answers' );
|
105 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
106 |
-
$quiz_fields['result-answers'] = __( 'Result Answer',
|
107 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'result-answers' );
|
108 |
}
|
109 |
|
@@ -125,10 +125,10 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
125 |
unset( $submitted_data['multi_id'] );
|
126 |
|
127 |
$fields = array(
|
128 |
-
'email' => __( 'Email Address',
|
129 |
-
'firstname' => __( 'First Name',
|
130 |
-
'lastname' => __( 'Last Name',
|
131 |
-
'jobtitle' => __( 'Job Title',
|
132 |
);
|
133 |
$template_params['fields'] = $fields;
|
134 |
try {
|
@@ -178,7 +178,7 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
178 |
$element_id = $fields_map[ $key ];
|
179 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
180 |
$input_exceptions->add_input_exception(/* translators: ... */
|
181 |
-
sprintf( __( 'Please assign valid field for %s',
|
182 |
$key . '_error'
|
183 |
);
|
184 |
continue;
|
@@ -219,14 +219,14 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
219 |
|
220 |
if ( $this->map_fields_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
221 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
222 |
-
esc_html__( 'Deactivate',
|
223 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
224 |
-
esc_html__( 'Deactivate this HubSpot Integration from this Form.',
|
225 |
);
|
226 |
}
|
227 |
|
228 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
229 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Continue',
|
230 |
'</div>';
|
231 |
|
232 |
return array(
|
@@ -283,7 +283,7 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
283 |
$template = forminator_addon_hubspot_dir() . 'views/quiz-settings/create-ticket.php';
|
284 |
|
285 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
286 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
287 |
}
|
288 |
|
289 |
$multi_id = $submitted_data['multi_id'];
|
@@ -371,11 +371,11 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
371 |
}
|
372 |
}
|
373 |
if ( empty( $pipeline ) ) {
|
374 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No pipeline found on your HubSpot account. Please create one.',
|
375 |
}
|
376 |
|
377 |
if ( empty( $status ) ) {
|
378 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No status found on your HubSpot account. Please create one.',
|
379 |
}
|
380 |
|
381 |
$template_params['status'] = $status;
|
@@ -455,18 +455,18 @@ class Forminator_Addon_Hubspot_Quiz_Settings extends Forminator_Addon_Quiz_Setti
|
|
455 |
$buttons = array();
|
456 |
if ( $this->create_ticket_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
457 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
458 |
-
esc_html__( 'Deactivate',
|
459 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
460 |
-
esc_html__( 'Deactivate this HubSpot Integration from this Form.',
|
461 |
);
|
462 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
463 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Update',
|
464 |
'</div>';
|
465 |
} else if ( ( isset( $submitted_data['create_ticket'] ) && '1' === $submitted_data['create_ticket'] ) && empty( $settings['re-authorize'] ) ) {
|
466 |
$buttons = array();
|
467 |
} else {
|
468 |
$buttons['next']['markup'] = '<div class="sui-actions-right" id="' . $buttonID . '">' .
|
469 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Activate',
|
470 |
'</div>';
|
471 |
}
|
472 |
|
33 |
|
34 |
$this->_update_quiz_settings_error_message = __(
|
35 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
36 |
+
'forminator'
|
37 |
);
|
38 |
}
|
39 |
|
91 |
|
92 |
$quiz_questions = $this->get_quiz_fields();
|
93 |
$quiz_fields = array(
|
94 |
+
'quiz-name' => __( 'Quiz Name', 'forminator' ),
|
95 |
);
|
96 |
foreach ( $quiz_questions as $quiz_question ) {
|
97 |
// collect element ids
|
99 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
100 |
}
|
101 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
102 |
+
$quiz_fields['correct-answers'] = __( 'Correct Answers', 'forminator' );
|
103 |
+
$quiz_fields['total-answers'] = __( 'Total Answers', 'forminator' );
|
104 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'correct-answers', 'total-answers' );
|
105 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
106 |
+
$quiz_fields['result-answers'] = __( 'Result Answer', 'forminator' );
|
107 |
array_push( $forminator_quiz_element_ids, 'quiz-name', 'result-answers' );
|
108 |
}
|
109 |
|
125 |
unset( $submitted_data['multi_id'] );
|
126 |
|
127 |
$fields = array(
|
128 |
+
'email' => __( 'Email Address', 'forminator' ),
|
129 |
+
'firstname' => __( 'First Name', 'forminator' ),
|
130 |
+
'lastname' => __( 'Last Name', 'forminator' ),
|
131 |
+
'jobtitle' => __( 'Job Title', 'forminator' ),
|
132 |
);
|
133 |
$template_params['fields'] = $fields;
|
134 |
try {
|
178 |
$element_id = $fields_map[ $key ];
|
179 |
if ( ! in_array( $element_id, $forminator_field_element_ids, true ) ) {
|
180 |
$input_exceptions->add_input_exception(/* translators: ... */
|
181 |
+
sprintf( __( 'Please assign valid field for %s', 'forminator' ), $title ),
|
182 |
$key . '_error'
|
183 |
);
|
184 |
continue;
|
219 |
|
220 |
if ( $this->map_fields_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
221 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
222 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
223 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
224 |
+
esc_html__( 'Deactivate this HubSpot Integration from this Form.', 'forminator' )
|
225 |
);
|
226 |
}
|
227 |
|
228 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
229 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Continue', 'forminator' ), 'forminator-addon-next' ) .
|
230 |
'</div>';
|
231 |
|
232 |
return array(
|
283 |
$template = forminator_addon_hubspot_dir() . 'views/quiz-settings/create-ticket.php';
|
284 |
|
285 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
286 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
287 |
}
|
288 |
|
289 |
$multi_id = $submitted_data['multi_id'];
|
371 |
}
|
372 |
}
|
373 |
if ( empty( $pipeline ) ) {
|
374 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No pipeline found on your HubSpot account. Please create one.', 'forminator' ) );
|
375 |
}
|
376 |
|
377 |
if ( empty( $status ) ) {
|
378 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No status found on your HubSpot account. Please create one.', 'forminator' ) );
|
379 |
}
|
380 |
|
381 |
$template_params['status'] = $status;
|
455 |
$buttons = array();
|
456 |
if ( $this->create_ticket_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
457 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
458 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
459 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
460 |
+
esc_html__( 'Deactivate this HubSpot Integration from this Form.', 'forminator' )
|
461 |
);
|
462 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
463 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Update', 'forminator' ), 'forminator-addon-next sui-button-blue' ) .
|
464 |
'</div>';
|
465 |
} else if ( ( isset( $submitted_data['create_ticket'] ) && '1' === $submitted_data['create_ticket'] ) && empty( $settings['re-authorize'] ) ) {
|
466 |
$buttons = array();
|
467 |
} else {
|
468 |
$buttons['next']['markup'] = '<div class="sui-actions-right" id="' . $buttonID . '">' .
|
469 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Activate', 'forminator' ), 'forminator-addon-next sui-button-blue' ) .
|
470 |
'</div>';
|
471 |
}
|
472 |
|
addons/pro/hubspot/class-forminator-addon-hubspot.php
CHANGED
@@ -52,13 +52,13 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
52 |
*/
|
53 |
public function __construct() {
|
54 |
// late init to allow translation
|
55 |
-
$this->_description = __( 'Get awesome by your form.',
|
56 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate HubSpot Integration, don\'t hesitate to contact us',
|
57 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate HubSpot Integration, please try again',
|
58 |
|
59 |
$this->_update_settings_error_message = __(
|
60 |
'Sorry, we failed to update settings, please check your form and try again',
|
61 |
-
|
62 |
);
|
63 |
|
64 |
$this->_icon = forminator_addon_hubspot_assets_url() . 'icons/hubspot.png';
|
@@ -103,7 +103,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
103 |
try {
|
104 |
// check if its active
|
105 |
if ( ! $this->is_active() ) {
|
106 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not active',
|
107 |
}
|
108 |
|
109 |
// if user completed api setup
|
@@ -143,17 +143,17 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
143 |
try {
|
144 |
$form_settings_instance = null;
|
145 |
if ( ! $this->is_connected() ) {
|
146 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected',
|
147 |
}
|
148 |
|
149 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
150 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Hubspot_Form_Settings ) {
|
151 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Form Settings of HubSpot',
|
152 |
}
|
153 |
|
154 |
// Mark as active when there is at least one active connection
|
155 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
156 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No active HubSpot connection found in this form',
|
157 |
}
|
158 |
|
159 |
$is_form_connected = true;
|
@@ -254,7 +254,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
254 |
$buttons = array();
|
255 |
if ( $this->is_connected() ) {
|
256 |
$buttons['disconnect'] = array(
|
257 |
-
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT',
|
258 |
);
|
259 |
|
260 |
$setting_values = $this->get_settings_values();
|
@@ -311,7 +311,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
311 |
|
312 |
if ( $this->_token ) {
|
313 |
$buttons['close'] = array(
|
314 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
315 |
);
|
316 |
$is_poll = false;
|
317 |
|
@@ -491,7 +491,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
491 |
}
|
492 |
|
493 |
if ( empty( $token ) ) {
|
494 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Failed to get token',
|
495 |
}
|
496 |
|
497 |
if ( ! $this->is_active() ) {
|
@@ -513,7 +513,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
513 |
$template_params['error_message'] = $e->getMessage();
|
514 |
}
|
515 |
} else {
|
516 |
-
$template_params['error_message'] = __( 'Failed to get authorization code.',
|
517 |
// todo : translate $query_args[error]
|
518 |
$settings['auth_error_message'] = $template_params['error_message'];
|
519 |
$this->save_settings_values( $settings );
|
@@ -603,7 +603,7 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
603 |
$api = $this->get_api();
|
604 |
$pipeline_request = $api->get_pipeline();
|
605 |
if ( empty( $pipeline_request ) ) {
|
606 |
-
throw new Exception( __( 'Pipeline can not be empty.',
|
607 |
}
|
608 |
if ( ! empty( $pipeline_request->results ) ) {
|
609 |
foreach ( $pipeline_request->results as $key => $data ) {
|
@@ -635,17 +635,17 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
635 |
try {
|
636 |
$quiz_settings_instance = null;
|
637 |
if ( ! $this->is_connected() ) {
|
638 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected',
|
639 |
}
|
640 |
|
641 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
642 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Hubspot_Quiz_Settings ) {
|
643 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Quiz Settings of HubSpot',
|
644 |
}
|
645 |
|
646 |
// Mark as active when there is at least one active connection
|
647 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
648 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'No active HubSpot connection found in this quiz',
|
649 |
}
|
650 |
|
651 |
$is_quiz_connected = true;
|
@@ -685,12 +685,12 @@ final class Forminator_Addon_Hubspot extends Forminator_Addon_Abstract {
|
|
685 |
// initialize with null
|
686 |
$quiz_settings_instance = null;
|
687 |
if ( ! $this->is_connected() ) {
|
688 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected',
|
689 |
}
|
690 |
|
691 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
692 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Hubspot_Quiz_Settings ) {
|
693 |
-
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Quiz Settings of HubSpot',
|
694 |
}
|
695 |
|
696 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
52 |
*/
|
53 |
public function __construct() {
|
54 |
// late init to allow translation
|
55 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
56 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate HubSpot Integration, don\'t hesitate to contact us', 'forminator' );
|
57 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate HubSpot Integration, please try again', 'forminator' );
|
58 |
|
59 |
$this->_update_settings_error_message = __(
|
60 |
'Sorry, we failed to update settings, please check your form and try again',
|
61 |
+
'forminator'
|
62 |
);
|
63 |
|
64 |
$this->_icon = forminator_addon_hubspot_assets_url() . 'icons/hubspot.png';
|
103 |
try {
|
104 |
// check if its active
|
105 |
if ( ! $this->is_active() ) {
|
106 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not active', 'forminator' ) );
|
107 |
}
|
108 |
|
109 |
// if user completed api setup
|
143 |
try {
|
144 |
$form_settings_instance = null;
|
145 |
if ( ! $this->is_connected() ) {
|
146 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected', 'forminator' ) );
|
147 |
}
|
148 |
|
149 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
150 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Hubspot_Form_Settings ) {
|
151 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Form Settings of HubSpot', 'forminator' ) );
|
152 |
}
|
153 |
|
154 |
// Mark as active when there is at least one active connection
|
155 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
156 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No active HubSpot connection found in this form', 'forminator' ) );
|
157 |
}
|
158 |
|
159 |
$is_form_connected = true;
|
254 |
$buttons = array();
|
255 |
if ( $this->is_connected() ) {
|
256 |
$buttons['disconnect'] = array(
|
257 |
+
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
258 |
);
|
259 |
|
260 |
$setting_values = $this->get_settings_values();
|
311 |
|
312 |
if ( $this->_token ) {
|
313 |
$buttons['close'] = array(
|
314 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'forminator-addon-connect forminator-addon-close' ),
|
315 |
);
|
316 |
$is_poll = false;
|
317 |
|
491 |
}
|
492 |
|
493 |
if ( empty( $token ) ) {
|
494 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Failed to get token', 'forminator' ) );
|
495 |
}
|
496 |
|
497 |
if ( ! $this->is_active() ) {
|
513 |
$template_params['error_message'] = $e->getMessage();
|
514 |
}
|
515 |
} else {
|
516 |
+
$template_params['error_message'] = __( 'Failed to get authorization code.', 'forminator' );
|
517 |
// todo : translate $query_args[error]
|
518 |
$settings['auth_error_message'] = $template_params['error_message'];
|
519 |
$this->save_settings_values( $settings );
|
603 |
$api = $this->get_api();
|
604 |
$pipeline_request = $api->get_pipeline();
|
605 |
if ( empty( $pipeline_request ) ) {
|
606 |
+
throw new Exception( __( 'Pipeline can not be empty.', 'forminator' ) );
|
607 |
}
|
608 |
if ( ! empty( $pipeline_request->results ) ) {
|
609 |
foreach ( $pipeline_request->results as $key => $data ) {
|
635 |
try {
|
636 |
$quiz_settings_instance = null;
|
637 |
if ( ! $this->is_connected() ) {
|
638 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected', 'forminator' ) );
|
639 |
}
|
640 |
|
641 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
642 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Hubspot_Quiz_Settings ) {
|
643 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Quiz Settings of HubSpot', 'forminator' ) );
|
644 |
}
|
645 |
|
646 |
// Mark as active when there is at least one active connection
|
647 |
if ( false === $quiz_settings_instance->find_one_active_connection() ) {
|
648 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'No active HubSpot connection found in this quiz', 'forminator' ) );
|
649 |
}
|
650 |
|
651 |
$is_quiz_connected = true;
|
685 |
// initialize with null
|
686 |
$quiz_settings_instance = null;
|
687 |
if ( ! $this->is_connected() ) {
|
688 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'HubSpot is not connected', 'forminator' ) );
|
689 |
}
|
690 |
|
691 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
692 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Hubspot_Quiz_Settings ) {
|
693 |
+
throw new Forminator_Addon_Hubspot_Exception( __( 'Invalid Quiz Settings of HubSpot', 'forminator' ) );
|
694 |
}
|
695 |
|
696 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
addons/pro/hubspot/lib/class-forminator-addon-hubspot-wp-api.php
CHANGED
@@ -72,7 +72,7 @@ class Forminator_Addon_Hubspot_Wp_Api {
|
|
72 |
public function __construct( $_token ) {
|
73 |
//prerequisites
|
74 |
if ( ! $_token ) {
|
75 |
-
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( __( 'Missing required Token',
|
76 |
}
|
77 |
|
78 |
$this->_token = $_token;
|
@@ -217,7 +217,7 @@ class Forminator_Addon_Hubspot_Wp_Api {
|
|
217 |
|
218 |
if ( is_wp_error( $res ) || ! $res ) {
|
219 |
throw new Forminator_Addon_Hubspot_Wp_Api_Exception(
|
220 |
-
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.',
|
221 |
);
|
222 |
}
|
223 |
|
@@ -231,10 +231,10 @@ class Forminator_Addon_Hubspot_Wp_Api {
|
|
231 |
|
232 |
if ( 404 === $status_code ) {
|
233 |
/* translators: ... */
|
234 |
-
throw new Forminator_Addon_Hubspot_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
235 |
}
|
236 |
/* translators: ... */
|
237 |
-
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
238 |
}
|
239 |
}
|
240 |
|
@@ -246,9 +246,9 @@ class Forminator_Addon_Hubspot_Wp_Api {
|
|
246 |
|
247 |
$this->_last_data_received = $res;
|
248 |
if ( isset( $res->status ) && 'error' === $res->status ) {
|
249 |
-
$message = isset( $res->message ) ? $res->message : __( 'Invalid',
|
250 |
/* translators: ... */
|
251 |
-
throw new Forminator_Addon_Hubspot_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
252 |
}
|
253 |
if ( isset( $res->ok ) && false === $res->ok ) {
|
254 |
$msg = '';
|
@@ -256,7 +256,7 @@ class Forminator_Addon_Hubspot_Wp_Api {
|
|
256 |
$msg = $res->error;
|
257 |
}
|
258 |
/* translators: ... */
|
259 |
-
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
260 |
}
|
261 |
}
|
262 |
|
72 |
public function __construct( $_token ) {
|
73 |
//prerequisites
|
74 |
if ( ! $_token ) {
|
75 |
+
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( __( 'Missing required Token', 'forminator' ) );
|
76 |
}
|
77 |
|
78 |
$this->_token = $_token;
|
217 |
|
218 |
if ( is_wp_error( $res ) || ! $res ) {
|
219 |
throw new Forminator_Addon_Hubspot_Wp_Api_Exception(
|
220 |
+
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.', 'forminator' )
|
221 |
);
|
222 |
}
|
223 |
|
231 |
|
232 |
if ( 404 === $status_code ) {
|
233 |
/* translators: ... */
|
234 |
+
throw new Forminator_Addon_Hubspot_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
235 |
}
|
236 |
/* translators: ... */
|
237 |
+
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
238 |
}
|
239 |
}
|
240 |
|
246 |
|
247 |
$this->_last_data_received = $res;
|
248 |
if ( isset( $res->status ) && 'error' === $res->status ) {
|
249 |
+
$message = isset( $res->message ) ? $res->message : __( 'Invalid', 'forminator' );
|
250 |
/* translators: ... */
|
251 |
+
throw new Forminator_Addon_Hubspot_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $message ) );
|
252 |
}
|
253 |
if ( isset( $res->ok ) && false === $res->ok ) {
|
254 |
$msg = '';
|
256 |
$msg = $res->error;
|
257 |
}
|
258 |
/* translators: ... */
|
259 |
+
throw new Forminator_Addon_Hubspot_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
260 |
}
|
261 |
}
|
262 |
|
addons/pro/hubspot/views/form-settings/create-contact.php
CHANGED
@@ -27,9 +27,9 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
27 |
?>
|
28 |
<div class="integration-header">
|
29 |
|
30 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Contact',
|
31 |
|
32 |
-
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'Let\'s start with choosing a HubSpot list and matching up your form fields with the default HubSpot contact fields to make sure we’re sending data to the right place.',
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -42,8 +42,8 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
42 |
<div tabindex="0" role="group" class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"<?php echo empty( $vars['lists'] ) ? ' disabled="disabled"' : ''; ?>>
|
43 |
|
44 |
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label">
|
45 |
-
<?php esc_html_e( 'HubSpot List (optional)',
|
46 |
-
<span class="sui-label-note"><?php esc_html_e( 'Static list only',
|
47 |
</label>
|
48 |
|
49 |
<select id="hubspot-list-id" class="<?php echo esc_attr( $list_selector_class ); ?>" aria-labelledby="hubspot-list-id-label" aria-describedby="hubspot-list-id-desc hubspot-list-id-error" name="list_id">
|
@@ -52,7 +52,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
52 |
// Select a list.
|
53 |
if ( ! empty( $vars['lists'] ) ) { ?>
|
54 |
|
55 |
-
<option value=""><?php esc_html_e( 'Select a list',
|
56 |
|
57 |
<?php
|
58 |
foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
@@ -63,7 +63,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
63 |
<?php
|
64 |
// Empty notice.
|
65 |
} else { ?>
|
66 |
-
<option value=""><?php esc_html_e( 'No static lists found on your HubSpot account',
|
67 |
<?php } ?>
|
68 |
|
69 |
</select>
|
@@ -76,21 +76,21 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
76 |
?>
|
77 |
</span>
|
78 |
|
79 |
-
<span id="hubspot-list-id-desc" class="sui-description"><?php esc_html_e( 'You can optionally add the contact to a static HubSpot list. Leave it empty to create a contact without adding it to a list.',
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div tabindex="0" role="group" class="sui-form-field" style="margin-bottom: 0;">
|
84 |
|
85 |
-
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label"><?php esc_html_e( 'Field Mapping',
|
86 |
|
87 |
<table class="sui-table" style="margin-top: 5px; margin-bottom: 0;">
|
88 |
|
89 |
<thead>
|
90 |
|
91 |
<tr>
|
92 |
-
<th><?php esc_html_e( 'HubSpot Fields',
|
93 |
-
<th><?php esc_html_e( 'Forminator Fields',
|
94 |
</tr>
|
95 |
|
96 |
</thead>
|
@@ -128,7 +128,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
128 |
?>
|
129 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>"<?php echo ( ! empty( $current_error ) ) ? ' style="padding-top: 5px;"' : ''; ?>>
|
130 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
131 |
-
<option value=""><?php esc_html_e( 'None',
|
132 |
<?php
|
133 |
if ( ! empty( $forminator_fields ) ) :
|
134 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
@@ -155,7 +155,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
155 |
<td>
|
156 |
<div class="sui-form-field">
|
157 |
<select class="sui-select" name=custom_property[]">
|
158 |
-
<option value=""><?php esc_html_e( 'None',
|
159 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
160 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
161 |
<option value="<?php echo esc_html( $p ); ?>" <?php selected( $custom, $p ); ?>><?php echo esc_html( $prop ); ?></option>
|
@@ -169,7 +169,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
169 |
|
170 |
<div class="sui-form-field">
|
171 |
<select class="sui-select" name="custom_field[]">
|
172 |
-
<option value=""><?php esc_html_e( 'None',
|
173 |
<?php
|
174 |
if ( ! empty( $forminator_fields ) ) :
|
175 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
@@ -195,7 +195,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
195 |
<td>
|
196 |
<div class="sui-form-field">
|
197 |
<select class="sui-select" name=custom_property[]">
|
198 |
-
<option value=""><?php esc_html_e( 'None',
|
199 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
200 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
201 |
<option value="<?php echo esc_html( $p ); ?>"><?php echo esc_html( $prop ); ?></option>
|
@@ -210,7 +210,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
210 |
|
211 |
<div class="sui-form-field">
|
212 |
<select class="sui-select" name="custom_field[]">
|
213 |
-
<option value=""><?php esc_html_e( 'None',
|
214 |
<?php
|
215 |
if ( ! empty( $forminator_fields ) ) :
|
216 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
@@ -236,7 +236,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
236 |
<td>
|
237 |
<div class="sui-button sui-button-ghost add-hubspot-field">
|
238 |
<i class="sui-icon-plus" aria-hidden="true"></i>
|
239 |
-
<?php esc_html_e( 'Add Additional field',
|
240 |
</div>
|
241 |
</td>
|
242 |
<td></td>
|
27 |
?>
|
28 |
<div class="integration-header">
|
29 |
|
30 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Contact', 'forminator' ) ); ?></h3>
|
31 |
|
32 |
+
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'Let\'s start with choosing a HubSpot list and matching up your form fields with the default HubSpot contact fields to make sure we’re sending data to the right place.', 'forminator' ); ?></p>
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
42 |
<div tabindex="0" role="group" class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"<?php echo empty( $vars['lists'] ) ? ' disabled="disabled"' : ''; ?>>
|
43 |
|
44 |
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label">
|
45 |
+
<?php esc_html_e( 'HubSpot List (optional)', 'forminator' ); ?>
|
46 |
+
<span class="sui-label-note"><?php esc_html_e( 'Static list only', 'forminator' ); ?></span>
|
47 |
</label>
|
48 |
|
49 |
<select id="hubspot-list-id" class="<?php echo esc_attr( $list_selector_class ); ?>" aria-labelledby="hubspot-list-id-label" aria-describedby="hubspot-list-id-desc hubspot-list-id-error" name="list_id">
|
52 |
// Select a list.
|
53 |
if ( ! empty( $vars['lists'] ) ) { ?>
|
54 |
|
55 |
+
<option value=""><?php esc_html_e( 'Select a list', 'forminator' ); ?></option>
|
56 |
|
57 |
<?php
|
58 |
foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
63 |
<?php
|
64 |
// Empty notice.
|
65 |
} else { ?>
|
66 |
+
<option value=""><?php esc_html_e( 'No static lists found on your HubSpot account', 'forminator' ); ?></option>
|
67 |
<?php } ?>
|
68 |
|
69 |
</select>
|
76 |
?>
|
77 |
</span>
|
78 |
|
79 |
+
<span id="hubspot-list-id-desc" class="sui-description"><?php esc_html_e( 'You can optionally add the contact to a static HubSpot list. Leave it empty to create a contact without adding it to a list.', 'forminator' ); ?></span>
|
80 |
|
81 |
</div>
|
82 |
|
83 |
<div tabindex="0" role="group" class="sui-form-field" style="margin-bottom: 0;">
|
84 |
|
85 |
+
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label"><?php esc_html_e( 'Field Mapping', 'forminator' ); ?></label>
|
86 |
|
87 |
<table class="sui-table" style="margin-top: 5px; margin-bottom: 0;">
|
88 |
|
89 |
<thead>
|
90 |
|
91 |
<tr>
|
92 |
+
<th><?php esc_html_e( 'HubSpot Fields', 'forminator' ); ?></th>
|
93 |
+
<th><?php esc_html_e( 'Forminator Fields', 'forminator' ); ?></th>
|
94 |
</tr>
|
95 |
|
96 |
</thead>
|
128 |
?>
|
129 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>"<?php echo ( ! empty( $current_error ) ) ? ' style="padding-top: 5px;"' : ''; ?>>
|
130 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
131 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
132 |
<?php
|
133 |
if ( ! empty( $forminator_fields ) ) :
|
134 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
155 |
<td>
|
156 |
<div class="sui-form-field">
|
157 |
<select class="sui-select" name=custom_property[]">
|
158 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
159 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
160 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
161 |
<option value="<?php echo esc_html( $p ); ?>" <?php selected( $custom, $p ); ?>><?php echo esc_html( $prop ); ?></option>
|
169 |
|
170 |
<div class="sui-form-field">
|
171 |
<select class="sui-select" name="custom_field[]">
|
172 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
173 |
<?php
|
174 |
if ( ! empty( $forminator_fields ) ) :
|
175 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
195 |
<td>
|
196 |
<div class="sui-form-field">
|
197 |
<select class="sui-select" name=custom_property[]">
|
198 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
199 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
200 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
201 |
<option value="<?php echo esc_html( $p ); ?>"><?php echo esc_html( $prop ); ?></option>
|
210 |
|
211 |
<div class="sui-form-field">
|
212 |
<select class="sui-select" name="custom_field[]">
|
213 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
214 |
<?php
|
215 |
if ( ! empty( $forminator_fields ) ) :
|
216 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
236 |
<td>
|
237 |
<div class="sui-button sui-button-ghost add-hubspot-field">
|
238 |
<i class="sui-icon-plus" aria-hidden="true"></i>
|
239 |
+
<?php esc_html_e( 'Add Additional field', 'forminator' ); ?>
|
240 |
</div>
|
241 |
</td>
|
242 |
<td></td>
|
addons/pro/hubspot/views/form-settings/create-ticket.php
CHANGED
@@ -22,9 +22,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
?>
|
23 |
<div class="integration-header">
|
24 |
|
25 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Ticket',
|
26 |
|
27 |
-
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'In addition to adding a new contact to your HubSpot account, you can also create a HubSpot ticket for each form submission.',
|
28 |
|
29 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
30 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -48,7 +48,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
48 |
<span class="sui-toggle-slider"></span>
|
49 |
</label>
|
50 |
|
51 |
-
<label for="create-ticket" id="create-ticket-label" class="sui-toggle-label"><?php esc_html_e( 'Create a HubSpot ticket for each submission',
|
52 |
|
53 |
</div>
|
54 |
|
@@ -61,16 +61,16 @@ foreach ( $template_vars as $key => $val ) {
|
|
61 |
>
|
62 |
<?php if ( empty( $vars['re-authorize'] ) && ! empty( $vars['token'] ) ) { ?>
|
63 |
<div class="sui-notice sui-notice-info">
|
64 |
-
<p style="margin-bottom: 5px;"><strong><?php esc_html_e( 'Authorize Forminator to access HubSpot tickets',
|
65 |
-
<p style="margin-top: 5px; margin-bottom: 10px;"><?php esc_html_e( 'Forminator requires additional permissions to create HubSpot tickets. Note that you will be taken to HubSpot website to grant Forminator access to HubSpot tickets and redirected back here.',
|
66 |
-
<p style="margin-top: 10px;"><a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authorize',
|
67 |
</div>
|
68 |
<?php } else { ?>
|
69 |
|
70 |
<!-- FIELD: Pipeline -->
|
71 |
<div class="sui-form-field">
|
72 |
|
73 |
-
<label for="hubspot-support-request" id="hubspot-support-request-label" class="sui-label"><?php esc_html_e( 'Pipeline',
|
74 |
|
75 |
<select
|
76 |
name="pipeline_id"
|
@@ -107,7 +107,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
107 |
<!-- FIELD: Ticket Status -->
|
108 |
<div class="sui-form-field">
|
109 |
|
110 |
-
<label for="hubspot-ticket-status" id="hubspot-ticket-status-label" class="sui-label"><?php esc_html_e( 'Ticket Status',
|
111 |
|
112 |
<select
|
113 |
name="status_id"
|
@@ -151,8 +151,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
151 |
<div class="sui-form-field<?php echo ( ! empty( $vars['ticket_name_error'] ) ) ? ' sui-form-field-error' : ''; ?>">
|
152 |
|
153 |
<label for="ticket-name-input" id="ticket-name-input-label" class="sui-label">
|
154 |
-
<?php esc_html_e( 'Ticket Name',
|
155 |
-
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields',
|
156 |
</label>
|
157 |
|
158 |
<div class="sui-insert-variables">
|
@@ -202,8 +202,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
202 |
<div class="sui-form-field">
|
203 |
|
204 |
<label for="ticket-description" id="ticket-description-label" class="sui-label">
|
205 |
-
<?php esc_html_e( 'Ticket Description (optional)',
|
206 |
-
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields',
|
207 |
</label>
|
208 |
|
209 |
<div class="sui-insert-variables">
|
@@ -243,7 +243,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
243 |
<!-- FIELD: Supported File -->
|
244 |
<div class="sui-form-field">
|
245 |
|
246 |
-
<label for="hubspot-support-file" id="hubspot-support-file-label" class="sui-label"><?php esc_html_e( 'Supported File (optional)',
|
247 |
|
248 |
<select
|
249 |
name="supported_file"
|
@@ -252,7 +252,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
252 |
aria-labelledby="hubspot-support-file-label"
|
253 |
>
|
254 |
|
255 |
-
<option value=""><?php esc_html_e( 'Select a file upload field',
|
256 |
|
257 |
<?php
|
258 |
$file_selected = $vars['supported_file'];
|
22 |
?>
|
23 |
<div class="integration-header">
|
24 |
|
25 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Ticket', 'forminator' ) ); ?></h3>
|
26 |
|
27 |
+
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'In addition to adding a new contact to your HubSpot account, you can also create a HubSpot ticket for each form submission.', 'forminator' ); ?></p>
|
28 |
|
29 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
30 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
48 |
<span class="sui-toggle-slider"></span>
|
49 |
</label>
|
50 |
|
51 |
+
<label for="create-ticket" id="create-ticket-label" class="sui-toggle-label"><?php esc_html_e( 'Create a HubSpot ticket for each submission', 'forminator' ); ?></label>
|
52 |
|
53 |
</div>
|
54 |
|
61 |
>
|
62 |
<?php if ( empty( $vars['re-authorize'] ) && ! empty( $vars['token'] ) ) { ?>
|
63 |
<div class="sui-notice sui-notice-info">
|
64 |
+
<p style="margin-bottom: 5px;"><strong><?php esc_html_e( 'Authorize Forminator to access HubSpot tickets', 'forminator' ); ?></strong></p>
|
65 |
+
<p style="margin-top: 5px; margin-bottom: 10px;"><?php esc_html_e( 'Forminator requires additional permissions to create HubSpot tickets. Note that you will be taken to HubSpot website to grant Forminator access to HubSpot tickets and redirected back here.', 'forminator' ); ?></p>
|
66 |
+
<p style="margin-top: 10px;"><a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authorize', 'forminator' ); ?></a></p>
|
67 |
</div>
|
68 |
<?php } else { ?>
|
69 |
|
70 |
<!-- FIELD: Pipeline -->
|
71 |
<div class="sui-form-field">
|
72 |
|
73 |
+
<label for="hubspot-support-request" id="hubspot-support-request-label" class="sui-label"><?php esc_html_e( 'Pipeline', 'forminator' ); ?></label>
|
74 |
|
75 |
<select
|
76 |
name="pipeline_id"
|
107 |
<!-- FIELD: Ticket Status -->
|
108 |
<div class="sui-form-field">
|
109 |
|
110 |
+
<label for="hubspot-ticket-status" id="hubspot-ticket-status-label" class="sui-label"><?php esc_html_e( 'Ticket Status', 'forminator' ); ?></label>
|
111 |
|
112 |
<select
|
113 |
name="status_id"
|
151 |
<div class="sui-form-field<?php echo ( ! empty( $vars['ticket_name_error'] ) ) ? ' sui-form-field-error' : ''; ?>">
|
152 |
|
153 |
<label for="ticket-name-input" id="ticket-name-input-label" class="sui-label">
|
154 |
+
<?php esc_html_e( 'Ticket Name', 'forminator' ); ?>
|
155 |
+
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields', 'forminator' ); ?></span>
|
156 |
</label>
|
157 |
|
158 |
<div class="sui-insert-variables">
|
202 |
<div class="sui-form-field">
|
203 |
|
204 |
<label for="ticket-description" id="ticket-description-label" class="sui-label">
|
205 |
+
<?php esc_html_e( 'Ticket Description (optional)', 'forminator' ); ?>
|
206 |
+
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields', 'forminator' ); ?></span>
|
207 |
</label>
|
208 |
|
209 |
<div class="sui-insert-variables">
|
243 |
<!-- FIELD: Supported File -->
|
244 |
<div class="sui-form-field">
|
245 |
|
246 |
+
<label for="hubspot-support-file" id="hubspot-support-file-label" class="sui-label"><?php esc_html_e( 'Supported File (optional)', 'forminator' ); ?></label>
|
247 |
|
248 |
<select
|
249 |
name="supported_file"
|
252 |
aria-labelledby="hubspot-support-file-label"
|
253 |
>
|
254 |
|
255 |
+
<option value=""><?php esc_html_e( 'Select a file upload field', 'forminator' ); ?></option>
|
256 |
|
257 |
<?php
|
258 |
$file_selected = $vars['supported_file'];
|
addons/pro/hubspot/views/quiz-settings/create-contact.php
CHANGED
@@ -28,9 +28,9 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
28 |
?>
|
29 |
<div class="integration-header">
|
30 |
|
31 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Contact',
|
32 |
|
33 |
-
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'Let\'s start with choosing a HubSpot list and matching up your quiz lead fields with the default HubSpot contact fields to make sure we’re sending data to the right place.',
|
34 |
|
35 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
36 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -43,8 +43,8 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
43 |
<div tabindex="0" role="group" class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"<?php echo empty( $vars['lists'] ) ? ' disabled="disabled"' : ''; ?>>
|
44 |
|
45 |
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label">
|
46 |
-
<?php esc_html_e( 'HubSpot List (optional)',
|
47 |
-
<span class="sui-label-note"><?php esc_html_e( 'Static list only',
|
48 |
</label>
|
49 |
|
50 |
<select id="hubspot-list-id" class="<?php echo esc_attr( $list_selector_class ); ?>" aria-labelledby="hubspot-list-id-label" aria-describedby="hubspot-list-id-desc hubspot-list-id-error" name="list_id">
|
@@ -53,7 +53,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
53 |
// Select a list.
|
54 |
if ( ! empty( $vars['lists'] ) ) { ?>
|
55 |
|
56 |
-
<option value=""><?php esc_html_e( 'Select a list',
|
57 |
|
58 |
<?php
|
59 |
foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
@@ -64,7 +64,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
64 |
<?php
|
65 |
// Empty notice.
|
66 |
} else { ?>
|
67 |
-
<option value=""><?php esc_html_e( 'No static lists found on your HubSpot account',
|
68 |
<?php } ?>
|
69 |
|
70 |
</select>
|
@@ -77,21 +77,21 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
77 |
?>
|
78 |
</span>
|
79 |
|
80 |
-
<span id="hubspot-list-id-desc" class="sui-description"><?php esc_html_e( 'You can optionally add the contact to a static HubSpot list. Leave it empty to create a contact without adding it to a list.',
|
81 |
|
82 |
</div>
|
83 |
|
84 |
<div tabindex="0" role="group" class="sui-form-field" style="margin-bottom: 0;">
|
85 |
|
86 |
-
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label"><?php esc_html_e( 'Field Mapping',
|
87 |
|
88 |
<table class="sui-table" style="margin-top: 5px; margin-bottom: 0;">
|
89 |
|
90 |
<thead>
|
91 |
|
92 |
<tr>
|
93 |
-
<th><?php esc_html_e( 'HubSpot Fields',
|
94 |
-
<th><?php esc_html_e( 'Forminator Fields',
|
95 |
</tr>
|
96 |
|
97 |
</thead>
|
@@ -129,7 +129,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
129 |
?>
|
130 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>"<?php echo ( ! empty( $current_error ) ) ? ' style="padding-top: 5px;"' : ''; ?>>
|
131 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
132 |
-
<option value=""><?php esc_html_e( 'None',
|
133 |
<?php if ( ! empty( $forminator_fields ) ) :
|
134 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
135 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
@@ -162,7 +162,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
162 |
<td>
|
163 |
<div class="sui-form-field">
|
164 |
<select class="sui-select" name=custom_property[]">
|
165 |
-
<option value=""><?php esc_html_e( 'None',
|
166 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
167 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
168 |
<option value="<?php echo esc_html( $p ); ?>" <?php selected( $custom, $p ); ?>><?php echo esc_html( $prop ); ?></option>
|
@@ -176,7 +176,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
176 |
|
177 |
<div class="sui-form-field">
|
178 |
<select class="sui-select" name="custom_field[]">
|
179 |
-
<option value=""><?php esc_html_e( 'None',
|
180 |
<?php
|
181 |
if ( ! empty( $forminator_fields ) ) :
|
182 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
@@ -207,7 +207,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
207 |
<td>
|
208 |
<div class="sui-form-field">
|
209 |
<select class="sui-select" name=custom_property[]">
|
210 |
-
<option value=""><?php esc_html_e( 'None',
|
211 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
212 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
213 |
<option value="<?php echo esc_html( $p ); ?>"><?php echo esc_html( $prop ); ?></option>
|
@@ -222,7 +222,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
222 |
|
223 |
<div class="sui-form-field">
|
224 |
<select class="sui-select" name="custom_field[]">
|
225 |
-
<option value=""><?php esc_html_e( 'None',
|
226 |
<?php
|
227 |
if ( ! empty( $forminator_fields ) ) :
|
228 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
@@ -252,7 +252,7 @@ $custom_field_map = isset( $vars['custom_fields_map'] ) ? array_filter( $vars['c
|
|
252 |
<td>
|
253 |
<div class="sui-button sui-button-ghost add-hubspot-field">
|
254 |
<i class="sui-icon-plus" aria-hidden="true"></i>
|
255 |
-
<?php esc_html_e( 'Add Additional field',
|
256 |
</div>
|
257 |
</td>
|
258 |
<td></td>
|
28 |
?>
|
29 |
<div class="integration-header">
|
30 |
|
31 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Contact', 'forminator' ) ); ?></h3>
|
32 |
|
33 |
+
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'Let\'s start with choosing a HubSpot list and matching up your quiz lead fields with the default HubSpot contact fields to make sure we’re sending data to the right place.', 'forminator' ); ?></p>
|
34 |
|
35 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
36 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
43 |
<div tabindex="0" role="group" class="sui-form-field<?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? ' sui-form-field-error' : '' ); ?>"<?php echo empty( $vars['lists'] ) ? ' disabled="disabled"' : ''; ?>>
|
44 |
|
45 |
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label">
|
46 |
+
<?php esc_html_e( 'HubSpot List (optional)', 'forminator' ); ?>
|
47 |
+
<span class="sui-label-note"><?php esc_html_e( 'Static list only', 'forminator' ); ?></span>
|
48 |
</label>
|
49 |
|
50 |
<select id="hubspot-list-id" class="<?php echo esc_attr( $list_selector_class ); ?>" aria-labelledby="hubspot-list-id-label" aria-describedby="hubspot-list-id-desc hubspot-list-id-error" name="list_id">
|
53 |
// Select a list.
|
54 |
if ( ! empty( $vars['lists'] ) ) { ?>
|
55 |
|
56 |
+
<option value=""><?php esc_html_e( 'Select a list', 'forminator' ); ?></option>
|
57 |
|
58 |
<?php
|
59 |
foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
64 |
<?php
|
65 |
// Empty notice.
|
66 |
} else { ?>
|
67 |
+
<option value=""><?php esc_html_e( 'No static lists found on your HubSpot account', 'forminator' ); ?></option>
|
68 |
<?php } ?>
|
69 |
|
70 |
</select>
|
77 |
?>
|
78 |
</span>
|
79 |
|
80 |
+
<span id="hubspot-list-id-desc" class="sui-description"><?php esc_html_e( 'You can optionally add the contact to a static HubSpot list. Leave it empty to create a contact without adding it to a list.', 'forminator' ); ?></span>
|
81 |
|
82 |
</div>
|
83 |
|
84 |
<div tabindex="0" role="group" class="sui-form-field" style="margin-bottom: 0;">
|
85 |
|
86 |
+
<label for="hubspot-list-id" id="hubspot-list-id-label" class="sui-label"><?php esc_html_e( 'Field Mapping', 'forminator' ); ?></label>
|
87 |
|
88 |
<table class="sui-table" style="margin-top: 5px; margin-bottom: 0;">
|
89 |
|
90 |
<thead>
|
91 |
|
92 |
<tr>
|
93 |
+
<th><?php esc_html_e( 'HubSpot Fields', 'forminator' ); ?></th>
|
94 |
+
<th><?php esc_html_e( 'Forminator Fields', 'forminator' ); ?></th>
|
95 |
</tr>
|
96 |
|
97 |
</thead>
|
129 |
?>
|
130 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $current_error ) ? 'sui-form-field-error' : '' ); ?>"<?php echo ( ! empty( $current_error ) ) ? ' style="padding-top: 5px;"' : ''; ?>>
|
131 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $key ); ?>]">
|
132 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
133 |
<?php if ( ! empty( $forminator_fields ) ) :
|
134 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
135 |
<option value="<?php echo esc_attr( $forminator_field['element_id'] ); ?>"
|
162 |
<td>
|
163 |
<div class="sui-form-field">
|
164 |
<select class="sui-select" name=custom_property[]">
|
165 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
166 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
167 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
168 |
<option value="<?php echo esc_html( $p ); ?>" <?php selected( $custom, $p ); ?>><?php echo esc_html( $prop ); ?></option>
|
176 |
|
177 |
<div class="sui-form-field">
|
178 |
<select class="sui-select" name="custom_field[]">
|
179 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
180 |
<?php
|
181 |
if ( ! empty( $forminator_fields ) ) :
|
182 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
207 |
<td>
|
208 |
<div class="sui-form-field">
|
209 |
<select class="sui-select" name=custom_property[]">
|
210 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
211 |
<?php if ( ! empty( $vars['properties'] ) ) {
|
212 |
foreach ( $vars['properties'] as $p => $prop ) { ?>
|
213 |
<option value="<?php echo esc_html( $p ); ?>"><?php echo esc_html( $prop ); ?></option>
|
222 |
|
223 |
<div class="sui-form-field">
|
224 |
<select class="sui-select" name="custom_field[]">
|
225 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
226 |
<?php
|
227 |
if ( ! empty( $forminator_fields ) ) :
|
228 |
foreach ( $forminator_fields as $forminator_field ) : ?>
|
252 |
<td>
|
253 |
<div class="sui-button sui-button-ghost add-hubspot-field">
|
254 |
<i class="sui-icon-plus" aria-hidden="true"></i>
|
255 |
+
<?php esc_html_e( 'Add Additional field', 'forminator' ); ?>
|
256 |
</div>
|
257 |
</td>
|
258 |
<td></td>
|
addons/pro/hubspot/views/quiz-settings/create-ticket.php
CHANGED
@@ -22,9 +22,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
?>
|
23 |
<div class="integration-header">
|
24 |
|
25 |
-
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Ticket',
|
26 |
|
27 |
-
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'In addition to adding a new contact to your HubSpot account, you can also create a HubSpot ticket for each quiz lead submission.',
|
28 |
|
29 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
30 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -48,7 +48,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
48 |
<span class="sui-toggle-slider"></span>
|
49 |
</label>
|
50 |
|
51 |
-
<label for="create-ticket" id="create-ticket-label" class="sui-toggle-label"><?php esc_html_e( 'Create a HubSpot ticket for each submission',
|
52 |
|
53 |
</div>
|
54 |
|
@@ -61,16 +61,16 @@ foreach ( $template_vars as $key => $val ) {
|
|
61 |
>
|
62 |
<?php if ( empty( $vars['re-authorize'] ) && ! empty( $vars['token'] ) ) { ?>
|
63 |
<div class="sui-notice sui-notice-info">
|
64 |
-
<p style="margin-bottom: 5px;"><strong><?php esc_html_e( 'Authorize Forminator to access HubSpot tickets',
|
65 |
-
<p style="margin-top: 5px; margin-bottom: 10px;"><?php esc_html_e( 'Forminator requires additional permissions to create HubSpot tickets. Note that you will be taken to HubSpot website to grant Forminator access to HubSpot tickets and redirected back here.',
|
66 |
-
<p style="margin-top: 10px;"><a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authorize',
|
67 |
</div>
|
68 |
<?php } else { ?>
|
69 |
|
70 |
<!-- FIELD: Pipeline -->
|
71 |
<div class="sui-form-field">
|
72 |
|
73 |
-
<label for="hubspot-support-request" id="hubspot-support-request-label" class="sui-label"><?php esc_html_e( 'Pipeline',
|
74 |
|
75 |
<select
|
76 |
name="pipeline_id"
|
@@ -107,7 +107,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
107 |
<!-- FIELD: Ticket Status -->
|
108 |
<div class="sui-form-field">
|
109 |
|
110 |
-
<label for="hubspot-ticket-status" id="hubspot-ticket-status-label" class="sui-label"><?php esc_html_e( 'Ticket Status',
|
111 |
|
112 |
<select
|
113 |
name="status_id"
|
@@ -151,8 +151,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
151 |
<div class="sui-form-field<?php echo ( ! empty( $vars['ticket_name_error'] ) ) ? ' sui-form-field-error' : ''; ?>">
|
152 |
|
153 |
<label for="ticket-name-input" id="ticket-name-input-label" class="sui-label">
|
154 |
-
<?php esc_html_e( 'Ticket Name',
|
155 |
-
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields',
|
156 |
</label>
|
157 |
|
158 |
<div class="sui-insert-variables">
|
@@ -169,7 +169,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
169 |
/>
|
170 |
|
171 |
<select id="select-ticket-name" class="select-field">
|
172 |
-
<option value="{quiz_name}" data-content="{quiz_name}"><?php esc_html_e( 'Quiz Name',
|
173 |
<?php
|
174 |
if ( ! empty( $vars['form_fields'] ) ) :
|
175 |
|
@@ -202,8 +202,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
202 |
<div class="sui-form-field">
|
203 |
|
204 |
<label for="ticket-description" id="ticket-description-label" class="sui-label">
|
205 |
-
<?php esc_html_e( 'Ticket Description (optional)',
|
206 |
-
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields',
|
207 |
</label>
|
208 |
|
209 |
<div class="sui-insert-variables">
|
@@ -219,7 +219,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
219 |
</textarea>
|
220 |
|
221 |
<select id="select-ticket-description" class="select-field">
|
222 |
-
<option value="{quiz_name}" data-content="{quiz_name}"><?php esc_html_e( 'Quiz Name',
|
223 |
<?php
|
224 |
if ( ! empty( $vars['form_fields'] ) ) :
|
225 |
|
@@ -243,7 +243,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
243 |
<!-- FIELD: Supported File -->
|
244 |
<div class="sui-form-field">
|
245 |
|
246 |
-
<label for="hubspot-support-file" id="hubspot-support-file-label" class="sui-label"><?php esc_html_e( 'Supported File (optional)',
|
247 |
|
248 |
<select
|
249 |
name="supported_file"
|
@@ -252,7 +252,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
252 |
aria-labelledby="hubspot-support-file-label"
|
253 |
>
|
254 |
|
255 |
-
<option value=""><?php esc_html_e( 'Select a file upload field',
|
256 |
|
257 |
<?php
|
258 |
$file_selected = $vars['supported_file'];
|
22 |
?>
|
23 |
<div class="integration-header">
|
24 |
|
25 |
+
<h3 id="dialogTitle2" class="sui-box-title"><?php echo esc_html( __( 'Create Ticket', 'forminator' ) ); ?></h3>
|
26 |
|
27 |
+
<p class="sui-description" style="max-width: 400px; margin: 20px auto 0; line-height: 22px;"><?php esc_html_e( 'In addition to adding a new contact to your HubSpot account, you can also create a HubSpot ticket for each quiz lead submission.', 'forminator' ); ?></p>
|
28 |
|
29 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
30 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
48 |
<span class="sui-toggle-slider"></span>
|
49 |
</label>
|
50 |
|
51 |
+
<label for="create-ticket" id="create-ticket-label" class="sui-toggle-label"><?php esc_html_e( 'Create a HubSpot ticket for each submission', 'forminator' ); ?></label>
|
52 |
|
53 |
</div>
|
54 |
|
61 |
>
|
62 |
<?php if ( empty( $vars['re-authorize'] ) && ! empty( $vars['token'] ) ) { ?>
|
63 |
<div class="sui-notice sui-notice-info">
|
64 |
+
<p style="margin-bottom: 5px;"><strong><?php esc_html_e( 'Authorize Forminator to access HubSpot tickets', 'forminator' ); ?></strong></p>
|
65 |
+
<p style="margin-top: 5px; margin-bottom: 10px;"><?php esc_html_e( 'Forminator requires additional permissions to create HubSpot tickets. Note that you will be taken to HubSpot website to grant Forminator access to HubSpot tickets and redirected back here.', 'forminator' ); ?></p>
|
66 |
+
<p style="margin-top: 10px;"><a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authorize', 'forminator' ); ?></a></p>
|
67 |
</div>
|
68 |
<?php } else { ?>
|
69 |
|
70 |
<!-- FIELD: Pipeline -->
|
71 |
<div class="sui-form-field">
|
72 |
|
73 |
+
<label for="hubspot-support-request" id="hubspot-support-request-label" class="sui-label"><?php esc_html_e( 'Pipeline', 'forminator' ); ?></label>
|
74 |
|
75 |
<select
|
76 |
name="pipeline_id"
|
107 |
<!-- FIELD: Ticket Status -->
|
108 |
<div class="sui-form-field">
|
109 |
|
110 |
+
<label for="hubspot-ticket-status" id="hubspot-ticket-status-label" class="sui-label"><?php esc_html_e( 'Ticket Status', 'forminator' ); ?></label>
|
111 |
|
112 |
<select
|
113 |
name="status_id"
|
151 |
<div class="sui-form-field<?php echo ( ! empty( $vars['ticket_name_error'] ) ) ? ' sui-form-field-error' : ''; ?>">
|
152 |
|
153 |
<label for="ticket-name-input" id="ticket-name-input-label" class="sui-label">
|
154 |
+
<?php esc_html_e( 'Ticket Name', 'forminator' ); ?>
|
155 |
+
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields', 'forminator' ); ?></span>
|
156 |
</label>
|
157 |
|
158 |
<div class="sui-insert-variables">
|
169 |
/>
|
170 |
|
171 |
<select id="select-ticket-name" class="select-field">
|
172 |
+
<option value="{quiz_name}" data-content="{quiz_name}"><?php esc_html_e( 'Quiz Name', 'forminator' ); ?></option>
|
173 |
<?php
|
174 |
if ( ! empty( $vars['form_fields'] ) ) :
|
175 |
|
202 |
<div class="sui-form-field">
|
203 |
|
204 |
<label for="ticket-description" id="ticket-description-label" class="sui-label">
|
205 |
+
<?php esc_html_e( 'Ticket Description (optional)', 'forminator' ); ?>
|
206 |
+
<span class="sui-label-note"><?php esc_html_e( 'Use the "+" icon to add form fields', 'forminator' ); ?></span>
|
207 |
</label>
|
208 |
|
209 |
<div class="sui-insert-variables">
|
219 |
</textarea>
|
220 |
|
221 |
<select id="select-ticket-description" class="select-field">
|
222 |
+
<option value="{quiz_name}" data-content="{quiz_name}"><?php esc_html_e( 'Quiz Name', 'forminator' ); ?></option>
|
223 |
<?php
|
224 |
if ( ! empty( $vars['form_fields'] ) ) :
|
225 |
|
243 |
<!-- FIELD: Supported File -->
|
244 |
<div class="sui-form-field">
|
245 |
|
246 |
+
<label for="hubspot-support-file" id="hubspot-support-file-label" class="sui-label"><?php esc_html_e( 'Supported File (optional)', 'forminator' ); ?></label>
|
247 |
|
248 |
<select
|
249 |
name="supported_file"
|
252 |
aria-labelledby="hubspot-support-file-label"
|
253 |
>
|
254 |
|
255 |
+
<option value=""><?php esc_html_e( 'Select a file upload field', 'forminator' ); ?></option>
|
256 |
|
257 |
<?php
|
258 |
$file_selected = $vars['supported_file'];
|
addons/pro/hubspot/views/sections/authorize.php
CHANGED
@@ -13,7 +13,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing HubSpot',
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
@@ -21,12 +21,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
21 |
<?php elseif ( $vars['is_close'] ) : ?>
|
22 |
<span class="sui-notice sui-notice-success">
|
23 |
<p>
|
24 |
-
<?php esc_html_e( 'Successfully authorized HubSpot, you can go back to integration settings.',
|
25 |
</p>
|
26 |
</span>
|
27 |
<?php else : ?>
|
28 |
<span class="sui-notice sui-notice-loading">
|
29 |
-
<p><?php esc_html_e( 'Please Wait...',
|
30 |
</span>
|
31 |
<?php endif; ?>
|
32 |
</div>
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing HubSpot', 'forminator' ); ?></h2>
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
21 |
<?php elseif ( $vars['is_close'] ) : ?>
|
22 |
<span class="sui-notice sui-notice-success">
|
23 |
<p>
|
24 |
+
<?php esc_html_e( 'Successfully authorized HubSpot, you can go back to integration settings.', 'forminator' ); ?>
|
25 |
</p>
|
26 |
</span>
|
27 |
<?php else : ?>
|
28 |
<span class="sui-notice sui-notice-loading">
|
29 |
+
<p><?php esc_html_e( 'Please Wait...', 'forminator' ); ?></p>
|
30 |
</span>
|
31 |
<?php endif; ?>
|
32 |
</div>
|
addons/pro/hubspot/views/settings/authorize.php
CHANGED
@@ -16,26 +16,26 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
<h3 id="dialogTitle2" class="sui-box-title">
|
17 |
<?php
|
18 |
/* translators: ... */
|
19 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
20 |
?>
|
21 |
</h3>
|
22 |
|
23 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
24 |
|
25 |
-
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( 'You are already connected to the HubSpot. You can disconnect your HubSpot Integration (if you need to) using the button below.',
|
26 |
|
27 |
<div class="sui-notice sui-notice-success" style="margin-bottom: -30px;">
|
28 |
<p>
|
29 |
<?php
|
30 |
/* translators: ... */
|
31 |
-
echo sprintf( esc_html__( 'You are connected to %2$s%1$s%3$s.',
|
32 |
?>
|
33 |
</p>
|
34 |
</div>
|
35 |
|
36 |
<?php else : ?>
|
37 |
|
38 |
-
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.",
|
39 |
|
40 |
<?php endif; ?>
|
41 |
|
@@ -45,7 +45,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
45 |
|
46 |
<div class="sui-block-content-center" style="margin-top: -10px; margin-bottom: -20px;">
|
47 |
|
48 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authenticate',
|
49 |
|
50 |
</div>
|
51 |
|
16 |
<h3 id="dialogTitle2" class="sui-box-title">
|
17 |
<?php
|
18 |
/* translators: ... */
|
19 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'HubSpot' ) );
|
20 |
?>
|
21 |
</h3>
|
22 |
|
23 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
24 |
|
25 |
+
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( 'You are already connected to the HubSpot. You can disconnect your HubSpot Integration (if you need to) using the button below.', 'forminator' ); ?></span>
|
26 |
|
27 |
<div class="sui-notice sui-notice-success" style="margin-bottom: -30px;">
|
28 |
<p>
|
29 |
<?php
|
30 |
/* translators: ... */
|
31 |
+
echo sprintf( esc_html__( 'You are connected to %2$s%1$s%3$s.', 'forminator' ), esc_html( $vars['user'] ), '<strong>', '</strong>' );
|
32 |
?>
|
33 |
</p>
|
34 |
</div>
|
35 |
|
36 |
<?php else : ?>
|
37 |
|
38 |
+
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.", 'forminator' ); ?></span>
|
39 |
|
40 |
<?php endif; ?>
|
41 |
|
45 |
|
46 |
<div class="sui-block-content-center" style="margin-top: -10px; margin-bottom: -20px;">
|
47 |
|
48 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authenticate', 'forminator' ); ?></a>
|
49 |
|
50 |
</div>
|
51 |
|
addons/pro/hubspot/views/settings/error-authorize.php
CHANGED
@@ -15,11 +15,11 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
<h3 id="dialogTitle2" class="sui-box-title">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
19 |
?>
|
20 |
</h3>
|
21 |
|
22 |
-
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.",
|
23 |
|
24 |
<p><?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<?php echo esc_html( $vars['error_message'] ); ?>
|
@@ -29,6 +29,6 @@ foreach ( $template_vars as $key => $val ) {
|
|
29 |
|
30 |
<div class="sui-block-content-center">
|
31 |
|
32 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authenticate',
|
33 |
|
34 |
</div>
|
15 |
<h3 id="dialogTitle2" class="sui-box-title">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'HubSpot' ) );
|
19 |
?>
|
20 |
</h3>
|
21 |
|
22 |
+
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.", 'forminator' ); ?></span>
|
23 |
|
24 |
<p><?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
25 |
<?php echo esc_html( $vars['error_message'] ); ?>
|
29 |
|
30 |
<div class="sui-block-content-center">
|
31 |
|
32 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'Authenticate', 'forminator' ); ?></a>
|
33 |
|
34 |
</div>
|
addons/pro/hubspot/views/settings/success-authorize.php
CHANGED
@@ -3,10 +3,10 @@
|
|
3 |
<h3 class="sui-box-title" id="dialogTitle2">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
-
echo esc_html( sprintf( __( '%1$s Connected',
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
-
<span class="sui-description" style="color: #666666; margin-top: 20px; margin-bottom: -30px; line-height: 22px;"><?php esc_html_e( 'Awesome! You are connected to HubSpot. You can now go to your forms and activate HubSpot integration to collect data.',
|
11 |
|
12 |
</div>
|
3 |
<h3 class="sui-box-title" id="dialogTitle2">
|
4 |
<?php
|
5 |
/* translators: ... */
|
6 |
+
echo esc_html( sprintf( __( '%1$s Connected', 'forminator' ), 'HubSpot' ) );
|
7 |
?>
|
8 |
</h3>
|
9 |
|
10 |
+
<span class="sui-description" style="color: #666666; margin-top: 20px; margin-bottom: -30px; line-height: 22px;"><?php esc_html_e( 'Awesome! You are connected to HubSpot. You can now go to your forms and activate HubSpot integration to collect data.', 'forminator' ); ?></span>
|
11 |
|
12 |
</div>
|
addons/pro/hubspot/views/settings/wait-authorize.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
<h3 id="dialogTitle2" class="sui-box-title">
|
15 |
<?php
|
16 |
/* translators: ... */
|
17 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
18 |
?>
|
19 |
</h3>
|
20 |
|
@@ -23,12 +23,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
<p>
|
24 |
<?php
|
25 |
/* translators: ... */
|
26 |
-
echo esc_html( sprintf( __( 'Your %1$s account is already authorized.',
|
27 |
?>
|
28 |
</p>
|
29 |
</div>
|
30 |
<?php else : ?>
|
31 |
-
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.",
|
32 |
<?php endif; ?>
|
33 |
|
34 |
</div>
|
@@ -38,7 +38,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
38 |
<div class="sui-block-content-center" style="margin-top: -10px; margin-bottom: -20px;">
|
39 |
|
40 |
<button type="button" class="sui-button">
|
41 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Authenticating',
|
42 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
43 |
</button>
|
44 |
|
14 |
<h3 id="dialogTitle2" class="sui-box-title">
|
15 |
<?php
|
16 |
/* translators: ... */
|
17 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'HubSpot' ) );
|
18 |
?>
|
19 |
</h3>
|
20 |
|
23 |
<p>
|
24 |
<?php
|
25 |
/* translators: ... */
|
26 |
+
echo esc_html( sprintf( __( 'Your %1$s account is already authorized.', 'forminator' ), 'HubSpot' ) );
|
27 |
?>
|
28 |
</p>
|
29 |
</div>
|
30 |
<?php else : ?>
|
31 |
+
<span class="sui-description" style="color: #666666; margin-top: 20px; line-height: 22px;"><?php esc_html_e( "Authenticate your HubSpot account using the button below. Note that you'll be taken to the HubSpot website to grant access to Forminator and then redirected back.", 'forminator' ); ?></span>
|
32 |
<?php endif; ?>
|
33 |
|
34 |
</div>
|
38 |
<div class="sui-block-content-center" style="margin-top: -10px; margin-bottom: -20px;">
|
39 |
|
40 |
<button type="button" class="sui-button">
|
41 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Authenticating', 'forminator' ); ?></span>
|
42 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
43 |
</button>
|
44 |
|
addons/pro/mailchimp/class-forminator-addon-mailchimp-form-hooks.php
CHANGED
@@ -46,7 +46,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
46 |
*/
|
47 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
48 |
parent::__construct( $addon, $form_id );
|
49 |
-
$this->_submit_form_error_message = __( 'Mailchimp failed to process submitted data. Please check your form and try again',
|
50 |
}
|
51 |
|
52 |
/**
|
@@ -96,12 +96,12 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
96 |
$input_name = 'forminator-addon-mailchimp-gdpr';
|
97 |
$input_id = $input_name . '-' . $uniq_id;
|
98 |
$html = '<div class="forminator-row"><div id="field-' . $input_id . '" class="forminator-col forminator-col-12"><div class="forminator-field">';
|
99 |
-
$html .= '<div class="forminator-field--label"><label class="forminator-label" id="forminator-label-' . $input_id . '">' . esc_html_e( 'Mailchimp GDPR',
|
100 |
. '</label></div>';
|
101 |
// matching checkbox with design
|
102 |
$form_settings = $this->form_settings_instance->get_form_settings();
|
103 |
$design_class = self::get_form_setting_value_as( $form_settings, 'form-style', 'default', 'string' );
|
104 |
-
if ( '
|
105 |
|
106 |
$html .= '<label class="forminator-checkbox">';
|
107 |
$html .= sprintf(
|
@@ -305,7 +305,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
305 |
$form_id,
|
306 |
$form_settings_instance
|
307 |
);
|
308 |
-
|
309 |
// Check if there is a date field-type then modify it to a format that mailchimp accepts.
|
310 |
foreach ( $submitted_data as $field => $value ) {
|
311 |
if ( false !== strpos( $field, 'date' ) && ! empty( $value ) ) {
|
@@ -337,7 +337,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
337 |
throw new Forminator_Addon_Mailchimp_Exception(
|
338 |
__(
|
339 |
'Forminator Addon Mailchimp was not sending subscriber to mailchimp as GDPR field is not checked on input',
|
340 |
-
|
341 |
)
|
342 |
);
|
343 |
|
@@ -349,13 +349,13 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
349 |
// EMAIL : super required**
|
350 |
if ( ! isset( $addon_setting_values['fields_map']['EMAIL'] ) ) {
|
351 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
352 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
353 |
);
|
354 |
}
|
355 |
|
356 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) || empty( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) ) {
|
357 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
358 |
-
sprintf( __( 'Required Field %1$s is not filled by user',
|
359 |
);
|
360 |
}
|
361 |
|
@@ -382,14 +382,14 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
382 |
foreach ( $address_fields as $addr => $address ) {
|
383 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
384 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
385 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
386 |
);
|
387 |
}
|
388 |
|
389 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] )
|
390 |
|| empty( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] ) ) {
|
391 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
392 |
-
sprintf( __( 'Required Field %1$s not filled by user',
|
393 |
);
|
394 |
}
|
395 |
}
|
@@ -397,7 +397,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
397 |
|
398 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ] ) ) {
|
399 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
400 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
401 |
);
|
402 |
}
|
403 |
|
@@ -408,7 +408,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
408 |
|
409 |
if ( ! $is_calculation && ! $is_stripe && ! $has_submit_data ) {
|
410 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
411 |
-
sprintf( __( 'Required Field %1$s not filled by user',
|
412 |
);
|
413 |
}
|
414 |
}
|
@@ -554,7 +554,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
554 |
throw new Forminator_Addon_Mailchimp_Exception(
|
555 |
__(
|
556 |
'Failed adding or updating member on Mailchimp list',
|
557 |
-
|
558 |
)
|
559 |
);
|
560 |
}
|
@@ -566,7 +566,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
566 |
'name' => 'status',
|
567 |
'value' => array(
|
568 |
'is_sent' => true,
|
569 |
-
'description' => __( 'Successfully added or updated member on Mailchimp list',
|
570 |
'data_sent' => $mailchimp_api->get_last_data_sent(),
|
571 |
'data_received' => $mailchimp_api->get_last_data_received(),
|
572 |
'url_request' => $mailchimp_api->get_last_url_request(),
|
@@ -708,23 +708,23 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
708 |
}
|
709 |
|
710 |
$additional_entry_item = array(
|
711 |
-
'label' => __( 'Mailchimp Integration',
|
712 |
'value' => '',
|
713 |
);
|
714 |
|
715 |
$status = $addon_meta_data['value'];
|
716 |
$sub_entries = array();
|
717 |
if ( isset( $status['is_sent'] ) ) {
|
718 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
719 |
$sub_entries[] = array(
|
720 |
-
'label' => __( 'Sent To Mailchimp',
|
721 |
'value' => $is_sent,
|
722 |
);
|
723 |
}
|
724 |
|
725 |
if ( isset( $status['description'] ) ) {
|
726 |
$sub_entries[] = array(
|
727 |
-
'label' => __( 'Info',
|
728 |
'value' => $status['description'],
|
729 |
);
|
730 |
}
|
@@ -733,7 +733,7 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
733 |
$data_received = $status['data_received'];
|
734 |
if ( isset( $data_received->status ) && ! empty( $data_received->status ) && is_string( $data_received->status ) ) {
|
735 |
$sub_entries[] = array(
|
736 |
-
'label' => __( 'Member Status',
|
737 |
'value' => strtoupper( $data_received->status ),
|
738 |
);
|
739 |
}
|
@@ -743,21 +743,21 @@ class Forminator_Addon_Mailchimp_Form_Hooks extends Forminator_Addon_Form_Hooks_
|
|
743 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_MAILCHIMP_SHOW_FULL_LOG', true)`
|
744 |
if ( isset( $status['url_request'] ) ) {
|
745 |
$sub_entries[] = array(
|
746 |
-
'label' => __( 'API URL',
|
747 |
'value' => $status['url_request'],
|
748 |
);
|
749 |
}
|
750 |
|
751 |
if ( isset( $status['data_sent'] ) ) {
|
752 |
$sub_entries[] = array(
|
753 |
-
'label' => __( 'Data sent to Mailchimp',
|
754 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
755 |
);
|
756 |
}
|
757 |
|
758 |
if ( isset( $status['data_received'] ) ) {
|
759 |
$sub_entries[] = array(
|
760 |
-
'label' => __( 'Data received from Mailchimp',
|
761 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
762 |
);
|
763 |
}
|
46 |
*/
|
47 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
48 |
parent::__construct( $addon, $form_id );
|
49 |
+
$this->_submit_form_error_message = __( 'Mailchimp failed to process submitted data. Please check your form and try again', 'forminator' );
|
50 |
}
|
51 |
|
52 |
/**
|
96 |
$input_name = 'forminator-addon-mailchimp-gdpr';
|
97 |
$input_id = $input_name . '-' . $uniq_id;
|
98 |
$html = '<div class="forminator-row"><div id="field-' . $input_id . '" class="forminator-col forminator-col-12"><div class="forminator-field">';
|
99 |
+
$html .= '<div class="forminator-field--label"><label class="forminator-label" id="forminator-label-' . $input_id . '">' . esc_html_e( 'Mailchimp GDPR', 'forminator' )
|
100 |
. '</label></div>';
|
101 |
// matching checkbox with design
|
102 |
$form_settings = $this->form_settings_instance->get_form_settings();
|
103 |
$design_class = self::get_form_setting_value_as( $form_settings, 'form-style', 'default', 'string' );
|
104 |
+
if ( 'none' === $design_class ) {
|
105 |
|
106 |
$html .= '<label class="forminator-checkbox">';
|
107 |
$html .= sprintf(
|
305 |
$form_id,
|
306 |
$form_settings_instance
|
307 |
);
|
308 |
+
|
309 |
// Check if there is a date field-type then modify it to a format that mailchimp accepts.
|
310 |
foreach ( $submitted_data as $field => $value ) {
|
311 |
if ( false !== strpos( $field, 'date' ) && ! empty( $value ) ) {
|
337 |
throw new Forminator_Addon_Mailchimp_Exception(
|
338 |
__(
|
339 |
'Forminator Addon Mailchimp was not sending subscriber to mailchimp as GDPR field is not checked on input',
|
340 |
+
'forminator'
|
341 |
)
|
342 |
);
|
343 |
|
349 |
// EMAIL : super required**
|
350 |
if ( ! isset( $addon_setting_values['fields_map']['EMAIL'] ) ) {
|
351 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
352 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), 'EMAIL' )
|
353 |
);
|
354 |
}
|
355 |
|
356 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) || empty( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) ) {
|
357 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
358 |
+
sprintf( __( 'Required Field %1$s is not filled by user', 'forminator' ), 'EMAIL' )
|
359 |
);
|
360 |
}
|
361 |
|
382 |
foreach ( $address_fields as $addr => $address ) {
|
383 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
384 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
385 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), $mailchimp_required_field->name )
|
386 |
);
|
387 |
}
|
388 |
|
389 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] )
|
390 |
|| empty( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] ) ) {
|
391 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
392 |
+
sprintf( __( 'Required Field %1$s not filled by user', 'forminator' ), $mailchimp_required_field->name )
|
393 |
);
|
394 |
}
|
395 |
}
|
397 |
|
398 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ] ) ) {
|
399 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
400 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), $mailchimp_required_field->name )
|
401 |
);
|
402 |
}
|
403 |
|
408 |
|
409 |
if ( ! $is_calculation && ! $is_stripe && ! $has_submit_data ) {
|
410 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
411 |
+
sprintf( __( 'Required Field %1$s not filled by user', 'forminator' ), $mailchimp_required_field->name )
|
412 |
);
|
413 |
}
|
414 |
}
|
554 |
throw new Forminator_Addon_Mailchimp_Exception(
|
555 |
__(
|
556 |
'Failed adding or updating member on Mailchimp list',
|
557 |
+
'forminator'
|
558 |
)
|
559 |
);
|
560 |
}
|
566 |
'name' => 'status',
|
567 |
'value' => array(
|
568 |
'is_sent' => true,
|
569 |
+
'description' => __( 'Successfully added or updated member on Mailchimp list', 'forminator' ),
|
570 |
'data_sent' => $mailchimp_api->get_last_data_sent(),
|
571 |
'data_received' => $mailchimp_api->get_last_data_received(),
|
572 |
'url_request' => $mailchimp_api->get_last_url_request(),
|
708 |
}
|
709 |
|
710 |
$additional_entry_item = array(
|
711 |
+
'label' => __( 'Mailchimp Integration', 'forminator' ),
|
712 |
'value' => '',
|
713 |
);
|
714 |
|
715 |
$status = $addon_meta_data['value'];
|
716 |
$sub_entries = array();
|
717 |
if ( isset( $status['is_sent'] ) ) {
|
718 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
719 |
$sub_entries[] = array(
|
720 |
+
'label' => __( 'Sent To Mailchimp', 'forminator' ),
|
721 |
'value' => $is_sent,
|
722 |
);
|
723 |
}
|
724 |
|
725 |
if ( isset( $status['description'] ) ) {
|
726 |
$sub_entries[] = array(
|
727 |
+
'label' => __( 'Info', 'forminator' ),
|
728 |
'value' => $status['description'],
|
729 |
);
|
730 |
}
|
733 |
$data_received = $status['data_received'];
|
734 |
if ( isset( $data_received->status ) && ! empty( $data_received->status ) && is_string( $data_received->status ) ) {
|
735 |
$sub_entries[] = array(
|
736 |
+
'label' => __( 'Member Status', 'forminator' ),
|
737 |
'value' => strtoupper( $data_received->status ),
|
738 |
);
|
739 |
}
|
743 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_MAILCHIMP_SHOW_FULL_LOG', true)`
|
744 |
if ( isset( $status['url_request'] ) ) {
|
745 |
$sub_entries[] = array(
|
746 |
+
'label' => __( 'API URL', 'forminator' ),
|
747 |
'value' => $status['url_request'],
|
748 |
);
|
749 |
}
|
750 |
|
751 |
if ( isset( $status['data_sent'] ) ) {
|
752 |
$sub_entries[] = array(
|
753 |
+
'label' => __( 'Data sent to Mailchimp', 'forminator' ),
|
754 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
755 |
);
|
756 |
}
|
757 |
|
758 |
if ( isset( $status['data_received'] ) ) {
|
759 |
$sub_entries[] = array(
|
760 |
+
'label' => __( 'Data received from Mailchimp', 'forminator' ),
|
761 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
762 |
);
|
763 |
}
|
addons/pro/mailchimp/class-forminator-addon-mailchimp-form-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,7 +118,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
118 |
$mail_list_name = $this->get_choosen_mail_list_name( $mail_lists, $submitted_data );
|
119 |
forminator_addon_maybe_log( __METHOD__, '$mail_list_name', $mail_list_name );
|
120 |
if ( empty( $mail_list_name ) ) {
|
121 |
-
throw new Forminator_Addon_Mailchimp_Form_Settings_Exception( __( 'Please select a valid Email Audience',
|
122 |
}
|
123 |
$this->addon_form_settings['mail_list_id'] = $submitted_data['mail_list_id'];
|
124 |
$this->addon_form_settings['mail_list_name'] = $mail_list_name;
|
@@ -146,7 +146,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
146 |
|
147 |
$html_field_mail_list
|
148 |
= '<div class="sui-form-field">
|
149 |
-
<label class="sui-label">' . __( 'Email Audience',
|
150 |
' . $html_select_mail_list . '
|
151 |
</div>';
|
152 |
|
@@ -156,7 +156,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
156 |
if ( isset( $input_error_messages['mail_list_id'] ) ) {
|
157 |
$html_field_mail_list
|
158 |
= '<div class="sui-form-field sui-form-field-error">
|
159 |
-
<label class="sui-label">' . __( 'Email Audience',
|
160 |
' . $html_select_mail_list . '
|
161 |
<span class="sui-error-message">' . esc_html( $input_error_messages['mail_list_id'] ) . '</span>
|
162 |
</div>';
|
@@ -170,32 +170,32 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
170 |
// add disconnect button if already is_form_connected
|
171 |
if ( $this->addon->is_form_connected( $this->form_id ) ) {
|
172 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
173 |
-
esc_html__( 'Deactivate',
|
174 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
175 |
-
esc_html__( 'Deactivate Mailchimp from this Form.',
|
176 |
);
|
177 |
}
|
178 |
|
179 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
180 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next',
|
181 |
'</div>';
|
182 |
|
183 |
$gdpr_fields = '';
|
184 |
if ( Forminator_Addon_Mailchimp::is_enable_gdpr() ) {
|
185 |
$gdpr_fields = '<div class="sui-form-field">' .
|
186 |
-
'<label class="sui-label">' . __( 'Enable GDPR',
|
187 |
<input type="checkbox" name="enable_gdpr" value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
188 |
</div>
|
189 |
|
190 |
<div class="sui-form-field">
|
191 |
-
<label class="sui-label">' . __( 'GDPR Text',
|
192 |
<textarea name="gdpr_text">' . $current_data['gdpr_text'] . '</textarea>
|
193 |
</div>';
|
194 |
}
|
195 |
|
196 |
return array(
|
197 |
-
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Choose your audience',
|
198 |
-
<span class="sui-description" style="margin-top: 20px;">' . __( 'Choose the audience you want to send form data to.',
|
199 |
' . $error_message . '</div>
|
200 |
<form enctype="multipart/form-data">
|
201 |
' . $html_field_mail_list . '
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
207 |
value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
208 |
<span class="sui-toggle-slider"></span>
|
209 |
</label>
|
210 |
-
<span class="sui-toggle-label" for="forminator_addon_mailchimp_enable_double_opt_in">' . __( 'Use Double Opt in',
|
211 |
</div>
|
212 |
' . $gdpr_fields . '
|
213 |
</form>',
|
@@ -340,14 +340,14 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
340 |
$buttons = array();
|
341 |
if ( $this->addon->is_form_connected( $this->form_id ) ) {
|
342 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
343 |
-
esc_html__( 'Deactivate',
|
344 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
345 |
-
esc_html__( 'Deactivate Mailchimp from this Form.',
|
346 |
);
|
347 |
}
|
348 |
|
349 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
350 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Save',
|
351 |
'</div>';
|
352 |
|
353 |
$notification = array();
|
@@ -360,8 +360,8 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
360 |
}
|
361 |
|
362 |
return array(
|
363 |
-
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Assign Fields',
|
364 |
-
<span class="sui-description" style="margin-top: 20px;">' . __( 'Lastly, match up your form fields with your campaign fields to make sure we\'re sending data to the right place.',
|
365 |
' . $error_message . '</div>
|
366 |
<form enctype="multipart/form-data">
|
367 |
' . $html_input_map_fields . '
|
@@ -402,7 +402,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
402 |
<div class="sui-form-field {{$error_css_class_EMAIL}}">
|
403 |
<select class="sui-select" name="fields_map[EMAIL]">
|
404 |
<?php if ( empty( $email_fields ) ) { ?>
|
405 |
-
<option value=""><?php esc_html_e( 'None',
|
406 |
<?php } else { ?>
|
407 |
<?php foreach ( $email_fields as $email_field ) { ?>
|
408 |
<option value="<?php echo esc_attr( $email_field['element_id'] ); ?>"
|
@@ -429,7 +429,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
429 |
<td>
|
430 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>_<?php echo esc_attr( $addr ); ?>}}">
|
431 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>][<?php echo esc_attr( $addr ); ?>]">
|
432 |
-
<option value=""><?php esc_html_e( 'None',
|
433 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
434 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
435 |
<?php selected( $current_data['fields_map'][ $item->tag ][ $addr ], $form_field['element_id'] ); ?>>
|
@@ -450,7 +450,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
450 |
<td>
|
451 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>}}">
|
452 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>]">
|
453 |
-
<option value=""><?php esc_html_e( 'None',
|
454 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
455 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
456 |
<?php selected( $current_data['fields_map'][ $item->tag ], $form_field['element_id'] ); ?>>
|
@@ -540,7 +540,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
540 |
$input_exceptions = new Forminator_Addon_Mailchimp_Form_Settings_Exception();
|
541 |
// EMAIL : super required**
|
542 |
if ( ! isset( $post_data['EMAIL'] ) || empty( $post_data['EMAIL'] ) ) {
|
543 |
-
$this->_update_form_settings_error_message = __( 'Please choose valid Forminator field for email address.',
|
544 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, 'EMAIL' );
|
545 |
}
|
546 |
|
@@ -553,7 +553,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
553 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) || empty( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
554 |
$this->_update_form_settings_error_message =
|
555 |
/* translators: ... */
|
556 |
-
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.',
|
557 |
$input_exceptions->add_sub_input_exception( $this->_update_form_settings_error_message, $mailchimp_required_field->tag, $addr );
|
558 |
}
|
559 |
}
|
@@ -562,7 +562,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
562 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ] ) || empty( $post_data[ $mailchimp_required_field->tag ] ) ) {
|
563 |
$this->_update_form_settings_error_message =
|
564 |
/* translators: ... */
|
565 |
-
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.',
|
566 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, $mailchimp_required_field->tag );
|
567 |
}
|
568 |
}
|
@@ -588,14 +588,14 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
588 |
|
589 |
$this->_update_form_settings_error_message =
|
590 |
/* translators: ... */
|
591 |
-
sprintf( __( 'Please choose valid Forminator field for %s.',
|
592 |
$input_exceptions->add_sub_input_exception( $this->_update_form_settings_error_message, $mailchimp_field_tag, $addr );
|
593 |
}
|
594 |
}
|
595 |
}
|
596 |
if ( ! is_array( $forminator_field_id ) && ! in_array( $forminator_field_id, $forminator_field_element_ids, true ) ) {
|
597 |
if ( 'EMAIL' === $mailchimp_field_tag ) {
|
598 |
-
$mailchimp_field_name = __( 'Email Address',
|
599 |
} else {
|
600 |
$mailchimp_field = $tag_maped_mailchimp_fields[ $mailchimp_field_tag ];
|
601 |
$mailchimp_field_name = $mailchimp_field->name;
|
@@ -603,7 +603,7 @@ class Forminator_Addon_Mailchimp_Form_Settings extends Forminator_Addon_Form_Set
|
|
603 |
|
604 |
$this->_update_form_settings_error_message =
|
605 |
/* translators: ... */
|
606 |
-
sprintf( __( 'Please choose valid Forminator field for %s.',
|
607 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, $mailchimp_field_tag );
|
608 |
}
|
609 |
}
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$mail_list_name = $this->get_choosen_mail_list_name( $mail_lists, $submitted_data );
|
119 |
forminator_addon_maybe_log( __METHOD__, '$mail_list_name', $mail_list_name );
|
120 |
if ( empty( $mail_list_name ) ) {
|
121 |
+
throw new Forminator_Addon_Mailchimp_Form_Settings_Exception( __( 'Please select a valid Email Audience', 'forminator' ), 'mail_list_id' );
|
122 |
}
|
123 |
$this->addon_form_settings['mail_list_id'] = $submitted_data['mail_list_id'];
|
124 |
$this->addon_form_settings['mail_list_name'] = $mail_list_name;
|
146 |
|
147 |
$html_field_mail_list
|
148 |
= '<div class="sui-form-field">
|
149 |
+
<label class="sui-label">' . __( 'Email Audience', 'forminator' ) . '</label>
|
150 |
' . $html_select_mail_list . '
|
151 |
</div>';
|
152 |
|
156 |
if ( isset( $input_error_messages['mail_list_id'] ) ) {
|
157 |
$html_field_mail_list
|
158 |
= '<div class="sui-form-field sui-form-field-error">
|
159 |
+
<label class="sui-label">' . __( 'Email Audience', 'forminator' ) . '</label>
|
160 |
' . $html_select_mail_list . '
|
161 |
<span class="sui-error-message">' . esc_html( $input_error_messages['mail_list_id'] ) . '</span>
|
162 |
</div>';
|
170 |
// add disconnect button if already is_form_connected
|
171 |
if ( $this->addon->is_form_connected( $this->form_id ) ) {
|
172 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
173 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
174 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
175 |
+
esc_html__( 'Deactivate Mailchimp from this Form.', 'forminator' )
|
176 |
);
|
177 |
}
|
178 |
|
179 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
180 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
181 |
'</div>';
|
182 |
|
183 |
$gdpr_fields = '';
|
184 |
if ( Forminator_Addon_Mailchimp::is_enable_gdpr() ) {
|
185 |
$gdpr_fields = '<div class="sui-form-field">' .
|
186 |
+
'<label class="sui-label">' . __( 'Enable GDPR', 'forminator' ) . '</label>
|
187 |
<input type="checkbox" name="enable_gdpr" value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
188 |
</div>
|
189 |
|
190 |
<div class="sui-form-field">
|
191 |
+
<label class="sui-label">' . __( 'GDPR Text', 'forminator' ) . '</label>
|
192 |
<textarea name="gdpr_text">' . $current_data['gdpr_text'] . '</textarea>
|
193 |
</div>';
|
194 |
}
|
195 |
|
196 |
return array(
|
197 |
+
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Choose your audience', 'forminator' ) . '</h3>
|
198 |
+
<span class="sui-description" style="margin-top: 20px;">' . __( 'Choose the audience you want to send form data to.', 'forminator' ) . '</span>
|
199 |
' . $error_message . '</div>
|
200 |
<form enctype="multipart/form-data">
|
201 |
' . $html_field_mail_list . '
|
207 |
value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
208 |
<span class="sui-toggle-slider"></span>
|
209 |
</label>
|
210 |
+
<span class="sui-toggle-label" for="forminator_addon_mailchimp_enable_double_opt_in">' . __( 'Use Double Opt in', 'forminator' ) . '</span>
|
211 |
</div>
|
212 |
' . $gdpr_fields . '
|
213 |
</form>',
|
340 |
$buttons = array();
|
341 |
if ( $this->addon->is_form_connected( $this->form_id ) ) {
|
342 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
343 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
344 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
345 |
+
esc_html__( 'Deactivate Mailchimp from this Form.', 'forminator' )
|
346 |
);
|
347 |
}
|
348 |
|
349 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
350 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
351 |
'</div>';
|
352 |
|
353 |
$notification = array();
|
360 |
}
|
361 |
|
362 |
return array(
|
363 |
+
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Assign Fields', 'forminator' ) . '</h3>
|
364 |
+
<span class="sui-description" style="margin-top: 20px;">' . __( 'Lastly, match up your form fields with your campaign fields to make sure we\'re sending data to the right place.', 'forminator' ) . '</span>
|
365 |
' . $error_message . '</div>
|
366 |
<form enctype="multipart/form-data">
|
367 |
' . $html_input_map_fields . '
|
402 |
<div class="sui-form-field {{$error_css_class_EMAIL}}">
|
403 |
<select class="sui-select" name="fields_map[EMAIL]">
|
404 |
<?php if ( empty( $email_fields ) ) { ?>
|
405 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
406 |
<?php } else { ?>
|
407 |
<?php foreach ( $email_fields as $email_field ) { ?>
|
408 |
<option value="<?php echo esc_attr( $email_field['element_id'] ); ?>"
|
429 |
<td>
|
430 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>_<?php echo esc_attr( $addr ); ?>}}">
|
431 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>][<?php echo esc_attr( $addr ); ?>]">
|
432 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
433 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
434 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
435 |
<?php selected( $current_data['fields_map'][ $item->tag ][ $addr ], $form_field['element_id'] ); ?>>
|
450 |
<td>
|
451 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>}}">
|
452 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>]">
|
453 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
454 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
455 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
456 |
<?php selected( $current_data['fields_map'][ $item->tag ], $form_field['element_id'] ); ?>>
|
540 |
$input_exceptions = new Forminator_Addon_Mailchimp_Form_Settings_Exception();
|
541 |
// EMAIL : super required**
|
542 |
if ( ! isset( $post_data['EMAIL'] ) || empty( $post_data['EMAIL'] ) ) {
|
543 |
+
$this->_update_form_settings_error_message = __( 'Please choose valid Forminator field for email address.', 'forminator' );
|
544 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, 'EMAIL' );
|
545 |
}
|
546 |
|
553 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) || empty( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
554 |
$this->_update_form_settings_error_message =
|
555 |
/* translators: ... */
|
556 |
+
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.', 'forminator' ), $mailchimp_required_field->name );
|
557 |
$input_exceptions->add_sub_input_exception( $this->_update_form_settings_error_message, $mailchimp_required_field->tag, $addr );
|
558 |
}
|
559 |
}
|
562 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ] ) || empty( $post_data[ $mailchimp_required_field->tag ] ) ) {
|
563 |
$this->_update_form_settings_error_message =
|
564 |
/* translators: ... */
|
565 |
+
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.', 'forminator' ), $mailchimp_required_field->name );
|
566 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, $mailchimp_required_field->tag );
|
567 |
}
|
568 |
}
|
588 |
|
589 |
$this->_update_form_settings_error_message =
|
590 |
/* translators: ... */
|
591 |
+
sprintf( __( 'Please choose valid Forminator field for %s.', 'forminator' ), $mailchimp_field_name );
|
592 |
$input_exceptions->add_sub_input_exception( $this->_update_form_settings_error_message, $mailchimp_field_tag, $addr );
|
593 |
}
|
594 |
}
|
595 |
}
|
596 |
if ( ! is_array( $forminator_field_id ) && ! in_array( $forminator_field_id, $forminator_field_element_ids, true ) ) {
|
597 |
if ( 'EMAIL' === $mailchimp_field_tag ) {
|
598 |
+
$mailchimp_field_name = __( 'Email Address', 'forminator' );
|
599 |
} else {
|
600 |
$mailchimp_field = $tag_maped_mailchimp_fields[ $mailchimp_field_tag ];
|
601 |
$mailchimp_field_name = $mailchimp_field->name;
|
603 |
|
604 |
$this->_update_form_settings_error_message =
|
605 |
/* translators: ... */
|
606 |
+
sprintf( __( 'Please choose valid Forminator field for %s.', 'forminator' ), $mailchimp_field_name );
|
607 |
$input_exceptions->add_input_exception( $this->_update_form_settings_error_message, $mailchimp_field_tag );
|
608 |
}
|
609 |
}
|
addons/pro/mailchimp/class-forminator-addon-mailchimp-quiz-hooks.php
CHANGED
@@ -46,7 +46,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
46 |
*/
|
47 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
48 |
parent::__construct( $addon, $quiz_id );
|
49 |
-
$this->_submit_quiz_error_message = __( 'Mailchimp failed to process submitted data. Please check your form and try again',
|
50 |
}
|
51 |
|
52 |
/**
|
@@ -96,12 +96,12 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
96 |
$input_name = 'forminator-addon-mailchimp-gdpr';
|
97 |
$input_id = $input_name . '-' . $uniq_id;
|
98 |
$html = '<div class="forminator-row"><div id="field-' . $input_id . '" class="forminator-col forminator-col-12"><div class="forminator-field">';
|
99 |
-
$html .= '<div class="forminator-field--label"><label class="forminator-label" id="forminator-label-' . $input_id . '">' . esc_html_e( 'Mailchimp GDPR',
|
100 |
. '</label></div>';
|
101 |
// matching checkbox with design
|
102 |
$form_settings = $this->quiz_settings_instance->get_quiz_settings();
|
103 |
$design_class = self::get_form_setting_value_as( $form_settings, 'form-style', 'default', 'string' );
|
104 |
-
if ( '
|
105 |
|
106 |
$html .= '<label class="forminator-checkbox">';
|
107 |
$html .= sprintf(
|
@@ -334,7 +334,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
334 |
throw new Forminator_Addon_Mailchimp_Exception(
|
335 |
__(
|
336 |
'Forminator Addon Mailchimp was not sending subscriber to mailchimp as GDPR field is not checked on input',
|
337 |
-
|
338 |
)
|
339 |
);
|
340 |
|
@@ -346,13 +346,13 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
346 |
// EMAIL : super required**
|
347 |
if ( ! isset( $addon_setting_values['fields_map']['EMAIL'] ) ) {
|
348 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
349 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
350 |
);
|
351 |
}
|
352 |
|
353 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) || empty( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) ) {
|
354 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
355 |
-
sprintf( __( 'Required Field %1$s is not filled by user',
|
356 |
);
|
357 |
}
|
358 |
|
@@ -379,14 +379,14 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
379 |
foreach ( $address_fields as $addr => $address ) {
|
380 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
381 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
382 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
383 |
);
|
384 |
}
|
385 |
|
386 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] )
|
387 |
|| empty( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] ) ) {
|
388 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
389 |
-
sprintf( __( 'Required Field %1$s not filled by user',
|
390 |
);
|
391 |
}
|
392 |
}
|
@@ -394,7 +394,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
394 |
|
395 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ] ) ) {
|
396 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
397 |
-
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings',
|
398 |
);
|
399 |
}
|
400 |
|
@@ -405,7 +405,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
405 |
|
406 |
if ( ! $is_calculation && ! $is_stripe && ! $has_submit_data ) {
|
407 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
408 |
-
sprintf( __( 'Required Field %1$s not filled by user',
|
409 |
);
|
410 |
}
|
411 |
}
|
@@ -546,7 +546,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
546 |
throw new Forminator_Addon_Mailchimp_Exception(
|
547 |
__(
|
548 |
'Failed adding or updating member on Mailchimp list',
|
549 |
-
|
550 |
)
|
551 |
);
|
552 |
}
|
@@ -558,7 +558,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
558 |
'name' => 'status',
|
559 |
'value' => array(
|
560 |
'is_sent' => true,
|
561 |
-
'description' => __( 'Successfully added or updated member on Mailchimp list',
|
562 |
'data_sent' => $mailchimp_api->get_last_data_sent(),
|
563 |
'data_received' => $mailchimp_api->get_last_data_received(),
|
564 |
'url_request' => $mailchimp_api->get_last_url_request(),
|
@@ -700,23 +700,23 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
700 |
}
|
701 |
|
702 |
$additional_entry_item = array(
|
703 |
-
'label' => __( 'Mailchimp Integration',
|
704 |
'value' => '',
|
705 |
);
|
706 |
|
707 |
$status = $addon_meta_data['value'];
|
708 |
$sub_entries = array();
|
709 |
if ( isset( $status['is_sent'] ) ) {
|
710 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
711 |
$sub_entries[] = array(
|
712 |
-
'label' => __( 'Sent To Mailchimp',
|
713 |
'value' => $is_sent,
|
714 |
);
|
715 |
}
|
716 |
|
717 |
if ( isset( $status['description'] ) ) {
|
718 |
$sub_entries[] = array(
|
719 |
-
'label' => __( 'Info',
|
720 |
'value' => $status['description'],
|
721 |
);
|
722 |
}
|
@@ -725,7 +725,7 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
725 |
$data_received = $status['data_received'];
|
726 |
if ( isset( $data_received->status ) && ! empty( $data_received->status ) && is_string( $data_received->status ) ) {
|
727 |
$sub_entries[] = array(
|
728 |
-
'label' => __( 'Member Status',
|
729 |
'value' => strtoupper( $data_received->status ),
|
730 |
);
|
731 |
}
|
@@ -735,21 +735,21 @@ class Forminator_Addon_Mailchimp_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_
|
|
735 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_MAILCHIMP_SHOW_FULL_LOG', true)`
|
736 |
if ( isset( $status['url_request'] ) ) {
|
737 |
$sub_entries[] = array(
|
738 |
-
'label' => __( 'API URL',
|
739 |
'value' => $status['url_request'],
|
740 |
);
|
741 |
}
|
742 |
|
743 |
if ( isset( $status['data_sent'] ) ) {
|
744 |
$sub_entries[] = array(
|
745 |
-
'label' => __( 'Data sent to Mailchimp',
|
746 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
747 |
);
|
748 |
}
|
749 |
|
750 |
if ( isset( $status['data_received'] ) ) {
|
751 |
$sub_entries[] = array(
|
752 |
-
'label' => __( 'Data received from Mailchimp',
|
753 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
754 |
);
|
755 |
}
|
46 |
*/
|
47 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
48 |
parent::__construct( $addon, $quiz_id );
|
49 |
+
$this->_submit_quiz_error_message = __( 'Mailchimp failed to process submitted data. Please check your form and try again', 'forminator' );
|
50 |
}
|
51 |
|
52 |
/**
|
96 |
$input_name = 'forminator-addon-mailchimp-gdpr';
|
97 |
$input_id = $input_name . '-' . $uniq_id;
|
98 |
$html = '<div class="forminator-row"><div id="field-' . $input_id . '" class="forminator-col forminator-col-12"><div class="forminator-field">';
|
99 |
+
$html .= '<div class="forminator-field--label"><label class="forminator-label" id="forminator-label-' . $input_id . '">' . esc_html_e( 'Mailchimp GDPR', 'forminator' )
|
100 |
. '</label></div>';
|
101 |
// matching checkbox with design
|
102 |
$form_settings = $this->quiz_settings_instance->get_quiz_settings();
|
103 |
$design_class = self::get_form_setting_value_as( $form_settings, 'form-style', 'default', 'string' );
|
104 |
+
if ( 'none' === $design_class ) {
|
105 |
|
106 |
$html .= '<label class="forminator-checkbox">';
|
107 |
$html .= sprintf(
|
334 |
throw new Forminator_Addon_Mailchimp_Exception(
|
335 |
__(
|
336 |
'Forminator Addon Mailchimp was not sending subscriber to mailchimp as GDPR field is not checked on input',
|
337 |
+
'forminator'
|
338 |
)
|
339 |
);
|
340 |
|
346 |
// EMAIL : super required**
|
347 |
if ( ! isset( $addon_setting_values['fields_map']['EMAIL'] ) ) {
|
348 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
349 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), 'EMAIL' )
|
350 |
);
|
351 |
}
|
352 |
|
353 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) || empty( $submitted_data[ $addon_setting_values['fields_map']['EMAIL'] ] ) ) {
|
354 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
355 |
+
sprintf( __( 'Required Field %1$s is not filled by user', 'forminator' ), 'EMAIL' )
|
356 |
);
|
357 |
}
|
358 |
|
379 |
foreach ( $address_fields as $addr => $address ) {
|
380 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
381 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
382 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), $mailchimp_required_field->name )
|
383 |
);
|
384 |
}
|
385 |
|
386 |
if ( ! isset( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] )
|
387 |
|| empty( $submitted_data[ $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ][ $addr ] ] ) ) {
|
388 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
389 |
+
sprintf( __( 'Required Field %1$s not filled by user', 'forminator' ), $mailchimp_required_field->name )
|
390 |
);
|
391 |
}
|
392 |
}
|
394 |
|
395 |
if ( ! isset( $addon_setting_values['fields_map'][ $mailchimp_required_field->tag ] ) ) {
|
396 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
397 |
+
sprintf( __( 'Required Field %1$s not mapped yet to Forminator Form Field, Please check your Mailchimp Configuration on Form Settings', 'forminator' ), $mailchimp_required_field->name )
|
398 |
);
|
399 |
}
|
400 |
|
405 |
|
406 |
if ( ! $is_calculation && ! $is_stripe && ! $has_submit_data ) {
|
407 |
throw new Forminator_Addon_Mailchimp_Exception(/* translators: ... */
|
408 |
+
sprintf( __( 'Required Field %1$s not filled by user', 'forminator' ), $mailchimp_required_field->name )
|
409 |
);
|
410 |
}
|
411 |
}
|
546 |
throw new Forminator_Addon_Mailchimp_Exception(
|
547 |
__(
|
548 |
'Failed adding or updating member on Mailchimp list',
|
549 |
+
'forminator'
|
550 |
)
|
551 |
);
|
552 |
}
|
558 |
'name' => 'status',
|
559 |
'value' => array(
|
560 |
'is_sent' => true,
|
561 |
+
'description' => __( 'Successfully added or updated member on Mailchimp list', 'forminator' ),
|
562 |
'data_sent' => $mailchimp_api->get_last_data_sent(),
|
563 |
'data_received' => $mailchimp_api->get_last_data_received(),
|
564 |
'url_request' => $mailchimp_api->get_last_url_request(),
|
700 |
}
|
701 |
|
702 |
$additional_entry_item = array(
|
703 |
+
'label' => __( 'Mailchimp Integration', 'forminator' ),
|
704 |
'value' => '',
|
705 |
);
|
706 |
|
707 |
$status = $addon_meta_data['value'];
|
708 |
$sub_entries = array();
|
709 |
if ( isset( $status['is_sent'] ) ) {
|
710 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
711 |
$sub_entries[] = array(
|
712 |
+
'label' => __( 'Sent To Mailchimp', 'forminator' ),
|
713 |
'value' => $is_sent,
|
714 |
);
|
715 |
}
|
716 |
|
717 |
if ( isset( $status['description'] ) ) {
|
718 |
$sub_entries[] = array(
|
719 |
+
'label' => __( 'Info', 'forminator' ),
|
720 |
'value' => $status['description'],
|
721 |
);
|
722 |
}
|
725 |
$data_received = $status['data_received'];
|
726 |
if ( isset( $data_received->status ) && ! empty( $data_received->status ) && is_string( $data_received->status ) ) {
|
727 |
$sub_entries[] = array(
|
728 |
+
'label' => __( 'Member Status', 'forminator' ),
|
729 |
'value' => strtoupper( $data_received->status ),
|
730 |
);
|
731 |
}
|
735 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_MAILCHIMP_SHOW_FULL_LOG', true)`
|
736 |
if ( isset( $status['url_request'] ) ) {
|
737 |
$sub_entries[] = array(
|
738 |
+
'label' => __( 'API URL', 'forminator' ),
|
739 |
'value' => $status['url_request'],
|
740 |
);
|
741 |
}
|
742 |
|
743 |
if ( isset( $status['data_sent'] ) ) {
|
744 |
$sub_entries[] = array(
|
745 |
+
'label' => __( 'Data sent to Mailchimp', 'forminator' ),
|
746 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
747 |
);
|
748 |
}
|
749 |
|
750 |
if ( isset( $status['data_received'] ) ) {
|
751 |
$sub_entries[] = array(
|
752 |
+
'label' => __( 'Data received from Mailchimp', 'forminator' ),
|
753 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
754 |
);
|
755 |
}
|
addons/pro/mailchimp/class-forminator-addon-mailchimp-quiz-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -118,7 +118,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
118 |
$mail_list_name = $this->get_choosen_mail_list_name( $mail_lists, $submitted_data );
|
119 |
forminator_addon_maybe_log( __METHOD__, '$mail_list_name', $mail_list_name );
|
120 |
if ( empty( $mail_list_name ) ) {
|
121 |
-
throw new Forminator_Addon_Mailchimp_Quiz_Settings_Exception( __( 'Please select a valid Email Audience',
|
122 |
}
|
123 |
$this->addon_quiz_settings['mail_list_id'] = $submitted_data['mail_list_id'];
|
124 |
$this->addon_quiz_settings['mail_list_name'] = $mail_list_name;
|
@@ -146,7 +146,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
146 |
|
147 |
$html_field_mail_list
|
148 |
= '<div class="sui-form-field">
|
149 |
-
<label class="sui-label">' . __( 'Email Audience',
|
150 |
' . $html_select_mail_list . '
|
151 |
</div>';
|
152 |
|
@@ -156,7 +156,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
156 |
if ( isset( $input_error_messages['mail_list_id'] ) ) {
|
157 |
$html_field_mail_list
|
158 |
= '<div class="sui-form-field sui-form-field-error">
|
159 |
-
<label class="sui-label">' . __( 'Email Audience',
|
160 |
' . $html_select_mail_list . '
|
161 |
<span class="sui-error-message">' . esc_html( $input_error_messages['mail_list_id'] ) . '</span>
|
162 |
</div>';
|
@@ -170,32 +170,32 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
170 |
// add disconnect button if already is_quiz_connected
|
171 |
if ( $this->addon->is_quiz_connected( $this->quiz_id ) ) {
|
172 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
173 |
-
esc_html__( 'Deactivate',
|
174 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
175 |
-
esc_html__( 'Deactivate Mailchimp from this quiz.',
|
176 |
);
|
177 |
}
|
178 |
|
179 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
180 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next',
|
181 |
'</div>';
|
182 |
|
183 |
$gdpr_fields = '';
|
184 |
if ( Forminator_Addon_Mailchimp::is_enable_gdpr() ) {
|
185 |
$gdpr_fields = '<div class="sui-form-field">' .
|
186 |
-
'<label class="sui-label">' . __( 'Enable GDPR',
|
187 |
<input type="checkbox" name="enable_gdpr" value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
188 |
</div>
|
189 |
|
190 |
<div class="sui-form-field">
|
191 |
-
<label class="sui-label">' . __( 'GDPR Text',
|
192 |
<textarea name="gdpr_text">' . $current_data['gdpr_text'] . '</textarea>
|
193 |
</div>';
|
194 |
}
|
195 |
|
196 |
return array(
|
197 |
-
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Choose your audience',
|
198 |
-
<span class="sui-description" style="margin-top: 20px;">' . __( 'Choose the audience you want to send quiz data to.',
|
199 |
' . $error_message . '</div>
|
200 |
<form enctype="multipart/form-data">
|
201 |
' . $html_field_mail_list . '
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
207 |
value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
208 |
<span class="sui-toggle-slider"></span>
|
209 |
</label>
|
210 |
-
<span class="sui-toggle-label" for="forminator_addon_mailchimp_enable_double_opt_in">' . __( 'Use Double Opt in',
|
211 |
</div>
|
212 |
' . $gdpr_fields . '
|
213 |
</form>',
|
@@ -340,14 +340,14 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
340 |
$buttons = array();
|
341 |
if ( $this->addon->is_quiz_connected( $this->quiz_id ) ) {
|
342 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
343 |
-
esc_html__( 'Deactivate',
|
344 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
345 |
-
esc_html__( 'Deactivate Mailchimp from this quiz.',
|
346 |
);
|
347 |
}
|
348 |
|
349 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
350 |
-
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Save',
|
351 |
'</div>';
|
352 |
|
353 |
$notification = array();
|
@@ -360,8 +360,8 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
360 |
}
|
361 |
|
362 |
return array(
|
363 |
-
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Assign Fields',
|
364 |
-
<span class="sui-description" style="margin-top: 20px;">' . __( 'Lastly, match up your quiz fields with your campaign fields to make sure we\'re sending data to the right place.',
|
365 |
' . $error_message . '</div>
|
366 |
<form enctype="multipart/form-data">
|
367 |
' . $html_input_map_fields . '
|
@@ -390,33 +390,33 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
390 |
|
391 |
$quiz_questions = $this->get_quiz_fields();
|
392 |
$quiz_fields = array(
|
393 |
-
'quiz-name' => __( 'Quiz Name',
|
394 |
);
|
395 |
foreach ( $quiz_questions as $quiz_question ) {
|
396 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
397 |
}
|
398 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
399 |
-
$quiz_fields['correct-answers'] = __( 'Correct Answers',
|
400 |
-
$quiz_fields['total-answers'] = __( 'Total Answers',
|
401 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
402 |
-
$quiz_fields['result-answers'] = __( 'Result Answer',
|
403 |
}
|
404 |
?>
|
405 |
<table class="sui-table">
|
406 |
<thead>
|
407 |
<tr>
|
408 |
-
<th><?php echo esc_html( __( 'Mailchimp Field',
|
409 |
-
<th><?php echo esc_html( __( 'Forminator Field',
|
410 |
</tr>
|
411 |
</thead>
|
412 |
<tbody>
|
413 |
<tr>
|
414 |
-
<td><?php echo esc_html( __( 'Email Address',
|
415 |
<td>
|
416 |
<div class="sui-form-field {{$error_css_class_EMAIL}}">
|
417 |
<select class="sui-select" name="fields_map[EMAIL]">
|
418 |
<?php if ( empty( $email_fields ) ) { ?>
|
419 |
-
<option value=""><?php esc_html_e( 'None',
|
420 |
<?php } else { ?>
|
421 |
<?php foreach ( $email_fields as $email_field ) { ?>
|
422 |
<option value="<?php echo esc_attr( $email_field['element_id'] ); ?>"
|
@@ -443,7 +443,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
443 |
<td>
|
444 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>_<?php echo esc_attr( $addr ); ?>}}">
|
445 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>][<?php echo esc_attr( $addr ); ?>]">
|
446 |
-
<option value=""><?php esc_html_e( 'None',
|
447 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
448 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
449 |
<?php selected( $current_data['fields_map'][ $item->tag ][ $addr ], $form_field['element_id'] ); ?>>
|
@@ -464,7 +464,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
464 |
<td>
|
465 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>}}">
|
466 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>]">
|
467 |
-
<option value=""><?php esc_html_e( 'None',
|
468 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
469 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
470 |
<?php selected( $current_data['fields_map'][ $item->tag ], $form_field['element_id'] ); ?>>
|
@@ -574,7 +574,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
574 |
$input_exceptions = new Forminator_Addon_Mailchimp_Quiz_Settings_Exception();
|
575 |
// EMAIL : super required**
|
576 |
if ( ! isset( $post_data['EMAIL'] ) || empty( $post_data['EMAIL'] ) ) {
|
577 |
-
$this->_update_quiz_settings_error_message = __( 'Please choose valid Forminator field for email address.',
|
578 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, 'EMAIL' );
|
579 |
}
|
580 |
|
@@ -587,7 +587,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
587 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) || empty( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
588 |
$this->_update_quiz_settings_error_message =
|
589 |
/* translators: ... */
|
590 |
-
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.',
|
591 |
$input_exceptions->add_sub_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_required_field->tag, $addr );
|
592 |
}
|
593 |
}
|
@@ -596,7 +596,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
596 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ] ) || empty( $post_data[ $mailchimp_required_field->tag ] ) ) {
|
597 |
$this->_update_quiz_settings_error_message =
|
598 |
/* translators: ... */
|
599 |
-
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.',
|
600 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_required_field->tag );
|
601 |
}
|
602 |
}
|
@@ -622,14 +622,14 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
622 |
|
623 |
$this->_update_quiz_settings_error_message =
|
624 |
/* translators: ... */
|
625 |
-
sprintf( __( 'Please choose valid Forminator field for %s.',
|
626 |
$input_exceptions->add_sub_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_field_tag, $addr );
|
627 |
}
|
628 |
}
|
629 |
}
|
630 |
if ( ! is_array( $forminator_field_id ) && ! in_array( $forminator_field_id, $forminator_field_element_ids, true ) ) {
|
631 |
if ( 'EMAIL' === $mailchimp_field_tag ) {
|
632 |
-
$mailchimp_field_name = __( 'Email Address',
|
633 |
} else {
|
634 |
$mailchimp_field = $tag_maped_mailchimp_fields[ $mailchimp_field_tag ];
|
635 |
$mailchimp_field_name = $mailchimp_field->name;
|
@@ -637,7 +637,7 @@ class Forminator_Addon_Mailchimp_Quiz_Settings extends Forminator_Addon_Quiz_Set
|
|
637 |
|
638 |
$this->_update_quiz_settings_error_message =
|
639 |
/* translators: ... */
|
640 |
-
sprintf( __( 'Please choose valid Forminator field for %s.',
|
641 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_field_tag );
|
642 |
}
|
643 |
}
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the quiz input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
118 |
$mail_list_name = $this->get_choosen_mail_list_name( $mail_lists, $submitted_data );
|
119 |
forminator_addon_maybe_log( __METHOD__, '$mail_list_name', $mail_list_name );
|
120 |
if ( empty( $mail_list_name ) ) {
|
121 |
+
throw new Forminator_Addon_Mailchimp_Quiz_Settings_Exception( __( 'Please select a valid Email Audience', 'forminator' ), 'mail_list_id' );
|
122 |
}
|
123 |
$this->addon_quiz_settings['mail_list_id'] = $submitted_data['mail_list_id'];
|
124 |
$this->addon_quiz_settings['mail_list_name'] = $mail_list_name;
|
146 |
|
147 |
$html_field_mail_list
|
148 |
= '<div class="sui-form-field">
|
149 |
+
<label class="sui-label">' . __( 'Email Audience', 'forminator' ) . '</label>
|
150 |
' . $html_select_mail_list . '
|
151 |
</div>';
|
152 |
|
156 |
if ( isset( $input_error_messages['mail_list_id'] ) ) {
|
157 |
$html_field_mail_list
|
158 |
= '<div class="sui-form-field sui-form-field-error">
|
159 |
+
<label class="sui-label">' . __( 'Email Audience', 'forminator' ) . '</label>
|
160 |
' . $html_select_mail_list . '
|
161 |
<span class="sui-error-message">' . esc_html( $input_error_messages['mail_list_id'] ) . '</span>
|
162 |
</div>';
|
170 |
// add disconnect button if already is_quiz_connected
|
171 |
if ( $this->addon->is_quiz_connected( $this->quiz_id ) ) {
|
172 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
173 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
174 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
175 |
+
esc_html__( 'Deactivate Mailchimp from this quiz.', 'forminator' )
|
176 |
);
|
177 |
}
|
178 |
|
179 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
180 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
181 |
'</div>';
|
182 |
|
183 |
$gdpr_fields = '';
|
184 |
if ( Forminator_Addon_Mailchimp::is_enable_gdpr() ) {
|
185 |
$gdpr_fields = '<div class="sui-form-field">' .
|
186 |
+
'<label class="sui-label">' . __( 'Enable GDPR', 'forminator' ) . '</label>
|
187 |
<input type="checkbox" name="enable_gdpr" value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
188 |
</div>
|
189 |
|
190 |
<div class="sui-form-field">
|
191 |
+
<label class="sui-label">' . __( 'GDPR Text', 'forminator' ) . '</label>
|
192 |
<textarea name="gdpr_text">' . $current_data['gdpr_text'] . '</textarea>
|
193 |
</div>';
|
194 |
}
|
195 |
|
196 |
return array(
|
197 |
+
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Choose your audience', 'forminator' ) . '</h3>
|
198 |
+
<span class="sui-description" style="margin-top: 20px;">' . __( 'Choose the audience you want to send quiz data to.', 'forminator' ) . '</span>
|
199 |
' . $error_message . '</div>
|
200 |
<form enctype="multipart/form-data">
|
201 |
' . $html_field_mail_list . '
|
207 |
value="1" ' . checked( 1, $current_data['enable_double_opt_in'], false ) . '>
|
208 |
<span class="sui-toggle-slider"></span>
|
209 |
</label>
|
210 |
+
<span class="sui-toggle-label" for="forminator_addon_mailchimp_enable_double_opt_in">' . __( 'Use Double Opt in', 'forminator' ) . '</span>
|
211 |
</div>
|
212 |
' . $gdpr_fields . '
|
213 |
</form>',
|
340 |
$buttons = array();
|
341 |
if ( $this->addon->is_quiz_connected( $this->quiz_id ) ) {
|
342 |
$buttons['disconnect']['markup'] = Forminator_Addon_Mailchimp::get_button_markup(
|
343 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
344 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
345 |
+
esc_html__( 'Deactivate Mailchimp from this quiz.', 'forminator' )
|
346 |
);
|
347 |
}
|
348 |
|
349 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
350 |
+
Forminator_Addon_Mailchimp::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
351 |
'</div>';
|
352 |
|
353 |
$notification = array();
|
360 |
}
|
361 |
|
362 |
return array(
|
363 |
+
'html' => '<div class="sui-box-content integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Assign Fields', 'forminator' ) . '</h3>
|
364 |
+
<span class="sui-description" style="margin-top: 20px;">' . __( 'Lastly, match up your quiz fields with your campaign fields to make sure we\'re sending data to the right place.', 'forminator' ) . '</span>
|
365 |
' . $error_message . '</div>
|
366 |
<form enctype="multipart/form-data">
|
367 |
' . $html_input_map_fields . '
|
390 |
|
391 |
$quiz_questions = $this->get_quiz_fields();
|
392 |
$quiz_fields = array(
|
393 |
+
'quiz-name' => __( 'Quiz Name', 'forminator' ),
|
394 |
);
|
395 |
foreach ( $quiz_questions as $quiz_question ) {
|
396 |
$quiz_fields[ $quiz_question['slug'] ] = $quiz_question['title'];
|
397 |
}
|
398 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
399 |
+
$quiz_fields['correct-answers'] = __( 'Correct Answers', 'forminator' );
|
400 |
+
$quiz_fields['total-answers'] = __( 'Total Answers', 'forminator' );
|
401 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
402 |
+
$quiz_fields['result-answers'] = __( 'Result Answer', 'forminator' );
|
403 |
}
|
404 |
?>
|
405 |
<table class="sui-table">
|
406 |
<thead>
|
407 |
<tr>
|
408 |
+
<th><?php echo esc_html( __( 'Mailchimp Field', 'forminator' ) ); ?></th>
|
409 |
+
<th><?php echo esc_html( __( 'Forminator Field', 'forminator' ) ); ?></th>
|
410 |
</tr>
|
411 |
</thead>
|
412 |
<tbody>
|
413 |
<tr>
|
414 |
+
<td><?php echo esc_html( __( 'Email Address', 'forminator' ) ); ?> <span class="integrations-required-field">*</span></td>
|
415 |
<td>
|
416 |
<div class="sui-form-field {{$error_css_class_EMAIL}}">
|
417 |
<select class="sui-select" name="fields_map[EMAIL]">
|
418 |
<?php if ( empty( $email_fields ) ) { ?>
|
419 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
420 |
<?php } else { ?>
|
421 |
<?php foreach ( $email_fields as $email_field ) { ?>
|
422 |
<option value="<?php echo esc_attr( $email_field['element_id'] ); ?>"
|
443 |
<td>
|
444 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>_<?php echo esc_attr( $addr ); ?>}}">
|
445 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>][<?php echo esc_attr( $addr ); ?>]">
|
446 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
447 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
448 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
449 |
<?php selected( $current_data['fields_map'][ $item->tag ][ $addr ], $form_field['element_id'] ); ?>>
|
464 |
<td>
|
465 |
<div class="sui-form-field {{$error_css_class_<?php echo esc_attr( $item->tag ); ?>}}">
|
466 |
<select class="sui-select" name="fields_map[<?php echo esc_attr( $item->tag ); ?>]">
|
467 |
+
<option value=""><?php esc_html_e( 'None', 'forminator' ); ?></option>
|
468 |
<?php foreach ( $this->form_fields as $form_field ) { ?>
|
469 |
<option value="<?php echo esc_attr( $form_field['element_id'] ); ?>"
|
470 |
<?php selected( $current_data['fields_map'][ $item->tag ], $form_field['element_id'] ); ?>>
|
574 |
$input_exceptions = new Forminator_Addon_Mailchimp_Quiz_Settings_Exception();
|
575 |
// EMAIL : super required**
|
576 |
if ( ! isset( $post_data['EMAIL'] ) || empty( $post_data['EMAIL'] ) ) {
|
577 |
+
$this->_update_quiz_settings_error_message = __( 'Please choose valid Forminator field for email address.', 'forminator' );
|
578 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, 'EMAIL' );
|
579 |
}
|
580 |
|
587 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) || empty( $post_data[ $mailchimp_required_field->tag ][ $addr ] ) ) {
|
588 |
$this->_update_quiz_settings_error_message =
|
589 |
/* translators: ... */
|
590 |
+
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.', 'forminator' ), $mailchimp_required_field->name );
|
591 |
$input_exceptions->add_sub_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_required_field->tag, $addr );
|
592 |
}
|
593 |
}
|
596 |
if ( ! isset( $post_data[ $mailchimp_required_field->tag ] ) || empty( $post_data[ $mailchimp_required_field->tag ] ) ) {
|
597 |
$this->_update_quiz_settings_error_message =
|
598 |
/* translators: ... */
|
599 |
+
sprintf( __( '%s is required by Mailchimp, please choose valid Forminator field.', 'forminator' ), $mailchimp_required_field->name );
|
600 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_required_field->tag );
|
601 |
}
|
602 |
}
|
622 |
|
623 |
$this->_update_quiz_settings_error_message =
|
624 |
/* translators: ... */
|
625 |
+
sprintf( __( 'Please choose valid Forminator field for %s.', 'forminator' ), $mailchimp_field_name );
|
626 |
$input_exceptions->add_sub_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_field_tag, $addr );
|
627 |
}
|
628 |
}
|
629 |
}
|
630 |
if ( ! is_array( $forminator_field_id ) && ! in_array( $forminator_field_id, $forminator_field_element_ids, true ) ) {
|
631 |
if ( 'EMAIL' === $mailchimp_field_tag ) {
|
632 |
+
$mailchimp_field_name = __( 'Email Address', 'forminator' );
|
633 |
} else {
|
634 |
$mailchimp_field = $tag_maped_mailchimp_fields[ $mailchimp_field_tag ];
|
635 |
$mailchimp_field_name = $mailchimp_field->name;
|
637 |
|
638 |
$this->_update_quiz_settings_error_message =
|
639 |
/* translators: ... */
|
640 |
+
sprintf( __( 'Please choose valid Forminator field for %s.', 'forminator' ), $mailchimp_field_name );
|
641 |
$input_exceptions->add_input_exception( $this->_update_quiz_settings_error_message, $mailchimp_field_tag );
|
642 |
}
|
643 |
}
|
addons/pro/mailchimp/class-forminator-addon-mailchimp.php
CHANGED
@@ -125,13 +125,13 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
125 |
*/
|
126 |
public function __construct() {
|
127 |
// late init to allow translation
|
128 |
-
$this->_description = __( 'Make form data as Mailchimp List',
|
129 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Mailchimp Integration, don\'t hesitate to contact us',
|
130 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Mailchimp Integration, plese try again',
|
131 |
|
132 |
$this->_update_settings_error_message = __(
|
133 |
'Sorry, we failed to update settings, please check your form and try again',
|
134 |
-
|
135 |
);
|
136 |
|
137 |
$this->_icon = forminator_addon_mailchimp_assets_url() . 'icons/mailchimp.png';
|
@@ -185,7 +185,7 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
185 |
try {
|
186 |
// check if its active
|
187 |
if ( ! $this->is_active() ) {
|
188 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp is not active',
|
189 |
}
|
190 |
|
191 |
// if user completed settings
|
@@ -236,19 +236,19 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
236 |
// initialize with null
|
237 |
$form_settings_instance = null;
|
238 |
if ( ! $this->is_connected() ) {
|
239 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.',
|
240 |
}
|
241 |
|
242 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
243 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Mailchimp_Form_Settings ) {
|
244 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Form_Settings.',
|
245 |
}
|
246 |
$wizards = $form_settings_instance->form_settings_wizards();
|
247 |
//last step is completed
|
248 |
$last_step = end( $wizards );
|
249 |
$last_step_is_complete = call_user_func( $last_step['is_completed'] );
|
250 |
if ( ! $last_step_is_complete ) {
|
251 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings is not yet completed.',
|
252 |
}
|
253 |
|
254 |
$is_form_connected = true;
|
@@ -290,19 +290,19 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
290 |
// initialize with null
|
291 |
$quiz_settings_instance = null;
|
292 |
if ( ! $this->is_connected() ) {
|
293 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.',
|
294 |
}
|
295 |
|
296 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
297 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Mailchimp_Quiz_Settings ) {
|
298 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Quiz_Settings.',
|
299 |
}
|
300 |
$wizards = $quiz_settings_instance->quiz_settings_wizards();
|
301 |
//last step is completed
|
302 |
$last_step = end( $wizards );
|
303 |
$last_step_is_complete = call_user_func( $last_step['is_completed'] );
|
304 |
if ( ! $last_step_is_complete ) {
|
305 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings is not yet completed.',
|
306 |
}
|
307 |
|
308 |
$is_quiz_connected = true;
|
@@ -341,7 +341,7 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
341 |
*/
|
342 |
protected function validate_api_key( $api_key ) {
|
343 |
if ( empty( $api_key ) ) {
|
344 |
-
$this->_update_settings_error_message = __( 'Please add valid Mailchimp API Key.',
|
345 |
|
346 |
return false;
|
347 |
}
|
@@ -414,7 +414,7 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
414 |
|
415 |
// Display how to get mailchimp API Key by default
|
416 |
/* translators: placeholder is URL to get API Key of MailChimp */
|
417 |
-
$help = sprintf( __( 'Please get your Mailchimp API key %1$s',
|
418 |
|
419 |
$help = '<span class="sui-description" style="margin-top: 20px;">' . $help . '</span>';
|
420 |
|
@@ -455,7 +455,7 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
455 |
|
456 |
// Show currently connected mailchimp account if its already connected
|
457 |
/* translators: placeholder is Name and Email of Connected MailChimp Account */
|
458 |
-
$description .= '<span class="sui-description">' . esc_html__( 'Please take a note that changing API Key or disconnect will affect to ALL of your connected forms.',
|
459 |
|
460 |
}
|
461 |
|
@@ -482,7 +482,7 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
482 |
// Show currently connected mailchimp account if its already connected
|
483 |
$myaccount .= sprintf(
|
484 |
/* translators: placeholder is Name and Email of Connected MailChimp Account */
|
485 |
-
__( 'Your Mailchimp is connected to %1$s: %2$s.',
|
486 |
'<strong>' . $connected_account['account_name'] . '</strong>',
|
487 |
$connected_account['email']
|
488 |
);
|
@@ -616,14 +616,14 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
616 |
return array(
|
617 |
'html' => '<div class="integration-header"><h3 class="sui-box-title" id="dialogTitle2">' .
|
618 |
/* translators: ... */
|
619 |
-
sprintf( __( '%1$s Added',
|
620 |
'</h3></div>
|
621 |
<div class="sui-block-content-center">
|
622 |
<p><small style="color: #666;">' . __( 'You can now go to your forms and assign them to this integration.' ) . '</small></p>
|
623 |
</div>',
|
624 |
'buttons' => array(
|
625 |
'close' => array(
|
626 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
627 |
),
|
628 |
),
|
629 |
'redirect' => false,
|
@@ -646,17 +646,17 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
646 |
|
647 |
if ( $is_edit ) {
|
648 |
$buttons['disconnect'] = array(
|
649 |
-
'markup' => self::get_button_markup( esc_html__( 'Disconnect',
|
650 |
);
|
651 |
|
652 |
$buttons['submit'] = array(
|
653 |
'markup' => '<div class="sui-actions-right">' .
|
654 |
-
self::get_button_markup( esc_html__( 'Save',
|
655 |
'</div>',
|
656 |
);
|
657 |
} else {
|
658 |
$buttons['submit'] = array(
|
659 |
-
'markup' => self::get_button_markup( esc_html__( 'Connect',
|
660 |
);
|
661 |
}
|
662 |
|
@@ -664,19 +664,19 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
664 |
'html' => '<div class="integration-header">
|
665 |
<h3 class="sui-box-title" id="dialogTitle2">' .
|
666 |
/* translators: ... */
|
667 |
-
sprintf( __( 'Configure %1$s',
|
668 |
'</h3>
|
669 |
' . $this->settings_help() . '
|
670 |
' . $error_message . '
|
671 |
</div>
|
672 |
<form>
|
673 |
<div class="sui-form-field ' . ( ! empty( $api_key_error_message ) ? 'sui-form-field-error' : '' ) . '">
|
674 |
-
<label class="sui-label">' . __( 'API Key',
|
675 |
<div class="sui-control-with-icon">
|
676 |
<input name="api_key"
|
677 |
placeholder="' .
|
678 |
/* translators: ... */
|
679 |
-
sprintf( __( 'Enter %1$s API Key',
|
680 |
'"
|
681 |
value="' . esc_attr( $api_key ) . '"
|
682 |
class="sui-form-control" />
|
@@ -724,12 +724,12 @@ class Forminator_Addon_Mailchimp extends Forminator_Addon_Abstract {
|
|
724 |
// initialize with null
|
725 |
$quiz_settings_instance = null;
|
726 |
if ( ! $this->is_connected() ) {
|
727 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.',
|
728 |
}
|
729 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
730 |
|
731 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Mailchimp_Quiz_Settings ) {
|
732 |
-
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Quiz_Settings.',
|
733 |
}
|
734 |
|
735 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
125 |
*/
|
126 |
public function __construct() {
|
127 |
// late init to allow translation
|
128 |
+
$this->_description = __( 'Make form data as Mailchimp List', 'forminator' );
|
129 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Mailchimp Integration, don\'t hesitate to contact us', 'forminator' );
|
130 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Mailchimp Integration, plese try again', 'forminator' );
|
131 |
|
132 |
$this->_update_settings_error_message = __(
|
133 |
'Sorry, we failed to update settings, please check your form and try again',
|
134 |
+
'forminator'
|
135 |
);
|
136 |
|
137 |
$this->_icon = forminator_addon_mailchimp_assets_url() . 'icons/mailchimp.png';
|
185 |
try {
|
186 |
// check if its active
|
187 |
if ( ! $this->is_active() ) {
|
188 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp is not active', 'forminator' ) );
|
189 |
}
|
190 |
|
191 |
// if user completed settings
|
236 |
// initialize with null
|
237 |
$form_settings_instance = null;
|
238 |
if ( ! $this->is_connected() ) {
|
239 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.', 'forminator' ) );
|
240 |
}
|
241 |
|
242 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
243 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Mailchimp_Form_Settings ) {
|
244 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Form_Settings.', 'forminator' ) );
|
245 |
}
|
246 |
$wizards = $form_settings_instance->form_settings_wizards();
|
247 |
//last step is completed
|
248 |
$last_step = end( $wizards );
|
249 |
$last_step_is_complete = call_user_func( $last_step['is_completed'] );
|
250 |
if ( ! $last_step_is_complete ) {
|
251 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings is not yet completed.', 'forminator' ) );
|
252 |
}
|
253 |
|
254 |
$is_form_connected = true;
|
290 |
// initialize with null
|
291 |
$quiz_settings_instance = null;
|
292 |
if ( ! $this->is_connected() ) {
|
293 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.', 'forminator' ) );
|
294 |
}
|
295 |
|
296 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
297 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Mailchimp_Quiz_Settings ) {
|
298 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Quiz_Settings.', 'forminator' ) );
|
299 |
}
|
300 |
$wizards = $quiz_settings_instance->quiz_settings_wizards();
|
301 |
//last step is completed
|
302 |
$last_step = end( $wizards );
|
303 |
$last_step_is_complete = call_user_func( $last_step['is_completed'] );
|
304 |
if ( ! $last_step_is_complete ) {
|
305 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings is not yet completed.', 'forminator' ) );
|
306 |
}
|
307 |
|
308 |
$is_quiz_connected = true;
|
341 |
*/
|
342 |
protected function validate_api_key( $api_key ) {
|
343 |
if ( empty( $api_key ) ) {
|
344 |
+
$this->_update_settings_error_message = __( 'Please add valid Mailchimp API Key.', 'forminator' );
|
345 |
|
346 |
return false;
|
347 |
}
|
414 |
|
415 |
// Display how to get mailchimp API Key by default
|
416 |
/* translators: placeholder is URL to get API Key of MailChimp */
|
417 |
+
$help = sprintf( __( 'Please get your Mailchimp API key %1$s', 'forminator' ), '<a href="https://admin.mailchimp.com/account/api-key-popup" target="_blank">here</a>' );
|
418 |
|
419 |
$help = '<span class="sui-description" style="margin-top: 20px;">' . $help . '</span>';
|
420 |
|
455 |
|
456 |
// Show currently connected mailchimp account if its already connected
|
457 |
/* translators: placeholder is Name and Email of Connected MailChimp Account */
|
458 |
+
$description .= '<span class="sui-description">' . esc_html__( 'Please take a note that changing API Key or disconnect will affect to ALL of your connected forms.', 'forminator' ) . '</span>';
|
459 |
|
460 |
}
|
461 |
|
482 |
// Show currently connected mailchimp account if its already connected
|
483 |
$myaccount .= sprintf(
|
484 |
/* translators: placeholder is Name and Email of Connected MailChimp Account */
|
485 |
+
__( 'Your Mailchimp is connected to %1$s: %2$s.', 'forminator' ),
|
486 |
'<strong>' . $connected_account['account_name'] . '</strong>',
|
487 |
$connected_account['email']
|
488 |
);
|
616 |
return array(
|
617 |
'html' => '<div class="integration-header"><h3 class="sui-box-title" id="dialogTitle2">' .
|
618 |
/* translators: ... */
|
619 |
+
sprintf( __( '%1$s Added', 'forminator' ), 'Mailchimp' ) .
|
620 |
'</h3></div>
|
621 |
<div class="sui-block-content-center">
|
622 |
<p><small style="color: #666;">' . __( 'You can now go to your forms and assign them to this integration.' ) . '</small></p>
|
623 |
</div>',
|
624 |
'buttons' => array(
|
625 |
'close' => array(
|
626 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'forminator-addon-close' ),
|
627 |
),
|
628 |
),
|
629 |
'redirect' => false,
|
646 |
|
647 |
if ( $is_edit ) {
|
648 |
$buttons['disconnect'] = array(
|
649 |
+
'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
650 |
);
|
651 |
|
652 |
$buttons['submit'] = array(
|
653 |
'markup' => '<div class="sui-actions-right">' .
|
654 |
+
self::get_button_markup( esc_html__( 'Save', 'forminator' ), 'forminator-addon-connect' ) .
|
655 |
'</div>',
|
656 |
);
|
657 |
} else {
|
658 |
$buttons['submit'] = array(
|
659 |
+
'markup' => self::get_button_markup( esc_html__( 'Connect', 'forminator' ), 'forminator-addon-connect' ),
|
660 |
);
|
661 |
}
|
662 |
|
664 |
'html' => '<div class="integration-header">
|
665 |
<h3 class="sui-box-title" id="dialogTitle2">' .
|
666 |
/* translators: ... */
|
667 |
+
sprintf( __( 'Configure %1$s', 'forminator' ), 'Mailchimp' ) .
|
668 |
'</h3>
|
669 |
' . $this->settings_help() . '
|
670 |
' . $error_message . '
|
671 |
</div>
|
672 |
<form>
|
673 |
<div class="sui-form-field ' . ( ! empty( $api_key_error_message ) ? 'sui-form-field-error' : '' ) . '">
|
674 |
+
<label class="sui-label">' . __( 'API Key', 'forminator' ) . '</label>
|
675 |
<div class="sui-control-with-icon">
|
676 |
<input name="api_key"
|
677 |
placeholder="' .
|
678 |
/* translators: ... */
|
679 |
+
sprintf( __( 'Enter %1$s API Key', 'forminator' ), 'Mailchimp' ) .
|
680 |
'"
|
681 |
value="' . esc_attr( $api_key ) . '"
|
682 |
class="sui-form-control" />
|
724 |
// initialize with null
|
725 |
$quiz_settings_instance = null;
|
726 |
if ( ! $this->is_connected() ) {
|
727 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Mailchimp addon not connected.', 'forminator' ) );
|
728 |
}
|
729 |
$quiz_settings_instance = $this->get_addon_quiz_settings( $quiz_id );
|
730 |
|
731 |
if ( ! $quiz_settings_instance instanceof Forminator_Addon_Mailchimp_Quiz_Settings ) {
|
732 |
+
throw new Forminator_Addon_Mailchimp_Exception( __( 'Form settings instance is not valid Forminator_Addon_Mailchimp_Quiz_Settings.', 'forminator' ) );
|
733 |
}
|
734 |
|
735 |
$quiz_settings = $quiz_settings_instance->get_quiz_settings();
|
addons/pro/mailchimp/lib/class-forminator-addon-mailchimp-wp-api.php
CHANGED
@@ -71,7 +71,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
71 |
public function __construct( $api_key ) {
|
72 |
//prerequisite
|
73 |
if ( ! $api_key ) {
|
74 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Missing required API Key',
|
75 |
}
|
76 |
|
77 |
$this->_api_key = $api_key;
|
@@ -206,7 +206,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
206 |
|
207 |
if ( is_wp_error( $res ) || ! $res ) {
|
208 |
forminator_addon_maybe_log( __METHOD__, $res );
|
209 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Failed to process request, make sure API KEY is correct and your server has internet connection.',
|
210 |
}
|
211 |
|
212 |
$body = wp_remote_retrieve_body( $res );
|
@@ -221,7 +221,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
221 |
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception(
|
222 |
__(
|
223 |
'Failed to process request, make sure API KEY is correct and your server has internet connection.',
|
224 |
-
|
225 |
)
|
226 |
);
|
227 |
}
|
@@ -243,10 +243,10 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
243 |
$this->_last_data_received = $response;
|
244 |
if ( 404 === $response_code ) {
|
245 |
/* translators: ... */
|
246 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
247 |
}
|
248 |
/* translators: ... */
|
249 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
250 |
}
|
251 |
}
|
252 |
|
@@ -255,7 +255,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
255 |
$this->_last_data_received = $body;
|
256 |
forminator_addon_maybe_log( __METHOD__, $res );
|
257 |
/* translators: ... */
|
258 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
259 |
}
|
260 |
}
|
261 |
|
@@ -437,7 +437,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
437 |
|
438 |
$args = array_merge( $default_args, $args );
|
439 |
if ( ! in_array( $args['type'], $available_types, true ) ) {
|
440 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Invalid Field Type',
|
441 |
}
|
442 |
|
443 |
return $this->request(
|
@@ -552,7 +552,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
552 |
$args = array_merge( $default_args, $args );
|
553 |
|
554 |
if ( ! isset( $args['email_address'] ) ) {
|
555 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'email_address are required for mailchimp',
|
556 |
}
|
557 |
|
558 |
return $this->request(
|
@@ -584,7 +584,7 @@ class Forminator_Addon_Mailchimp_Wp_Api {
|
|
584 |
|
585 |
$args = array_merge( $default_args, $args );
|
586 |
if ( ! isset( $args['email_address'] ) ) {
|
587 |
-
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'email_address are required for adding member to mailchimp list',
|
588 |
}
|
589 |
|
590 |
if ( empty( $args['merge_fields'] ) ) {
|
71 |
public function __construct( $api_key ) {
|
72 |
//prerequisite
|
73 |
if ( ! $api_key ) {
|
74 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Missing required API Key', 'forminator' ) );
|
75 |
}
|
76 |
|
77 |
$this->_api_key = $api_key;
|
206 |
|
207 |
if ( is_wp_error( $res ) || ! $res ) {
|
208 |
forminator_addon_maybe_log( __METHOD__, $res );
|
209 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Failed to process request, make sure API KEY is correct and your server has internet connection.', 'forminator' ) );
|
210 |
}
|
211 |
|
212 |
$body = wp_remote_retrieve_body( $res );
|
221 |
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception(
|
222 |
__(
|
223 |
'Failed to process request, make sure API KEY is correct and your server has internet connection.',
|
224 |
+
'forminator'
|
225 |
)
|
226 |
);
|
227 |
}
|
243 |
$this->_last_data_received = $response;
|
244 |
if ( 404 === $response_code ) {
|
245 |
/* translators: ... */
|
246 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
247 |
}
|
248 |
/* translators: ... */
|
249 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
250 |
}
|
251 |
}
|
252 |
|
255 |
$this->_last_data_received = $body;
|
256 |
forminator_addon_maybe_log( __METHOD__, $res );
|
257 |
/* translators: ... */
|
258 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), json_last_error_msg() ) );
|
259 |
}
|
260 |
}
|
261 |
|
437 |
|
438 |
$args = array_merge( $default_args, $args );
|
439 |
if ( ! in_array( $args['type'], $available_types, true ) ) {
|
440 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'Invalid Field Type', 'forminator' ) );
|
441 |
}
|
442 |
|
443 |
return $this->request(
|
552 |
$args = array_merge( $default_args, $args );
|
553 |
|
554 |
if ( ! isset( $args['email_address'] ) ) {
|
555 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'email_address are required for mailchimp', 'forminator' ) );
|
556 |
}
|
557 |
|
558 |
return $this->request(
|
584 |
|
585 |
$args = array_merge( $default_args, $args );
|
586 |
if ( ! isset( $args['email_address'] ) ) {
|
587 |
+
throw new Forminator_Addon_Mailchimp_Wp_Api_Exception( __( 'email_address are required for adding member to mailchimp list', 'forminator' ) );
|
588 |
}
|
589 |
|
590 |
if ( empty( $args['merge_fields'] ) ) {
|
addons/pro/slack/class-forminator-addon-slack-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'Slack failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -148,11 +148,11 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
148 |
$args = array();
|
149 |
|
150 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
151 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.',
|
152 |
}
|
153 |
|
154 |
if ( ! isset( $connection_settings['message'] ) ) {
|
155 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.',
|
156 |
}
|
157 |
$text_message = $connection_settings['message'];
|
158 |
$text_message = forminator_addon_replace_custom_vars( $text_message, $submitted_data, $this->custom_form, $form_entry_fields, false );
|
@@ -226,7 +226,7 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
226 |
return array(
|
227 |
'is_sent' => true,
|
228 |
'connection_name' => $connection_settings['name'],
|
229 |
-
'description' => __( 'Successfully send data to Slack',
|
230 |
'data_sent' => $api->get_last_data_sent(),
|
231 |
'data_received' => $api->get_last_data_received(),
|
232 |
'url_request' => $api->get_last_url_request(),
|
@@ -422,29 +422,29 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
422 |
}
|
423 |
$status = $addon_meta_data['value'];
|
424 |
$additional_entry_item = array(
|
425 |
-
'label' => __( 'Slack Integration',
|
426 |
'value' => '',
|
427 |
);
|
428 |
|
429 |
$sub_entries = array();
|
430 |
if ( isset( $status['connection_name'] ) ) {
|
431 |
$sub_entries[] = array(
|
432 |
-
'label' => __( 'Integration Name',
|
433 |
'value' => $status['connection_name'],
|
434 |
);
|
435 |
}
|
436 |
|
437 |
if ( isset( $status['is_sent'] ) ) {
|
438 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
439 |
$sub_entries[] = array(
|
440 |
-
'label' => __( 'Sent To Slack',
|
441 |
'value' => $is_sent,
|
442 |
);
|
443 |
}
|
444 |
|
445 |
if ( isset( $status['description'] ) ) {
|
446 |
$sub_entries[] = array(
|
447 |
-
'label' => __( 'Info',
|
448 |
'value' => $status['description'],
|
449 |
);
|
450 |
}
|
@@ -453,21 +453,21 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
453 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_SLACK_SHOW_FULL_LOG', true)`
|
454 |
if ( isset( $status['url_request'] ) ) {
|
455 |
$sub_entries[] = array(
|
456 |
-
'label' => __( 'API URL',
|
457 |
'value' => $status['url_request'],
|
458 |
);
|
459 |
}
|
460 |
|
461 |
if ( isset( $status['data_sent'] ) ) {
|
462 |
$sub_entries[] = array(
|
463 |
-
'label' => __( 'Data sent to Slack',
|
464 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
465 |
);
|
466 |
}
|
467 |
|
468 |
if ( isset( $status['data_received'] ) ) {
|
469 |
$sub_entries[] = array(
|
470 |
-
'label' => __( 'Data received from Slack',
|
471 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
472 |
);
|
473 |
}
|
@@ -489,7 +489,7 @@ class Forminator_Addon_Slack_Form_Hooks extends Forminator_Addon_Form_Hooks_Abst
|
|
489 |
public function on_export_render_title_row() {
|
490 |
|
491 |
$export_headers = array(
|
492 |
-
'info' => __( 'Slack Info',
|
493 |
);
|
494 |
|
495 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'Slack failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
148 |
$args = array();
|
149 |
|
150 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
151 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.', 'forminator' ) );
|
152 |
}
|
153 |
|
154 |
if ( ! isset( $connection_settings['message'] ) ) {
|
155 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.', 'forminator' ) );
|
156 |
}
|
157 |
$text_message = $connection_settings['message'];
|
158 |
$text_message = forminator_addon_replace_custom_vars( $text_message, $submitted_data, $this->custom_form, $form_entry_fields, false );
|
226 |
return array(
|
227 |
'is_sent' => true,
|
228 |
'connection_name' => $connection_settings['name'],
|
229 |
+
'description' => __( 'Successfully send data to Slack', 'forminator' ),
|
230 |
'data_sent' => $api->get_last_data_sent(),
|
231 |
'data_received' => $api->get_last_data_received(),
|
232 |
'url_request' => $api->get_last_url_request(),
|
422 |
}
|
423 |
$status = $addon_meta_data['value'];
|
424 |
$additional_entry_item = array(
|
425 |
+
'label' => __( 'Slack Integration', 'forminator' ),
|
426 |
'value' => '',
|
427 |
);
|
428 |
|
429 |
$sub_entries = array();
|
430 |
if ( isset( $status['connection_name'] ) ) {
|
431 |
$sub_entries[] = array(
|
432 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
433 |
'value' => $status['connection_name'],
|
434 |
);
|
435 |
}
|
436 |
|
437 |
if ( isset( $status['is_sent'] ) ) {
|
438 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
439 |
$sub_entries[] = array(
|
440 |
+
'label' => __( 'Sent To Slack', 'forminator' ),
|
441 |
'value' => $is_sent,
|
442 |
);
|
443 |
}
|
444 |
|
445 |
if ( isset( $status['description'] ) ) {
|
446 |
$sub_entries[] = array(
|
447 |
+
'label' => __( 'Info', 'forminator' ),
|
448 |
'value' => $status['description'],
|
449 |
);
|
450 |
}
|
453 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_SLACK_SHOW_FULL_LOG', true)`
|
454 |
if ( isset( $status['url_request'] ) ) {
|
455 |
$sub_entries[] = array(
|
456 |
+
'label' => __( 'API URL', 'forminator' ),
|
457 |
'value' => $status['url_request'],
|
458 |
);
|
459 |
}
|
460 |
|
461 |
if ( isset( $status['data_sent'] ) ) {
|
462 |
$sub_entries[] = array(
|
463 |
+
'label' => __( 'Data sent to Slack', 'forminator' ),
|
464 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
465 |
);
|
466 |
}
|
467 |
|
468 |
if ( isset( $status['data_received'] ) ) {
|
469 |
$sub_entries[] = array(
|
470 |
+
'label' => __( 'Data received from Slack', 'forminator' ),
|
471 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
472 |
);
|
473 |
}
|
489 |
public function on_export_render_title_row() {
|
490 |
|
491 |
$export_headers = array(
|
492 |
+
'info' => __( 'Slack Info', 'forminator' ),
|
493 |
);
|
494 |
|
495 |
$form_id = $this->form_id;
|
addons/pro/slack/class-forminator-addon-slack-form-settings.php
CHANGED
@@ -33,13 +33,13 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
33 |
|
34 |
$this->_update_form_settings_error_message = __(
|
35 |
'The update to your settings for this form failed, check the form input and try again.',
|
36 |
-
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
-
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel',
|
41 |
-
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel',
|
42 |
-
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message',
|
43 |
);
|
44 |
}
|
45 |
|
@@ -126,14 +126,14 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
126 |
$buttons = array();
|
127 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
128 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
129 |
-
esc_html__( 'Deactivate',
|
130 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
131 |
-
esc_html__( 'Deactivate this Slack Integration from this Form.',
|
132 |
);
|
133 |
}
|
134 |
|
135 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
136 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
137 |
'</div>';
|
138 |
|
139 |
return array(
|
@@ -185,7 +185,7 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
185 |
$template = forminator_addon_slack_dir() . 'views/form-settings/select-type.php';
|
186 |
|
187 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
188 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
189 |
}
|
190 |
|
191 |
$multi_id = $submitted_data['multi_id'];
|
@@ -234,14 +234,14 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
234 |
$buttons = array();
|
235 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
236 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
237 |
-
esc_html__( 'Deactivate',
|
238 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
239 |
-
esc_html__( 'Deactivate this Slack Integration from this Form.',
|
240 |
);
|
241 |
}
|
242 |
|
243 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
244 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
245 |
'</div>';
|
246 |
|
247 |
return array(
|
@@ -298,7 +298,7 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
298 |
public function select_target( $submitted_data ) {
|
299 |
$template = forminator_addon_slack_dir() . 'views/form-settings/select-target.php';
|
300 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
301 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
302 |
}
|
303 |
|
304 |
$multi_id = $submitted_data['multi_id'];
|
@@ -318,17 +318,17 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
318 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
319 |
$func_get_targets = 'get_groups_list';
|
320 |
$key_to_walk = 'channels';
|
321 |
-
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.',
|
322 |
break;
|
323 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
324 |
$func_get_targets = 'get_users_list';
|
325 |
$key_to_walk = 'members';
|
326 |
-
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.',
|
327 |
break;
|
328 |
default:
|
329 |
$func_get_targets = 'get_channels_list';
|
330 |
$key_to_walk = 'channels';
|
331 |
-
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.',
|
332 |
break;
|
333 |
}
|
334 |
|
@@ -342,7 +342,7 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
342 |
$api = $this->addon->get_api();
|
343 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
344 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
345 |
-
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.',
|
346 |
}
|
347 |
|
348 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
@@ -389,14 +389,14 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
389 |
$buttons = array();
|
390 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
391 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
392 |
-
esc_html__( 'Deactivate',
|
393 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
394 |
-
esc_html__( 'Deactivate this Slack Integration from this Form.',
|
395 |
);
|
396 |
}
|
397 |
|
398 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
399 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
400 |
'</div>';
|
401 |
|
402 |
return array(
|
@@ -449,7 +449,7 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
449 |
public function setup_message( $submitted_data ) {
|
450 |
$template = forminator_addon_slack_dir() . 'views/form-settings/setup-message.php';
|
451 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
452 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
453 |
}
|
454 |
|
455 |
$multi_id = $submitted_data['multi_id'];
|
@@ -500,14 +500,14 @@ class Forminator_Addon_Slack_Form_Settings extends Forminator_Addon_Form_Setting
|
|
500 |
$buttons = array();
|
501 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
502 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
503 |
-
esc_html__( 'Deactivate',
|
504 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
505 |
-
esc_html__( 'Deactivate this Slack Integration from this Form.',
|
506 |
);
|
507 |
}
|
508 |
|
509 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
510 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT',
|
511 |
'</div>';
|
512 |
|
513 |
return array(
|
33 |
|
34 |
$this->_update_form_settings_error_message = __(
|
35 |
'The update to your settings for this form failed, check the form input and try again.',
|
36 |
+
'forminator'
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
+
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel', 'forminator' ),
|
41 |
+
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel', 'forminator' ),
|
42 |
+
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message', 'forminator' ),
|
43 |
);
|
44 |
}
|
45 |
|
126 |
$buttons = array();
|
127 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
128 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
129 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
130 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
131 |
+
esc_html__( 'Deactivate this Slack Integration from this Form.', 'forminator' )
|
132 |
);
|
133 |
}
|
134 |
|
135 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
136 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
137 |
'</div>';
|
138 |
|
139 |
return array(
|
185 |
$template = forminator_addon_slack_dir() . 'views/form-settings/select-type.php';
|
186 |
|
187 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
188 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
189 |
}
|
190 |
|
191 |
$multi_id = $submitted_data['multi_id'];
|
234 |
$buttons = array();
|
235 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
236 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
237 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
238 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
239 |
+
esc_html__( 'Deactivate this Slack Integration from this Form.', 'forminator' )
|
240 |
);
|
241 |
}
|
242 |
|
243 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
244 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
245 |
'</div>';
|
246 |
|
247 |
return array(
|
298 |
public function select_target( $submitted_data ) {
|
299 |
$template = forminator_addon_slack_dir() . 'views/form-settings/select-target.php';
|
300 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
301 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
302 |
}
|
303 |
|
304 |
$multi_id = $submitted_data['multi_id'];
|
318 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
319 |
$func_get_targets = 'get_groups_list';
|
320 |
$key_to_walk = 'channels';
|
321 |
+
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.', 'forminator' );
|
322 |
break;
|
323 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
324 |
$func_get_targets = 'get_users_list';
|
325 |
$key_to_walk = 'members';
|
326 |
+
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.', 'forminator' );
|
327 |
break;
|
328 |
default:
|
329 |
$func_get_targets = 'get_channels_list';
|
330 |
$key_to_walk = 'channels';
|
331 |
+
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.', 'forminator' );
|
332 |
break;
|
333 |
}
|
334 |
|
342 |
$api = $this->addon->get_api();
|
343 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
344 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
345 |
+
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.', 'forminator' ) );
|
346 |
}
|
347 |
|
348 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
389 |
$buttons = array();
|
390 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
391 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
392 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
393 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
394 |
+
esc_html__( 'Deactivate this Slack Integration from this Form.', 'forminator' )
|
395 |
);
|
396 |
}
|
397 |
|
398 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
399 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
400 |
'</div>';
|
401 |
|
402 |
return array(
|
449 |
public function setup_message( $submitted_data ) {
|
450 |
$template = forminator_addon_slack_dir() . 'views/form-settings/setup-message.php';
|
451 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
452 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
453 |
}
|
454 |
|
455 |
$multi_id = $submitted_data['multi_id'];
|
500 |
$buttons = array();
|
501 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
502 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
503 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
504 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
505 |
+
esc_html__( 'Deactivate this Slack Integration from this Form.', 'forminator' )
|
506 |
);
|
507 |
}
|
508 |
|
509 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
510 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT', 'forminator' ), 'forminator-addon-next' ) .
|
511 |
'</div>';
|
512 |
|
513 |
return array(
|
addons/pro/slack/class-forminator-addon-slack-poll-hooks.php
CHANGED
@@ -133,11 +133,11 @@ class Forminator_Addon_Slack_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abst
|
|
133 |
$args = array();
|
134 |
|
135 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
136 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.',
|
137 |
}
|
138 |
|
139 |
if ( ! isset( $connection_settings['message'] ) ) {
|
140 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.',
|
141 |
}
|
142 |
$text_message = $connection_settings['message'];
|
143 |
$text_message = forminator_replace_variables( $text_message );
|
@@ -214,7 +214,7 @@ class Forminator_Addon_Slack_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abst
|
|
214 |
return array(
|
215 |
'is_sent' => true,
|
216 |
'connection_name' => $connection_settings['name'],
|
217 |
-
'description' => __( 'Successfully send data to Slack',
|
218 |
'data_sent' => $api->get_last_data_sent(),
|
219 |
'data_received' => $api->get_last_data_received(),
|
220 |
'url_request' => $api->get_last_url_request(),
|
@@ -264,21 +264,21 @@ class Forminator_Addon_Slack_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abst
|
|
264 |
|
265 |
$attachment_fields = array();
|
266 |
$attachment_fields[] = array(
|
267 |
-
'title' => __( 'Vote',
|
268 |
'value' => esc_html( $answer ),
|
269 |
'short' => ! empty( $extra ),
|
270 |
);
|
271 |
|
272 |
if ( ! empty( $extra ) ) {
|
273 |
$attachment_fields[] = array(
|
274 |
-
'title' => __( 'Extra',
|
275 |
'value' => esc_html( $extra ),
|
276 |
'short' => true,
|
277 |
);
|
278 |
}
|
279 |
|
280 |
$attachments[] = array(
|
281 |
-
'title' => __( 'Submitted Vote',
|
282 |
'fields' => $attachment_fields,
|
283 |
);
|
284 |
|
@@ -323,7 +323,7 @@ class Forminator_Addon_Slack_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abst
|
|
323 |
}
|
324 |
|
325 |
$attachments[] = array(
|
326 |
-
'title' => __( 'Current Poll Result',
|
327 |
'fields' => $attachment_fields,
|
328 |
);
|
329 |
|
@@ -341,7 +341,7 @@ class Forminator_Addon_Slack_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abst
|
|
341 |
public function on_export_render_title_row() {
|
342 |
|
343 |
$export_headers = array(
|
344 |
-
'info' => __( 'Slack Info',
|
345 |
);
|
346 |
|
347 |
$poll_id = $this->poll_id;
|
133 |
$args = array();
|
134 |
|
135 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
136 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.', 'forminator' ) );
|
137 |
}
|
138 |
|
139 |
if ( ! isset( $connection_settings['message'] ) ) {
|
140 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.', 'forminator' ) );
|
141 |
}
|
142 |
$text_message = $connection_settings['message'];
|
143 |
$text_message = forminator_replace_variables( $text_message );
|
214 |
return array(
|
215 |
'is_sent' => true,
|
216 |
'connection_name' => $connection_settings['name'],
|
217 |
+
'description' => __( 'Successfully send data to Slack', 'forminator' ),
|
218 |
'data_sent' => $api->get_last_data_sent(),
|
219 |
'data_received' => $api->get_last_data_received(),
|
220 |
'url_request' => $api->get_last_url_request(),
|
264 |
|
265 |
$attachment_fields = array();
|
266 |
$attachment_fields[] = array(
|
267 |
+
'title' => __( 'Vote', 'forminator' ),
|
268 |
'value' => esc_html( $answer ),
|
269 |
'short' => ! empty( $extra ),
|
270 |
);
|
271 |
|
272 |
if ( ! empty( $extra ) ) {
|
273 |
$attachment_fields[] = array(
|
274 |
+
'title' => __( 'Extra', 'forminator' ),
|
275 |
'value' => esc_html( $extra ),
|
276 |
'short' => true,
|
277 |
);
|
278 |
}
|
279 |
|
280 |
$attachments[] = array(
|
281 |
+
'title' => __( 'Submitted Vote', 'forminator' ),
|
282 |
'fields' => $attachment_fields,
|
283 |
);
|
284 |
|
323 |
}
|
324 |
|
325 |
$attachments[] = array(
|
326 |
+
'title' => __( 'Current Poll Result', 'forminator' ),
|
327 |
'fields' => $attachment_fields,
|
328 |
);
|
329 |
|
341 |
public function on_export_render_title_row() {
|
342 |
|
343 |
$export_headers = array(
|
344 |
+
'info' => __( 'Slack Info', 'forminator' ),
|
345 |
);
|
346 |
|
347 |
$poll_id = $this->poll_id;
|
addons/pro/slack/class-forminator-addon-slack-poll-settings.php
CHANGED
@@ -33,13 +33,13 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
33 |
|
34 |
$this->_update_poll_settings_error_message = __(
|
35 |
'The update to your settings for this poll failed, check the form input and try again.',
|
36 |
-
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
-
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel',
|
41 |
-
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel',
|
42 |
-
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message',
|
43 |
);
|
44 |
}
|
45 |
|
@@ -125,14 +125,14 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
125 |
$buttons = array();
|
126 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
127 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
128 |
-
esc_html__( 'Deactivate',
|
129 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
130 |
-
esc_html__( 'Deactivate this Slack Integration from this Poll.',
|
131 |
);
|
132 |
}
|
133 |
|
134 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
135 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
136 |
'</div>';
|
137 |
|
138 |
return array(
|
@@ -184,7 +184,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
184 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/select-type.php';
|
185 |
|
186 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
187 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
188 |
}
|
189 |
|
190 |
$multi_id = $submitted_data['multi_id'];
|
@@ -233,14 +233,14 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
233 |
$buttons = array();
|
234 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
235 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
236 |
-
esc_html__( 'Deactivate',
|
237 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
238 |
-
esc_html__( 'Deactivate this Slack Integration from this Poll.',
|
239 |
);
|
240 |
}
|
241 |
|
242 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
243 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
244 |
'</div>';
|
245 |
|
246 |
return array(
|
@@ -297,7 +297,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
297 |
public function select_target( $submitted_data ) {
|
298 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/select-target.php';
|
299 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
300 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
301 |
}
|
302 |
|
303 |
$multi_id = $submitted_data['multi_id'];
|
@@ -317,17 +317,17 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
317 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
318 |
$func_get_targets = 'get_groups_list';
|
319 |
$key_to_walk = 'channels';
|
320 |
-
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.',
|
321 |
break;
|
322 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
323 |
$func_get_targets = 'get_users_list';
|
324 |
$key_to_walk = 'members';
|
325 |
-
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.',
|
326 |
break;
|
327 |
default:
|
328 |
$func_get_targets = 'get_channels_list';
|
329 |
$key_to_walk = 'channels';
|
330 |
-
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.',
|
331 |
break;
|
332 |
}
|
333 |
|
@@ -341,7 +341,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
341 |
$api = $this->addon->get_api();
|
342 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
343 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
344 |
-
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.',
|
345 |
}
|
346 |
|
347 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
@@ -388,14 +388,14 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
388 |
$buttons = array();
|
389 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
390 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
391 |
-
esc_html__( 'Deactivate',
|
392 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
393 |
-
esc_html__( 'Deactivate this Slack Integration from this Poll.',
|
394 |
);
|
395 |
}
|
396 |
|
397 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
398 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
399 |
'</div>';
|
400 |
|
401 |
return array(
|
@@ -448,7 +448,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
448 |
public function setup_message( $submitted_data ) {
|
449 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/setup-message.php';
|
450 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
451 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
452 |
}
|
453 |
|
454 |
$multi_id = $submitted_data['multi_id'];
|
@@ -463,7 +463,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
463 |
);
|
464 |
|
465 |
$template_params['tags'] = forminator_get_vars();
|
466 |
-
$template_params['tags']['poll_name'] = __( 'Poll Name',
|
467 |
|
468 |
$is_submit = ! empty( $submitted_data );
|
469 |
$has_errors = false;
|
@@ -477,7 +477,7 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
477 |
try {
|
478 |
|
479 |
if ( empty( $message ) ) {
|
480 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Please add a message',
|
481 |
}
|
482 |
|
483 |
$this->save_multi_id_poll_setting_values(
|
@@ -502,14 +502,14 @@ class Forminator_Addon_Slack_Poll_Settings extends Forminator_Addon_Poll_Setting
|
|
502 |
$buttons = array();
|
503 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
504 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
505 |
-
esc_html__( 'Deactivate',
|
506 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
507 |
-
esc_html__( 'Deactivate this Slack Integration from this Poll.',
|
508 |
);
|
509 |
}
|
510 |
|
511 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
512 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT',
|
513 |
'</div>';
|
514 |
|
515 |
return array(
|
33 |
|
34 |
$this->_update_poll_settings_error_message = __(
|
35 |
'The update to your settings for this poll failed, check the form input and try again.',
|
36 |
+
'forminator'
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
+
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel', 'forminator' ),
|
41 |
+
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel', 'forminator' ),
|
42 |
+
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message', 'forminator' ),
|
43 |
);
|
44 |
}
|
45 |
|
125 |
$buttons = array();
|
126 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
127 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
128 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
129 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
130 |
+
esc_html__( 'Deactivate this Slack Integration from this Poll.', 'forminator' )
|
131 |
);
|
132 |
}
|
133 |
|
134 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
135 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
136 |
'</div>';
|
137 |
|
138 |
return array(
|
184 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/select-type.php';
|
185 |
|
186 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
187 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
188 |
}
|
189 |
|
190 |
$multi_id = $submitted_data['multi_id'];
|
233 |
$buttons = array();
|
234 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
235 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
236 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
237 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
238 |
+
esc_html__( 'Deactivate this Slack Integration from this Poll.', 'forminator' )
|
239 |
);
|
240 |
}
|
241 |
|
242 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
243 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
244 |
'</div>';
|
245 |
|
246 |
return array(
|
297 |
public function select_target( $submitted_data ) {
|
298 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/select-target.php';
|
299 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
300 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
301 |
}
|
302 |
|
303 |
$multi_id = $submitted_data['multi_id'];
|
317 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
318 |
$func_get_targets = 'get_groups_list';
|
319 |
$key_to_walk = 'channels';
|
320 |
+
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.', 'forminator' );
|
321 |
break;
|
322 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
323 |
$func_get_targets = 'get_users_list';
|
324 |
$key_to_walk = 'members';
|
325 |
+
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.', 'forminator' );
|
326 |
break;
|
327 |
default:
|
328 |
$func_get_targets = 'get_channels_list';
|
329 |
$key_to_walk = 'channels';
|
330 |
+
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.', 'forminator' );
|
331 |
break;
|
332 |
}
|
333 |
|
341 |
$api = $this->addon->get_api();
|
342 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
343 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
344 |
+
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.', 'forminator' ) );
|
345 |
}
|
346 |
|
347 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
388 |
$buttons = array();
|
389 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
390 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
391 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
392 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
393 |
+
esc_html__( 'Deactivate this Slack Integration from this Poll.', 'forminator' )
|
394 |
);
|
395 |
}
|
396 |
|
397 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
398 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
399 |
'</div>';
|
400 |
|
401 |
return array(
|
448 |
public function setup_message( $submitted_data ) {
|
449 |
$template = forminator_addon_slack_dir() . 'views/poll-settings/setup-message.php';
|
450 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
451 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
452 |
}
|
453 |
|
454 |
$multi_id = $submitted_data['multi_id'];
|
463 |
);
|
464 |
|
465 |
$template_params['tags'] = forminator_get_vars();
|
466 |
+
$template_params['tags']['poll_name'] = __( 'Poll Name', 'forminator' );
|
467 |
|
468 |
$is_submit = ! empty( $submitted_data );
|
469 |
$has_errors = false;
|
477 |
try {
|
478 |
|
479 |
if ( empty( $message ) ) {
|
480 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Please add a message', 'forminator' ) );
|
481 |
}
|
482 |
|
483 |
$this->save_multi_id_poll_setting_values(
|
502 |
$buttons = array();
|
503 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
504 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
505 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
506 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
507 |
+
esc_html__( 'Deactivate this Slack Integration from this Poll.', 'forminator' )
|
508 |
);
|
509 |
}
|
510 |
|
511 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
512 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT', 'forminator' ), 'forminator-addon-next' ) .
|
513 |
'</div>';
|
514 |
|
515 |
return array(
|
addons/pro/slack/class-forminator-addon-slack-quiz-hooks.php
CHANGED
@@ -135,11 +135,11 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
135 |
$lead_attachments = array();
|
136 |
|
137 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
138 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.',
|
139 |
}
|
140 |
|
141 |
if ( ! isset( $connection_settings['message'] ) ) {
|
142 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.',
|
143 |
}
|
144 |
$text_message = $connection_settings['message'];
|
145 |
$text_message = forminator_replace_variables( $text_message );
|
@@ -224,7 +224,7 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
224 |
return array(
|
225 |
'is_sent' => true,
|
226 |
'connection_name' => $connection_settings['name'],
|
227 |
-
'description' => __( 'Successfully send data to Slack',
|
228 |
'data_sent' => $api->get_last_data_sent(),
|
229 |
'data_received' => $api->get_last_data_received(),
|
230 |
'url_request' => $api->get_last_url_request(),
|
@@ -287,7 +287,7 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
287 |
'question' => $question,
|
288 |
'answer' => $answer,
|
289 |
'is_correct' => $is_correct,
|
290 |
-
'result' => $is_correct ? __( 'Correct',
|
291 |
);
|
292 |
if ( $is_correct ) {
|
293 |
$correct_answers ++;
|
@@ -349,12 +349,12 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
349 |
|
350 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
351 |
$attachment_fields[] = array(
|
352 |
-
'title' => __( 'Correct Answers',
|
353 |
'value' => $correct_answers,
|
354 |
'short' => true,
|
355 |
);
|
356 |
$attachment_fields[] = array(
|
357 |
-
'title' => __( 'Total Answers',
|
358 |
'value' => $total_answers,
|
359 |
'short' => true,
|
360 |
);
|
@@ -367,7 +367,7 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
367 |
}
|
368 |
|
369 |
$attachments[] = array(
|
370 |
-
'title' => __( 'Quiz Result',
|
371 |
'fields' => $attachment_fields,
|
372 |
'color' => 'warning',
|
373 |
);
|
@@ -474,7 +474,7 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
474 |
public function on_export_render_title_row() {
|
475 |
|
476 |
$export_headers = array(
|
477 |
-
'info' => __( 'Slack Info',
|
478 |
);
|
479 |
|
480 |
$quiz_id = $this->quiz_id;
|
@@ -643,29 +643,29 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
643 |
}
|
644 |
$status = $addon_meta_data['value'];
|
645 |
$additional_entry_item = array(
|
646 |
-
'label' => __( 'Slack Integration',
|
647 |
'value' => '',
|
648 |
);
|
649 |
|
650 |
$sub_entries = array();
|
651 |
if ( isset( $status['connection_name'] ) ) {
|
652 |
$sub_entries[] = array(
|
653 |
-
'label' => __( 'Integration Name',
|
654 |
'value' => $status['connection_name'],
|
655 |
);
|
656 |
}
|
657 |
|
658 |
if ( isset( $status['is_sent'] ) ) {
|
659 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
660 |
$sub_entries[] = array(
|
661 |
-
'label' => __( 'Sent To Slack',
|
662 |
'value' => $is_sent,
|
663 |
);
|
664 |
}
|
665 |
|
666 |
if ( isset( $status['description'] ) ) {
|
667 |
$sub_entries[] = array(
|
668 |
-
'label' => __( 'Info',
|
669 |
'value' => $status['description'],
|
670 |
);
|
671 |
}
|
@@ -674,21 +674,21 @@ class Forminator_Addon_Slack_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abst
|
|
674 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_SLACK_SHOW_FULL_LOG', true)`
|
675 |
if ( isset( $status['url_request'] ) ) {
|
676 |
$sub_entries[] = array(
|
677 |
-
'label' => __( 'API URL',
|
678 |
'value' => $status['url_request'],
|
679 |
);
|
680 |
}
|
681 |
|
682 |
if ( isset( $status['data_sent'] ) ) {
|
683 |
$sub_entries[] = array(
|
684 |
-
'label' => __( 'Data sent to Slack',
|
685 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
686 |
);
|
687 |
}
|
688 |
|
689 |
if ( isset( $status['data_received'] ) ) {
|
690 |
$sub_entries[] = array(
|
691 |
-
'label' => __( 'Data received from Slack',
|
692 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
693 |
);
|
694 |
}
|
135 |
$lead_attachments = array();
|
136 |
|
137 |
if ( ! isset( $connection_settings['target_id'] ) ) {
|
138 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Target ID not properly setup.', 'forminator' ) );
|
139 |
}
|
140 |
|
141 |
if ( ! isset( $connection_settings['message'] ) ) {
|
142 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Message not properly setup.', 'forminator' ) );
|
143 |
}
|
144 |
$text_message = $connection_settings['message'];
|
145 |
$text_message = forminator_replace_variables( $text_message );
|
224 |
return array(
|
225 |
'is_sent' => true,
|
226 |
'connection_name' => $connection_settings['name'],
|
227 |
+
'description' => __( 'Successfully send data to Slack', 'forminator' ),
|
228 |
'data_sent' => $api->get_last_data_sent(),
|
229 |
'data_received' => $api->get_last_data_received(),
|
230 |
'url_request' => $api->get_last_url_request(),
|
287 |
'question' => $question,
|
288 |
'answer' => $answer,
|
289 |
'is_correct' => $is_correct,
|
290 |
+
'result' => $is_correct ? __( 'Correct', 'forminator' ) : __( 'Incorrect', 'forminator' ),
|
291 |
);
|
292 |
if ( $is_correct ) {
|
293 |
$correct_answers ++;
|
349 |
|
350 |
if ( 'knowledge' === $this->quiz->quiz_type ) {
|
351 |
$attachment_fields[] = array(
|
352 |
+
'title' => __( 'Correct Answers', 'forminator' ),
|
353 |
'value' => $correct_answers,
|
354 |
'short' => true,
|
355 |
);
|
356 |
$attachment_fields[] = array(
|
357 |
+
'title' => __( 'Total Answers', 'forminator' ),
|
358 |
'value' => $total_answers,
|
359 |
'short' => true,
|
360 |
);
|
367 |
}
|
368 |
|
369 |
$attachments[] = array(
|
370 |
+
'title' => __( 'Quiz Result', 'forminator' ),
|
371 |
'fields' => $attachment_fields,
|
372 |
'color' => 'warning',
|
373 |
);
|
474 |
public function on_export_render_title_row() {
|
475 |
|
476 |
$export_headers = array(
|
477 |
+
'info' => __( 'Slack Info', 'forminator' ),
|
478 |
);
|
479 |
|
480 |
$quiz_id = $this->quiz_id;
|
643 |
}
|
644 |
$status = $addon_meta_data['value'];
|
645 |
$additional_entry_item = array(
|
646 |
+
'label' => __( 'Slack Integration', 'forminator' ),
|
647 |
'value' => '',
|
648 |
);
|
649 |
|
650 |
$sub_entries = array();
|
651 |
if ( isset( $status['connection_name'] ) ) {
|
652 |
$sub_entries[] = array(
|
653 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
654 |
'value' => $status['connection_name'],
|
655 |
);
|
656 |
}
|
657 |
|
658 |
if ( isset( $status['is_sent'] ) ) {
|
659 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
660 |
$sub_entries[] = array(
|
661 |
+
'label' => __( 'Sent To Slack', 'forminator' ),
|
662 |
'value' => $is_sent,
|
663 |
);
|
664 |
}
|
665 |
|
666 |
if ( isset( $status['description'] ) ) {
|
667 |
$sub_entries[] = array(
|
668 |
+
'label' => __( 'Info', 'forminator' ),
|
669 |
'value' => $status['description'],
|
670 |
);
|
671 |
}
|
674 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_SLACK_SHOW_FULL_LOG', true)`
|
675 |
if ( isset( $status['url_request'] ) ) {
|
676 |
$sub_entries[] = array(
|
677 |
+
'label' => __( 'API URL', 'forminator' ),
|
678 |
'value' => $status['url_request'],
|
679 |
);
|
680 |
}
|
681 |
|
682 |
if ( isset( $status['data_sent'] ) ) {
|
683 |
$sub_entries[] = array(
|
684 |
+
'label' => __( 'Data sent to Slack', 'forminator' ),
|
685 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
686 |
);
|
687 |
}
|
688 |
|
689 |
if ( isset( $status['data_received'] ) ) {
|
690 |
$sub_entries[] = array(
|
691 |
+
'label' => __( 'Data received from Slack', 'forminator' ),
|
692 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
693 |
);
|
694 |
}
|
addons/pro/slack/class-forminator-addon-slack-quiz-settings.php
CHANGED
@@ -33,13 +33,13 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
33 |
|
34 |
$this->_update_quiz_settings_error_message = __(
|
35 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
36 |
-
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
-
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel',
|
41 |
-
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel',
|
42 |
-
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message',
|
43 |
);
|
44 |
}
|
45 |
|
@@ -125,14 +125,14 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
125 |
$buttons = array();
|
126 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
127 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
128 |
-
esc_html__( 'Deactivate',
|
129 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
130 |
-
esc_html__( 'Deactivate this Slack Integration from this Quiz.',
|
131 |
);
|
132 |
}
|
133 |
|
134 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
135 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
136 |
'</div>';
|
137 |
|
138 |
return array(
|
@@ -184,7 +184,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
184 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/select-type.php';
|
185 |
|
186 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
187 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
188 |
}
|
189 |
|
190 |
$multi_id = $submitted_data['multi_id'];
|
@@ -233,14 +233,14 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
233 |
$buttons = array();
|
234 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
235 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
236 |
-
esc_html__( 'Deactivate',
|
237 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
238 |
-
esc_html__( 'Deactivate this Slack Integration from this Quiz.',
|
239 |
);
|
240 |
}
|
241 |
|
242 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
243 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
244 |
'</div>';
|
245 |
|
246 |
return array(
|
@@ -297,7 +297,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
297 |
public function select_target( $submitted_data ) {
|
298 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/select-target.php';
|
299 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
300 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
301 |
}
|
302 |
|
303 |
$multi_id = $submitted_data['multi_id'];
|
@@ -317,17 +317,17 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
317 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
318 |
$func_get_targets = 'get_groups_list';
|
319 |
$key_to_walk = 'channels';
|
320 |
-
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.',
|
321 |
break;
|
322 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
323 |
$func_get_targets = 'get_users_list';
|
324 |
$key_to_walk = 'members';
|
325 |
-
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.',
|
326 |
break;
|
327 |
default:
|
328 |
$func_get_targets = 'get_channels_list';
|
329 |
$key_to_walk = 'channels';
|
330 |
-
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.',
|
331 |
break;
|
332 |
}
|
333 |
|
@@ -341,7 +341,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
341 |
$api = $this->addon->get_api();
|
342 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
343 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
344 |
-
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.',
|
345 |
}
|
346 |
|
347 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
@@ -388,14 +388,14 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
388 |
$buttons = array();
|
389 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
390 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
391 |
-
esc_html__( 'Deactivate',
|
392 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
393 |
-
esc_html__( 'Deactivate this Slack Integration from this Quiz.',
|
394 |
);
|
395 |
}
|
396 |
|
397 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
398 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
399 |
'</div>';
|
400 |
|
401 |
return array(
|
@@ -448,7 +448,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
448 |
public function setup_message( $submitted_data ) {
|
449 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/setup-message.php';
|
450 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
451 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
452 |
}
|
453 |
|
454 |
$multi_id = $submitted_data['multi_id'];
|
@@ -464,7 +464,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
464 |
);
|
465 |
|
466 |
$template_params['tags'] = forminator_get_vars();
|
467 |
-
$template_params['tags']['quiz_name'] = __( 'Quiz Name',
|
468 |
|
469 |
if ( isset( $this->quiz_settings['hasLeads'] ) && $this->quiz_settings['hasLeads'] ) {
|
470 |
$template_params['lead_fields'] = $this->form_fields;
|
@@ -482,7 +482,7 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
482 |
try {
|
483 |
|
484 |
if ( empty( $message ) ) {
|
485 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Please add a message',
|
486 |
}
|
487 |
|
488 |
$this->save_multi_id_quiz_setting_values(
|
@@ -507,14 +507,14 @@ class Forminator_Addon_Slack_Quiz_Settings extends Forminator_Addon_Quiz_Setting
|
|
507 |
$buttons = array();
|
508 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
509 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
510 |
-
esc_html__( 'Deactivate',
|
511 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
512 |
-
esc_html__( 'Deactivate this Slack Integration from this Quiz.',
|
513 |
);
|
514 |
}
|
515 |
|
516 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
517 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT',
|
518 |
'</div>';
|
519 |
|
520 |
return array(
|
33 |
|
34 |
$this->_update_quiz_settings_error_message = __(
|
35 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
36 |
+
'forminator'
|
37 |
);
|
38 |
|
39 |
$this->target_types = array(
|
40 |
+
Forminator_Addon_Slack::TARGET_TYPE_PUBLIC_CHANNEL => __( 'Public Channel', 'forminator' ),
|
41 |
+
Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL => __( 'Private Channel', 'forminator' ),
|
42 |
+
Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE => __( 'Direct Message', 'forminator' ),
|
43 |
);
|
44 |
}
|
45 |
|
125 |
$buttons = array();
|
126 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
127 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
128 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
129 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
130 |
+
esc_html__( 'Deactivate this Slack Integration from this Quiz.', 'forminator' )
|
131 |
);
|
132 |
}
|
133 |
|
134 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
135 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
136 |
'</div>';
|
137 |
|
138 |
return array(
|
184 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/select-type.php';
|
185 |
|
186 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
187 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
188 |
}
|
189 |
|
190 |
$multi_id = $submitted_data['multi_id'];
|
233 |
$buttons = array();
|
234 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
235 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
236 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
237 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
238 |
+
esc_html__( 'Deactivate this Slack Integration from this Quiz.', 'forminator' )
|
239 |
);
|
240 |
}
|
241 |
|
242 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
243 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
244 |
'</div>';
|
245 |
|
246 |
return array(
|
297 |
public function select_target( $submitted_data ) {
|
298 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/select-target.php';
|
299 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
300 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
301 |
}
|
302 |
|
303 |
$multi_id = $submitted_data['multi_id'];
|
317 |
case Forminator_Addon_Slack::TARGET_TYPE_PRIVATE_CHANNEL:
|
318 |
$func_get_targets = 'get_groups_list';
|
319 |
$key_to_walk = 'channels';
|
320 |
+
$template_params['help_message'] = __( 'Select which Slack private group / channel this feed will post a message to.', 'forminator' );
|
321 |
break;
|
322 |
case Forminator_Addon_Slack::TARGET_TYPE_DIRECT_MESSAGE:
|
323 |
$func_get_targets = 'get_users_list';
|
324 |
$key_to_walk = 'members';
|
325 |
+
$template_params['help_message'] = __( 'Select which Slack user this feed will post a message to.', 'forminator' );
|
326 |
break;
|
327 |
default:
|
328 |
$func_get_targets = 'get_channels_list';
|
329 |
$key_to_walk = 'channels';
|
330 |
+
$template_params['help_message'] = __( 'Select which Slack channel this feed will post a message to.', 'forminator' );
|
331 |
break;
|
332 |
}
|
333 |
|
341 |
$api = $this->addon->get_api();
|
342 |
$targets_request = call_user_func( array( $api, $func_get_targets ) );
|
343 |
if ( ! is_object( $targets_request ) || ! isset( $targets_request->$key_to_walk ) || ! is_array( $targets_request->$key_to_walk ) || empty( $targets_request->$key_to_walk ) ) {
|
344 |
+
throw new Forminator_Addon_Slack_Exception( __( 'No target found on your selected target type.', 'forminator' ) );
|
345 |
}
|
346 |
|
347 |
foreach ( $targets_request->$key_to_walk as $value ) {
|
388 |
$buttons = array();
|
389 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
390 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
391 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
392 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
393 |
+
esc_html__( 'Deactivate this Slack Integration from this Quiz.', 'forminator' )
|
394 |
);
|
395 |
}
|
396 |
|
397 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
398 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
399 |
'</div>';
|
400 |
|
401 |
return array(
|
448 |
public function setup_message( $submitted_data ) {
|
449 |
$template = forminator_addon_slack_dir() . 'views/quiz-settings/setup-message.php';
|
450 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
451 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
452 |
}
|
453 |
|
454 |
$multi_id = $submitted_data['multi_id'];
|
464 |
);
|
465 |
|
466 |
$template_params['tags'] = forminator_get_vars();
|
467 |
+
$template_params['tags']['quiz_name'] = __( 'Quiz Name', 'forminator' );
|
468 |
|
469 |
if ( isset( $this->quiz_settings['hasLeads'] ) && $this->quiz_settings['hasLeads'] ) {
|
470 |
$template_params['lead_fields'] = $this->form_fields;
|
482 |
try {
|
483 |
|
484 |
if ( empty( $message ) ) {
|
485 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Please add a message', 'forminator' ) );
|
486 |
}
|
487 |
|
488 |
$this->save_multi_id_quiz_setting_values(
|
507 |
$buttons = array();
|
508 |
if ( $this->pick_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
509 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
510 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
511 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
512 |
+
esc_html__( 'Deactivate this Slack Integration from this Quiz.', 'forminator' )
|
513 |
);
|
514 |
}
|
515 |
|
516 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
517 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'CONNECT', 'forminator' ), 'forminator-addon-next' ) .
|
518 |
'</div>';
|
519 |
|
520 |
return array(
|
addons/pro/slack/class-forminator-addon-slack.php
CHANGED
@@ -55,13 +55,13 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
55 |
*/
|
56 |
public function __construct() {
|
57 |
// late init to allow translation
|
58 |
-
$this->_description = __( 'Get awesome by your form.',
|
59 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Slack Integration, don\'t hesitate to contact us',
|
60 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Slack Integration, please try again',
|
61 |
|
62 |
$this->_update_settings_error_message = __(
|
63 |
'Sorry, we failed to update settings, please check your form and try again',
|
64 |
-
|
65 |
);
|
66 |
|
67 |
$this->_icon = forminator_addon_slack_assets_url() . 'icons/slack.png';
|
@@ -97,7 +97,7 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
97 |
try {
|
98 |
// check if its active
|
99 |
if ( ! $this->is_active() ) {
|
100 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Slack is not active',
|
101 |
}
|
102 |
|
103 |
// if user completed api setup
|
@@ -137,17 +137,17 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
137 |
try {
|
138 |
$form_settings_instance = null;
|
139 |
if ( ! $this->is_connected() ) {
|
140 |
-
throw new Forminator_Addon_Slack_Exception( __( ' Slack is not connected',
|
141 |
}
|
142 |
|
143 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
144 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Slack_Form_Settings ) {
|
145 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Invalid Form Settings of Slack',
|
146 |
}
|
147 |
|
148 |
// Mark as active when there is at least one active connection
|
149 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
150 |
-
throw new Forminator_Addon_Slack_Exception( __( 'No active Slack connection found in this form',
|
151 |
}
|
152 |
|
153 |
$is_form_connected = true;
|
@@ -278,14 +278,14 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
278 |
$buttons = array();
|
279 |
if ( $this->is_connected() ) {
|
280 |
$buttons['disconnect'] = array(
|
281 |
-
'markup' => self::get_button_markup( esc_html__( 'Disconnect',
|
282 |
);
|
283 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
284 |
-
self::get_button_markup( esc_html__( 'RE-AUTHORIZE',
|
285 |
'</div>';
|
286 |
} else {
|
287 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
288 |
-
self::get_button_markup( esc_html__( 'Next',
|
289 |
'</div>';
|
290 |
}
|
291 |
|
@@ -330,12 +330,12 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
330 |
$client_secret = isset( $submitted_data['client_secret'] ) ? $submitted_data['client_secret'] : '';
|
331 |
|
332 |
if ( empty( $client_id ) ) {
|
333 |
-
$template_params['client_id_error'] = __( 'Please input valid Client ID',
|
334 |
$has_errors = true;
|
335 |
}
|
336 |
|
337 |
if ( empty( $client_secret ) ) {
|
338 |
-
$template_params['client_secret_error'] = __( 'Please input valid Client Secret',
|
339 |
$has_errors = true;
|
340 |
}
|
341 |
|
@@ -398,7 +398,7 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
398 |
$buttons = array();
|
399 |
if ( $this->is_connected() ) {
|
400 |
$buttons['disconnect'] = array(
|
401 |
-
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT',
|
402 |
);
|
403 |
}
|
404 |
|
@@ -443,7 +443,7 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
443 |
|
444 |
if ( $this->_token ) {
|
445 |
$buttons['close'] = array(
|
446 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
447 |
);
|
448 |
$is_poll = false;
|
449 |
|
@@ -654,7 +654,7 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
654 |
}
|
655 |
|
656 |
if ( empty( $token ) ) {
|
657 |
-
throw new Forminator_Addon_Slack_Exception( __( 'Failed to get token',
|
658 |
}
|
659 |
|
660 |
if ( ! $this->is_active() ) {
|
@@ -673,7 +673,7 @@ final class Forminator_Addon_Slack extends Forminator_Addon_Abstract {
|
|
673 |
$template_params['error_message'] = $e->getMessage();
|
674 |
}
|
675 |
} else {
|
676 |
-
$template_params['error_message'] = __( 'Failed to get authorization code.',
|
677 |
// todo : translate $query_args[error]
|
678 |
$settings['auth_error_message'] = $template_params['error_message'];
|
679 |
$this->save_settings_values( $settings );
|
55 |
*/
|
56 |
public function __construct() {
|
57 |
// late init to allow translation
|
58 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
59 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Slack Integration, don\'t hesitate to contact us', 'forminator' );
|
60 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Slack Integration, please try again', 'forminator' );
|
61 |
|
62 |
$this->_update_settings_error_message = __(
|
63 |
'Sorry, we failed to update settings, please check your form and try again',
|
64 |
+
'forminator'
|
65 |
);
|
66 |
|
67 |
$this->_icon = forminator_addon_slack_assets_url() . 'icons/slack.png';
|
97 |
try {
|
98 |
// check if its active
|
99 |
if ( ! $this->is_active() ) {
|
100 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Slack is not active', 'forminator' ) );
|
101 |
}
|
102 |
|
103 |
// if user completed api setup
|
137 |
try {
|
138 |
$form_settings_instance = null;
|
139 |
if ( ! $this->is_connected() ) {
|
140 |
+
throw new Forminator_Addon_Slack_Exception( __( ' Slack is not connected', 'forminator' ) );
|
141 |
}
|
142 |
|
143 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
144 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Slack_Form_Settings ) {
|
145 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Invalid Form Settings of Slack', 'forminator' ) );
|
146 |
}
|
147 |
|
148 |
// Mark as active when there is at least one active connection
|
149 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
150 |
+
throw new Forminator_Addon_Slack_Exception( __( 'No active Slack connection found in this form', 'forminator' ) );
|
151 |
}
|
152 |
|
153 |
$is_form_connected = true;
|
278 |
$buttons = array();
|
279 |
if ( $this->is_connected() ) {
|
280 |
$buttons['disconnect'] = array(
|
281 |
+
'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
282 |
);
|
283 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
284 |
+
self::get_button_markup( esc_html__( 'RE-AUTHORIZE', 'forminator' ), 'forminator-addon-next' ) .
|
285 |
'</div>';
|
286 |
} else {
|
287 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
288 |
+
self::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
289 |
'</div>';
|
290 |
}
|
291 |
|
330 |
$client_secret = isset( $submitted_data['client_secret'] ) ? $submitted_data['client_secret'] : '';
|
331 |
|
332 |
if ( empty( $client_id ) ) {
|
333 |
+
$template_params['client_id_error'] = __( 'Please input valid Client ID', 'forminator' );
|
334 |
$has_errors = true;
|
335 |
}
|
336 |
|
337 |
if ( empty( $client_secret ) ) {
|
338 |
+
$template_params['client_secret_error'] = __( 'Please input valid Client Secret', 'forminator' );
|
339 |
$has_errors = true;
|
340 |
}
|
341 |
|
398 |
$buttons = array();
|
399 |
if ( $this->is_connected() ) {
|
400 |
$buttons['disconnect'] = array(
|
401 |
+
'markup' => self::get_button_markup( esc_html__( 'DISCONNECT', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
402 |
);
|
403 |
}
|
404 |
|
443 |
|
444 |
if ( $this->_token ) {
|
445 |
$buttons['close'] = array(
|
446 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'sui-button-ghost forminator-addon-close' ),
|
447 |
);
|
448 |
$is_poll = false;
|
449 |
|
654 |
}
|
655 |
|
656 |
if ( empty( $token ) ) {
|
657 |
+
throw new Forminator_Addon_Slack_Exception( __( 'Failed to get token', 'forminator' ) );
|
658 |
}
|
659 |
|
660 |
if ( ! $this->is_active() ) {
|
673 |
$template_params['error_message'] = $e->getMessage();
|
674 |
}
|
675 |
} else {
|
676 |
+
$template_params['error_message'] = __( 'Failed to get authorization code.', 'forminator' );
|
677 |
// todo : translate $query_args[error]
|
678 |
$settings['auth_error_message'] = $template_params['error_message'];
|
679 |
$this->save_settings_values( $settings );
|
addons/pro/slack/lib/class-forminator-addon-slack-wp-api.php
CHANGED
@@ -72,7 +72,7 @@ class Forminator_Addon_Slack_Wp_Api {
|
|
72 |
public function __construct( $_token ) {
|
73 |
//prerequisites
|
74 |
if ( ! $_token ) {
|
75 |
-
throw new Forminator_Addon_Slack_Wp_Api_Exception( __( 'Missing required Token',
|
76 |
}
|
77 |
|
78 |
$this->_token = $_token;
|
@@ -206,7 +206,7 @@ class Forminator_Addon_Slack_Wp_Api {
|
|
206 |
|
207 |
if ( is_wp_error( $res ) || ! $res ) {
|
208 |
throw new Forminator_Addon_Slack_Wp_Api_Exception(
|
209 |
-
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.',
|
210 |
);
|
211 |
}
|
212 |
|
@@ -220,10 +220,10 @@ class Forminator_Addon_Slack_Wp_Api {
|
|
220 |
|
221 |
if ( 404 === $status_code ) {
|
222 |
/* translators: ... */
|
223 |
-
throw new Forminator_Addon_Slack_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
224 |
}
|
225 |
/* translators: ... */
|
226 |
-
throw new Forminator_Addon_Slack_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
227 |
}
|
228 |
}
|
229 |
|
@@ -238,7 +238,7 @@ class Forminator_Addon_Slack_Wp_Api {
|
|
238 |
$msg = $res->error;
|
239 |
}
|
240 |
/* translators: ... */
|
241 |
-
throw new Forminator_Addon_Slack_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
242 |
}
|
243 |
}
|
244 |
|
72 |
public function __construct( $_token ) {
|
73 |
//prerequisites
|
74 |
if ( ! $_token ) {
|
75 |
+
throw new Forminator_Addon_Slack_Wp_Api_Exception( __( 'Missing required Token', 'forminator' ) );
|
76 |
}
|
77 |
|
78 |
$this->_token = $_token;
|
206 |
|
207 |
if ( is_wp_error( $res ) || ! $res ) {
|
208 |
throw new Forminator_Addon_Slack_Wp_Api_Exception(
|
209 |
+
__( 'Failed to process request, make sure your API URL is correct and your server has internet connection.', 'forminator' )
|
210 |
);
|
211 |
}
|
212 |
|
220 |
|
221 |
if ( 404 === $status_code ) {
|
222 |
/* translators: ... */
|
223 |
+
throw new Forminator_Addon_Slack_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
224 |
}
|
225 |
/* translators: ... */
|
226 |
+
throw new Forminator_Addon_Slack_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
227 |
}
|
228 |
}
|
229 |
|
238 |
$msg = $res->error;
|
239 |
}
|
240 |
/* translators: ... */
|
241 |
+
throw new Forminator_Addon_Slack_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
242 |
}
|
243 |
}
|
244 |
|
addons/pro/slack/views/form-settings/pick-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/slack/views/form-settings/select-target.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target',
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -23,9 +23,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
-
<label class="sui-label" for="slack-target-id"><?php esc_html_e( 'Type',
|
27 |
<select name="target_id" class="sui-select sui-form-control" id="slack-target-id">
|
28 |
-
<option><?php esc_html_e( 'Please select target',
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target', 'forminator' ) ); ?></h3>
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
+
<label class="sui-label" for="slack-target-id"><?php esc_html_e( 'Type', 'forminator' ); ?></label>
|
27 |
<select name="target_id" class="sui-select sui-form-control" id="slack-target-id">
|
28 |
+
<option><?php esc_html_e( 'Please select target', 'forminator' ); ?></option>
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
addons/pro/slack/views/form-settings/select-type.php
CHANGED
@@ -13,8 +13,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type',
|
17 |
-
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
@@ -22,9 +22,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label" for="slack-type-id"><?php esc_html_e( 'Type',
|
26 |
<select name="type" class="sui-select sui-form-control" id="slack-type-id">
|
27 |
-
<option><?php esc_html_e( 'Please select type',
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label" for="slack-type-id"><?php esc_html_e( 'Type', 'forminator' ); ?></label>
|
26 |
<select name="type" class="sui-select sui-form-control" id="slack-type-id">
|
27 |
+
<option><?php esc_html_e( 'Please select type', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/slack/views/form-settings/setup-message.php
CHANGED
@@ -14,8 +14,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message',
|
18 |
-
<p><?php esc_html_e( 'Configure message to be sent.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
@@ -24,14 +24,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
|
27 |
-
<label class="sui-label"><?php esc_html_e( 'Message',
|
28 |
|
29 |
<div class="sui-insert-variables">
|
30 |
|
31 |
<textarea id="slack_message"
|
32 |
class="sui-form-control"
|
33 |
name="message"
|
34 |
-
placeholder="<?php echo esc_attr( __( 'Message',
|
35 |
|
36 |
<select data-textarea-id="slack_message">
|
37 |
<?php foreach ( $vars['fields'] as $field ) : ?>
|
@@ -44,17 +44,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
44 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
45 |
<?php endif; ?>
|
46 |
<span class="sui-description">
|
47 |
-
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ',
|
48 |
-
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.',
|
49 |
</span>
|
50 |
<span class="sui-description">
|
51 |
<?php
|
52 |
esc_html_e(
|
53 |
'By default sent message will include ALL FIELDS as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
54 |
-
|
55 |
);
|
56 |
?>
|
57 |
-
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here.',
|
58 |
</span>
|
59 |
|
60 |
</div>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Configure message to be sent.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
|
27 |
+
<label class="sui-label"><?php esc_html_e( 'Message', 'forminator' ); ?></label>
|
28 |
|
29 |
<div class="sui-insert-variables">
|
30 |
|
31 |
<textarea id="slack_message"
|
32 |
class="sui-form-control"
|
33 |
name="message"
|
34 |
+
placeholder="<?php echo esc_attr( __( 'Message', 'forminator' ) ); ?>"><?php echo esc_html( $vars['message'] ); ?></textarea>
|
35 |
|
36 |
<select data-textarea-id="slack_message">
|
37 |
<?php foreach ( $vars['fields'] as $field ) : ?>
|
44 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
45 |
<?php endif; ?>
|
46 |
<span class="sui-description">
|
47 |
+
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ', 'forminator' ); ?>
|
48 |
+
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.', 'forminator' ); ?></a>.
|
49 |
</span>
|
50 |
<span class="sui-description">
|
51 |
<?php
|
52 |
esc_html_e(
|
53 |
'By default sent message will include ALL FIELDS as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
54 |
+
'forminator'
|
55 |
);
|
56 |
?>
|
57 |
+
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here.', 'forminator' ); ?></a>.
|
58 |
</span>
|
59 |
|
60 |
</div>
|
addons/pro/slack/views/poll-settings/pick-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/slack/views/poll-settings/select-target.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target',
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -23,9 +23,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
-
<label class="sui-label"><?php esc_html_e( 'Type',
|
27 |
<select name="target_id" class="sui-select sui-form-control">
|
28 |
-
<option><?php esc_html_e( 'Please select target',
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target', 'forminator' ) ); ?></h3>
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
+
<label class="sui-label"><?php esc_html_e( 'Type', 'forminator' ); ?>
|
27 |
<select name="target_id" class="sui-select sui-form-control">
|
28 |
+
<option><?php esc_html_e( 'Please select target', 'forminator' ); ?></option>
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
addons/pro/slack/views/poll-settings/select-type.php
CHANGED
@@ -13,8 +13,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type',
|
17 |
-
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
@@ -22,9 +22,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label"><?php esc_html_e( 'Type',
|
26 |
<select name="type" class="sui-select sui-form-control">
|
27 |
-
<option><?php esc_html_e( 'Please select type',
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label"><?php esc_html_e( 'Type', 'forminator' ); ?>
|
26 |
<select name="type" class="sui-select sui-form-control">
|
27 |
+
<option><?php esc_html_e( 'Please select type', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/slack/views/poll-settings/setup-message.php
CHANGED
@@ -14,8 +14,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message',
|
18 |
-
<p><?php esc_html_e( 'Configure message to be sent.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
@@ -24,14 +24,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
|
27 |
-
<label class="sui-label"><?php esc_html_e( 'Message',
|
28 |
|
29 |
<div class="sui-insert-variables">
|
30 |
|
31 |
<textarea id="slack_message"
|
32 |
class="sui-form-control"
|
33 |
name="message"
|
34 |
-
placeholder="<?php echo esc_attr( __( 'Message',
|
35 |
|
36 |
<select data-textarea-id="slack_message">
|
37 |
<?php foreach ( $vars['tags'] as $key => $label ) : ?>
|
@@ -45,17 +45,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
45 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
46 |
<?php endif; ?>
|
47 |
<span class="sui-description">
|
48 |
-
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ',
|
49 |
-
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.',
|
50 |
</span>
|
51 |
<span class="sui-description">
|
52 |
<?php
|
53 |
esc_html_e(
|
54 |
'By default sent message will include Poll Answer and Poll Results as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
55 |
-
|
56 |
);
|
57 |
?>
|
58 |
-
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here',
|
59 |
</span>
|
60 |
|
61 |
</div>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Configure message to be sent.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
24 |
<form>
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
|
27 |
+
<label class="sui-label"><?php esc_html_e( 'Message', 'forminator' ); ?></label>
|
28 |
|
29 |
<div class="sui-insert-variables">
|
30 |
|
31 |
<textarea id="slack_message"
|
32 |
class="sui-form-control"
|
33 |
name="message"
|
34 |
+
placeholder="<?php echo esc_attr( __( 'Message', 'forminator' ) ); ?>"><?php echo esc_html( $vars['message'] ); ?></textarea>
|
35 |
|
36 |
<select data-textarea-id="slack_message">
|
37 |
<?php foreach ( $vars['tags'] as $key => $label ) : ?>
|
45 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
46 |
<?php endif; ?>
|
47 |
<span class="sui-description">
|
48 |
+
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ', 'forminator' ); ?>
|
49 |
+
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.', 'forminator' ); ?></a>.
|
50 |
</span>
|
51 |
<span class="sui-description">
|
52 |
<?php
|
53 |
esc_html_e(
|
54 |
'By default sent message will include Poll Answer and Poll Results as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
55 |
+
'forminator'
|
56 |
);
|
57 |
?>
|
58 |
+
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here', 'forminator' ); ?></a>
|
59 |
</span>
|
60 |
|
61 |
</div>
|
addons/pro/slack/views/quiz-settings/pick-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/slack/views/quiz-settings/select-target.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target',
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -23,9 +23,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
-
<label class="sui-label"><?php esc_html_e( 'Type',
|
27 |
<select name="target_id" class="sui-select sui-form-control">
|
28 |
-
<option><?php esc_html_e( 'Please select target',
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Target', 'forminator' ) ); ?></h3>
|
18 |
<p><?php echo esc_html( $vars['help_message'] ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<form>
|
24 |
|
25 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['target_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
26 |
+
<label class="sui-label"><?php esc_html_e( 'Type', 'forminator' ); ?>
|
27 |
<select name="target_id" class="sui-select sui-form-control">
|
28 |
+
<option><?php esc_html_e( 'Please select target', 'forminator' ); ?></option>
|
29 |
<?php foreach ( $vars['targets'] as $target_id => $target_name ) : ?>
|
30 |
<option value="<?php echo esc_attr( $target_id ); ?>" <?php selected( $vars['target_id'], $target_id ); ?>><?php echo esc_html( $target_name ); ?></option>
|
31 |
<?php endforeach; ?>
|
addons/pro/slack/views/quiz-settings/select-type.php
CHANGED
@@ -13,8 +13,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type',
|
17 |
-
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
@@ -22,9 +22,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label"><?php esc_html_e( 'Type',
|
26 |
<select name="type" class="sui-select sui-form-control">
|
27 |
-
<option><?php esc_html_e( 'Please select type',
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Select Type', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Select what type of channel Slack will send the message to: a public channel, a private group or a DM channel.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
22 |
<form>
|
23 |
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['type_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label"><?php esc_html_e( 'Type', 'forminator' ); ?>
|
26 |
<select name="type" class="sui-select sui-form-control">
|
27 |
+
<option><?php esc_html_e( 'Please select type', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['types'] as $type_id => $type_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $type_id ); ?>" <?php selected( $vars['type'], $type_id ); ?>><?php echo esc_html( $type_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/slack/views/quiz-settings/setup-message.php
CHANGED
@@ -15,8 +15,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
|
16 |
?>
|
17 |
<div class="integration-header">
|
18 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message',
|
19 |
-
<p><?php esc_html_e( 'Configure message to be sent.',
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
21 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
22 |
<?php endif; ?>
|
@@ -25,14 +25,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
|
28 |
-
<label class="sui-label"><?php esc_html_e( 'Message',
|
29 |
|
30 |
<div class="sui-insert-variables">
|
31 |
|
32 |
<textarea id="slack_message"
|
33 |
class="sui-form-control"
|
34 |
name="message"
|
35 |
-
placeholder="<?php echo esc_attr( __( 'Message',
|
36 |
|
37 |
<select data-textarea-id="slack_message">
|
38 |
<?php foreach ( $vars['tags'] as $short_tag => $label ) : ?>
|
@@ -52,17 +52,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
<span class="sui-description">
|
55 |
-
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ',
|
56 |
-
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.',
|
57 |
</span>
|
58 |
<span class="sui-description">
|
59 |
<?php
|
60 |
esc_html_e(
|
61 |
'By default sent message will include Quiz Answer and Quiz Result as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
62 |
-
|
63 |
);
|
64 |
?>
|
65 |
-
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here',
|
66 |
</span>
|
67 |
|
68 |
</div>
|
15 |
|
16 |
?>
|
17 |
<div class="integration-header">
|
18 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Message', 'forminator' ) ); ?></h3>
|
19 |
+
<p><?php esc_html_e( 'Configure message to be sent.', 'forminator' ); ?></p>
|
20 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
21 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
22 |
<?php endif; ?>
|
25 |
<form>
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['message_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
|
28 |
+
<label class="sui-label"><?php esc_html_e( 'Message', 'forminator' ); ?></label>
|
29 |
|
30 |
<div class="sui-insert-variables">
|
31 |
|
32 |
<textarea id="slack_message"
|
33 |
class="sui-form-control"
|
34 |
name="message"
|
35 |
+
placeholder="<?php echo esc_attr( __( 'Message', 'forminator' ) ); ?>"><?php echo esc_html( $vars['message'] ); ?></textarea>
|
36 |
|
37 |
<select data-textarea-id="slack_message">
|
38 |
<?php foreach ( $vars['tags'] as $short_tag => $label ) : ?>
|
52 |
<span class="sui-error-message"><?php echo esc_html( $vars['message_error'] ); ?></span>
|
53 |
<?php endif; ?>
|
54 |
<span class="sui-description">
|
55 |
+
<?php esc_html_e( 'You can format your message using Slack Flavored Markdown, find more information ', 'forminator' ); ?>
|
56 |
+
<a href="https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages" target="_blank"><?php esc_html_e( 'here.', 'forminator' ); ?></a>.
|
57 |
</span>
|
58 |
<span class="sui-description">
|
59 |
<?php
|
60 |
esc_html_e(
|
61 |
'By default sent message will include Quiz Answer and Quiz Result as attachment using Forminator Format to ease you up, more information about attachment can be found ',
|
62 |
+
'forminator'
|
63 |
);
|
64 |
?>
|
65 |
+
<a href="https://api.slack.com/docs/message-attachments" target="_blank"><?php esc_html_e( 'here', 'forminator' ); ?></a>
|
66 |
</span>
|
67 |
|
68 |
</div>
|
addons/pro/slack/views/sections/authorize.php
CHANGED
@@ -13,7 +13,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Slack',
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
@@ -24,14 +24,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized Slack, you can go back to integration settings.',
|
27 |
-
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice-loading">
|
34 |
-
<p><?php esc_html_e( 'Please Wait...',
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Slack', 'forminator' ); ?></h2>
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized Slack, you can go back to integration settings.',
|
27 |
+
'forminator'
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice-loading">
|
34 |
+
<p><?php esc_html_e( 'Please Wait...', 'forminator' ); ?></p>
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
addons/pro/slack/views/settings/authorize.php
CHANGED
@@ -13,17 +13,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<h3 class="sui-box-title" id="dialogTitle2">
|
14 |
<?php
|
15 |
/* translators: ... */
|
16 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
17 |
?>
|
18 |
</h3>
|
19 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
20 |
-
<p><?php esc_html_e( 'Click button below to re-authorize.',
|
21 |
<?php else : ?>
|
22 |
-
<p><?php esc_html_e( 'Authorize Forminator to connect with your Slack in order to send data from your forms.',
|
23 |
<?php endif ?>
|
24 |
</div>
|
25 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
26 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'AUTHORIZE',
|
27 |
<?php else : ?>
|
28 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'RE-AUTHORIZE',
|
29 |
<?php endif ?>
|
13 |
<h3 class="sui-box-title" id="dialogTitle2">
|
14 |
<?php
|
15 |
/* translators: ... */
|
16 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'Slack' ) );
|
17 |
?>
|
18 |
</h3>
|
19 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
20 |
+
<p><?php esc_html_e( 'Click button below to re-authorize.', 'forminator' ); ?> </p>
|
21 |
<?php else : ?>
|
22 |
+
<p><?php esc_html_e( 'Authorize Forminator to connect with your Slack in order to send data from your forms.', 'forminator' ); ?></p>
|
23 |
<?php endif ?>
|
24 |
</div>
|
25 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
26 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'AUTHORIZE', 'forminator' ); ?></a>
|
27 |
<?php else : ?>
|
28 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'RE-AUTHORIZE', 'forminator' ); ?></a>
|
29 |
<?php endif ?>
|
addons/pro/slack/views/settings/error-authorize.php
CHANGED
@@ -13,7 +13,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<h3 class="sui-box-title" id="dialogTitle2">
|
14 |
<?php
|
15 |
/* translators: ... */
|
16 |
-
echo esc_html( sprintf( __( 'Failed to add %1$s',
|
17 |
?>
|
18 |
</h3>
|
19 |
<p>
|
@@ -22,4 +22,4 @@ foreach ( $template_vars as $key => $val ) {
|
|
22 |
<?php endif; ?>
|
23 |
</p>
|
24 |
</div>
|
25 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button forminator-addon-connect"><?php esc_html_e( 'RETRY',
|
13 |
<h3 class="sui-box-title" id="dialogTitle2">
|
14 |
<?php
|
15 |
/* translators: ... */
|
16 |
+
echo esc_html( sprintf( __( 'Failed to add %1$s', 'forminator' ), 'Slack' ) );
|
17 |
?>
|
18 |
</h3>
|
19 |
<p>
|
22 |
<?php endif; ?>
|
23 |
</p>
|
24 |
</div>
|
25 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button forminator-addon-connect"><?php esc_html_e( 'RETRY', 'forminator' ); ?></a>
|
addons/pro/slack/views/settings/setup-client.php
CHANGED
@@ -18,13 +18,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
18 |
<h3 class="sui-box-title" id="dialogTitle2">
|
19 |
<?php
|
20 |
/* translators: ... */
|
21 |
-
echo esc_html( sprintf( __( 'Setup %1$s Client',
|
22 |
?>
|
23 |
</h3>
|
24 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
25 |
-
<p><?php esc_html_e( 'Your Slack account is already authorized. Edit info below to re-authorize.',
|
26 |
<?php else : ?>
|
27 |
-
<p><?php esc_html_e( 'Setup Slack to be used by Forminator to communicating with Slack server.',
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
30 |
<?php endif; ?>
|
@@ -32,31 +32,31 @@ foreach ( $template_vars as $key => $val ) {
|
|
32 |
</div>
|
33 |
<form>
|
34 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
35 |
-
<label class="sui-label"><?php esc_html_e( 'Client ID',
|
36 |
<input
|
37 |
class="sui-form-control"
|
38 |
-
name="client_id" placeholder="<?php echo esc_attr( __( 'Client ID',
|
39 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>">
|
40 |
<?php if ( ! empty( $vars['client_id_error'] ) ) : ?>
|
41 |
<span class="sui-error-message"><?php echo esc_html( $vars['client_id_error'] ); ?></span>
|
42 |
<?php endif; ?>
|
43 |
</div>
|
44 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['client_secret_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
45 |
-
<label class="sui-label"><?php esc_html_e( 'Client Secret',
|
46 |
<input
|
47 |
class="sui-form-control"
|
48 |
-
name="client_secret" placeholder="<?php echo esc_attr( __( 'Client Secret',
|
49 |
value="<?php echo esc_attr( $vars['client_secret'] ); ?>">
|
50 |
<?php if ( ! empty( $vars['client_secret_error'] ) ) : ?>
|
51 |
<span class="sui-error-message"><?php echo esc_html( $vars['client_secret_error'] ); ?></span>
|
52 |
<?php endif; ?>
|
53 |
<span class="sui-description">
|
54 |
-
<?php esc_html_e( 'Follow these instructions to retrieve your Client ID and Secret.',
|
55 |
<ol class="instructions" id="clientid-instructions">
|
56 |
<li>
|
57 |
<?php
|
58 |
echo sprintf(/* translators: ... */
|
59 |
-
esc_html__( 'Go %1$shere%2$s to create new Slack App.',
|
60 |
'<a href="https://api.slack.com/apps?new_app=1" target="_blank">',
|
61 |
'</a>'
|
62 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
@@ -66,14 +66,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
66 |
<?php
|
67 |
esc_html_e(
|
68 |
'You will need to enter App Name and Development Slack Workspace.',
|
69 |
-
|
70 |
);
|
71 |
?>
|
72 |
</li>
|
73 |
<li>
|
74 |
<?php
|
75 |
echo sprintf(/* translators: ... */
|
76 |
-
esc_html__( 'Once the Project creation is completed go to the %1$sBasic Information%2$s. Then scroll through %3$sApp Credentials%4$s, to take a note of %5$sClient ID%6$s and %7$sClient Secret%8$s.',
|
77 |
'<strong>',
|
78 |
'</strong>',
|
79 |
'<strong>',
|
@@ -88,7 +88,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
88 |
<li>
|
89 |
<?php
|
90 |
echo sprintf(/* translators: ... */
|
91 |
-
esc_html__( 'Next, go to the %1$sFeatures%2$s > %3$sOAuth & Permissions%4$s > %5$sRedirect URLs%6$s section.',
|
92 |
'<strong>',
|
93 |
'</strong>',
|
94 |
'<strong>',
|
@@ -101,19 +101,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
101 |
<li>
|
102 |
<?php
|
103 |
echo sprintf(/* translators: ... */
|
104 |
-
esc_html__( 'Click %1$sAdd a new Redirect URL%2$s.',
|
105 |
'<strong>',
|
106 |
'</strong>'
|
107 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
108 |
?>
|
109 |
</li>
|
110 |
<li>
|
111 |
-
<?php esc_html_e( 'In the shown input field, put this value below',
|
112 |
<pre class="sui-code-snippet"><?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?></pre>.</li>
|
113 |
<li>
|
114 |
<?php
|
115 |
echo sprintf(/* translators: ... */
|
116 |
-
esc_html__( 'Then click the %1$sAdd%2$s button.',
|
117 |
'<strong>',
|
118 |
'</strong>'
|
119 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
@@ -122,7 +122,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
122 |
<li>
|
123 |
<?php
|
124 |
echo sprintf(/* translators: ... */
|
125 |
-
esc_html__( 'Then click the %1$sSave URLs%2$s button.',
|
126 |
'<strong>',
|
127 |
'</strong>'
|
128 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
18 |
<h3 class="sui-box-title" id="dialogTitle2">
|
19 |
<?php
|
20 |
/* translators: ... */
|
21 |
+
echo esc_html( sprintf( __( 'Setup %1$s Client', 'forminator' ), 'Slack' ) );
|
22 |
?>
|
23 |
</h3>
|
24 |
<?php if ( ! empty( $vars['token'] ) ) : ?>
|
25 |
+
<p><?php esc_html_e( 'Your Slack account is already authorized. Edit info below to re-authorize.', 'forminator' ); ?> </p>
|
26 |
<?php else : ?>
|
27 |
+
<p><?php esc_html_e( 'Setup Slack to be used by Forminator to communicating with Slack server.', 'forminator' ); ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
30 |
<?php endif; ?>
|
32 |
</div>
|
33 |
<form>
|
34 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['client_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
35 |
+
<label class="sui-label"><?php esc_html_e( 'Client ID', 'forminator' ); ?></label>
|
36 |
<input
|
37 |
class="sui-form-control"
|
38 |
+
name="client_id" placeholder="<?php echo esc_attr( __( 'Client ID', 'forminator' ) ); ?>"
|
39 |
value="<?php echo esc_attr( $vars['client_id'] ); ?>">
|
40 |
<?php if ( ! empty( $vars['client_id_error'] ) ) : ?>
|
41 |
<span class="sui-error-message"><?php echo esc_html( $vars['client_id_error'] ); ?></span>
|
42 |
<?php endif; ?>
|
43 |
</div>
|
44 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['client_secret_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
45 |
+
<label class="sui-label"><?php esc_html_e( 'Client Secret', 'forminator' ); ?></label>
|
46 |
<input
|
47 |
class="sui-form-control"
|
48 |
+
name="client_secret" placeholder="<?php echo esc_attr( __( 'Client Secret', 'forminator' ) ); ?>"
|
49 |
value="<?php echo esc_attr( $vars['client_secret'] ); ?>">
|
50 |
<?php if ( ! empty( $vars['client_secret_error'] ) ) : ?>
|
51 |
<span class="sui-error-message"><?php echo esc_html( $vars['client_secret_error'] ); ?></span>
|
52 |
<?php endif; ?>
|
53 |
<span class="sui-description">
|
54 |
+
<?php esc_html_e( 'Follow these instructions to retrieve your Client ID and Secret.', 'forminator' ); ?>
|
55 |
<ol class="instructions" id="clientid-instructions">
|
56 |
<li>
|
57 |
<?php
|
58 |
echo sprintf(/* translators: ... */
|
59 |
+
esc_html__( 'Go %1$shere%2$s to create new Slack App.', 'forminator' ),
|
60 |
'<a href="https://api.slack.com/apps?new_app=1" target="_blank">',
|
61 |
'</a>'
|
62 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
66 |
<?php
|
67 |
esc_html_e(
|
68 |
'You will need to enter App Name and Development Slack Workspace.',
|
69 |
+
'forminator'
|
70 |
);
|
71 |
?>
|
72 |
</li>
|
73 |
<li>
|
74 |
<?php
|
75 |
echo sprintf(/* translators: ... */
|
76 |
+
esc_html__( 'Once the Project creation is completed go to the %1$sBasic Information%2$s. Then scroll through %3$sApp Credentials%4$s, to take a note of %5$sClient ID%6$s and %7$sClient Secret%8$s.', 'forminator' ),
|
77 |
'<strong>',
|
78 |
'</strong>',
|
79 |
'<strong>',
|
88 |
<li>
|
89 |
<?php
|
90 |
echo sprintf(/* translators: ... */
|
91 |
+
esc_html__( 'Next, go to the %1$sFeatures%2$s > %3$sOAuth & Permissions%4$s > %5$sRedirect URLs%6$s section.', 'forminator' ),
|
92 |
'<strong>',
|
93 |
'</strong>',
|
94 |
'<strong>',
|
101 |
<li>
|
102 |
<?php
|
103 |
echo sprintf(/* translators: ... */
|
104 |
+
esc_html__( 'Click %1$sAdd a new Redirect URL%2$s.', 'forminator' ),
|
105 |
'<strong>',
|
106 |
'</strong>'
|
107 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
108 |
?>
|
109 |
</li>
|
110 |
<li>
|
111 |
+
<?php esc_html_e( 'In the shown input field, put this value below', 'forminator' ); ?>
|
112 |
<pre class="sui-code-snippet"><?php echo esc_html( ! empty( $vars['redirect_url'] ) ? $vars['redirect_url'] : '' ); ?></pre>.</li>
|
113 |
<li>
|
114 |
<?php
|
115 |
echo sprintf(/* translators: ... */
|
116 |
+
esc_html__( 'Then click the %1$sAdd%2$s button.', 'forminator' ),
|
117 |
'<strong>',
|
118 |
'</strong>'
|
119 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
122 |
<li>
|
123 |
<?php
|
124 |
echo sprintf(/* translators: ... */
|
125 |
+
esc_html__( 'Then click the %1$sSave URLs%2$s button.', 'forminator' ),
|
126 |
'<strong>',
|
127 |
'</strong>'
|
128 |
); //phpcs:ignore Standard.Category.SniffName.ErrorCode
|
addons/pro/slack/views/settings/success-authorize.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
6 |
?>
|
7 |
</h3>
|
8 |
-
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
9 |
</div>
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'Slack' ) );
|
6 |
?>
|
7 |
</h3>
|
8 |
+
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></p>
|
9 |
</div>
|
addons/pro/slack/views/settings/wait-authorize.php
CHANGED
@@ -14,7 +14,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
<p class="" aria-label="Loading content">
|
15 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
16 |
</p>
|
17 |
-
<p><?php esc_html_e( 'We are waiting for authorization from Slack...',
|
18 |
</div>
|
19 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button"><?php esc_html_e( 'RETRY',
|
20 |
|
14 |
<p class="" aria-label="Loading content">
|
15 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
16 |
</p>
|
17 |
+
<p><?php esc_html_e( 'We are waiting for authorization from Slack...', 'forminator' ); ?></p>
|
18 |
</div>
|
19 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button"><?php esc_html_e( 'RETRY', 'forminator' ); ?></a>
|
20 |
|
addons/pro/trello/class-forminator-addon-trello-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'Trello failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -300,7 +300,7 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
300 |
return array(
|
301 |
'is_sent' => true,
|
302 |
'connection_name' => $connection_settings['name'],
|
303 |
-
'description' => __( 'Successfully send data to Trello',
|
304 |
'data_sent' => $api->get_last_data_sent(),
|
305 |
'data_received' => $api->get_last_data_received(),
|
306 |
'url_request' => $api->get_last_url_request(),
|
@@ -362,7 +362,7 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
362 |
case 'postdata-post-content':
|
363 |
case 'postdata-post-excerpt':
|
364 |
case 'postdata-post-image':
|
365 |
-
$value_format = '[' . __( 'Edit Post',
|
366 |
break;
|
367 |
case 'url':
|
368 |
$value_format = '[{' . $element_id . '}]({' . $element_id . '})';
|
@@ -377,7 +377,7 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
377 |
|
378 |
if ( in_array( $field_type, $field_format, true ) ) {
|
379 |
|
380 |
-
$value_format = '[' . __( 'Edit Post',
|
381 |
}
|
382 |
|
383 |
$markdown .= self::get_field_markdown( $field_type, $field_label, $value_format );
|
@@ -519,29 +519,29 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
519 |
}
|
520 |
$status = $addon_meta_data['value'];
|
521 |
$additional_entry_item = array(
|
522 |
-
'label' => __( 'Trello Integration',
|
523 |
'value' => '',
|
524 |
);
|
525 |
|
526 |
$sub_entries = array();
|
527 |
if ( isset( $status['connection_name'] ) ) {
|
528 |
$sub_entries[] = array(
|
529 |
-
'label' => __( 'Integration Name',
|
530 |
'value' => $status['connection_name'],
|
531 |
);
|
532 |
}
|
533 |
|
534 |
if ( isset( $status['is_sent'] ) ) {
|
535 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
536 |
$sub_entries[] = array(
|
537 |
-
'label' => __( 'Sent To Trello',
|
538 |
'value' => $is_sent,
|
539 |
);
|
540 |
}
|
541 |
|
542 |
if ( isset( $status['description'] ) ) {
|
543 |
$sub_entries[] = array(
|
544 |
-
'label' => __( 'Info',
|
545 |
'value' => $status['description'],
|
546 |
);
|
547 |
}
|
@@ -550,21 +550,21 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
550 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_TRELLO_SHOW_FULL_LOG', true)`
|
551 |
if ( isset( $status['url_request'] ) ) {
|
552 |
$sub_entries[] = array(
|
553 |
-
'label' => __( 'API URL',
|
554 |
'value' => $status['url_request'],
|
555 |
);
|
556 |
}
|
557 |
|
558 |
if ( isset( $status['data_sent'] ) ) {
|
559 |
$sub_entries[] = array(
|
560 |
-
'label' => __( 'Data sent to Trello',
|
561 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
562 |
);
|
563 |
}
|
564 |
|
565 |
if ( isset( $status['data_received'] ) ) {
|
566 |
$sub_entries[] = array(
|
567 |
-
'label' => __( 'Data received from Trello',
|
568 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
569 |
);
|
570 |
}
|
@@ -586,7 +586,7 @@ class Forminator_Addon_Trello_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
586 |
public function on_export_render_title_row() {
|
587 |
|
588 |
$export_headers = array(
|
589 |
-
'info' => __( 'Trello Info',
|
590 |
);
|
591 |
|
592 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'Trello failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
300 |
return array(
|
301 |
'is_sent' => true,
|
302 |
'connection_name' => $connection_settings['name'],
|
303 |
+
'description' => __( 'Successfully send data to Trello', 'forminator' ),
|
304 |
'data_sent' => $api->get_last_data_sent(),
|
305 |
'data_received' => $api->get_last_data_received(),
|
306 |
'url_request' => $api->get_last_url_request(),
|
362 |
case 'postdata-post-content':
|
363 |
case 'postdata-post-excerpt':
|
364 |
case 'postdata-post-image':
|
365 |
+
$value_format = '[' . __( 'Edit Post', 'forminator' ) . ']({' . $post_element_id . '})';
|
366 |
break;
|
367 |
case 'url':
|
368 |
$value_format = '[{' . $element_id . '}]({' . $element_id . '})';
|
377 |
|
378 |
if ( in_array( $field_type, $field_format, true ) ) {
|
379 |
|
380 |
+
$value_format = '[' . __( 'Edit Post', 'forminator' ) . ']({' . $post_element_id . '})';
|
381 |
}
|
382 |
|
383 |
$markdown .= self::get_field_markdown( $field_type, $field_label, $value_format );
|
519 |
}
|
520 |
$status = $addon_meta_data['value'];
|
521 |
$additional_entry_item = array(
|
522 |
+
'label' => __( 'Trello Integration', 'forminator' ),
|
523 |
'value' => '',
|
524 |
);
|
525 |
|
526 |
$sub_entries = array();
|
527 |
if ( isset( $status['connection_name'] ) ) {
|
528 |
$sub_entries[] = array(
|
529 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
530 |
'value' => $status['connection_name'],
|
531 |
);
|
532 |
}
|
533 |
|
534 |
if ( isset( $status['is_sent'] ) ) {
|
535 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
536 |
$sub_entries[] = array(
|
537 |
+
'label' => __( 'Sent To Trello', 'forminator' ),
|
538 |
'value' => $is_sent,
|
539 |
);
|
540 |
}
|
541 |
|
542 |
if ( isset( $status['description'] ) ) {
|
543 |
$sub_entries[] = array(
|
544 |
+
'label' => __( 'Info', 'forminator' ),
|
545 |
'value' => $status['description'],
|
546 |
);
|
547 |
}
|
550 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_TRELLO_SHOW_FULL_LOG', true)`
|
551 |
if ( isset( $status['url_request'] ) ) {
|
552 |
$sub_entries[] = array(
|
553 |
+
'label' => __( 'API URL', 'forminator' ),
|
554 |
'value' => $status['url_request'],
|
555 |
);
|
556 |
}
|
557 |
|
558 |
if ( isset( $status['data_sent'] ) ) {
|
559 |
$sub_entries[] = array(
|
560 |
+
'label' => __( 'Data sent to Trello', 'forminator' ),
|
561 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
562 |
);
|
563 |
}
|
564 |
|
565 |
if ( isset( $status['data_received'] ) ) {
|
566 |
$sub_entries[] = array(
|
567 |
+
'label' => __( 'Data received from Trello', 'forminator' ),
|
568 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
569 |
);
|
570 |
}
|
586 |
public function on_export_render_title_row() {
|
587 |
|
588 |
$export_headers = array(
|
589 |
+
'info' => __( 'Trello Info', 'forminator' ),
|
590 |
);
|
591 |
|
592 |
$form_id = $this->form_id;
|
addons/pro/trello/class-forminator-addon-trello-form-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -117,14 +117,14 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
-
esc_html__( 'Deactivate',
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
-
esc_html__( 'Deactivate this Trello Integration from this Form.',
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
@@ -176,7 +176,7 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
176 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
-
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.',
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
@@ -250,14 +250,14 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
-
esc_html__( 'Deactivate',
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
-
esc_html__( 'Deactivate this Trello Integration from this Form.',
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
@@ -310,7 +310,7 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
310 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
@@ -347,7 +347,7 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
-
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.',
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
@@ -390,14 +390,14 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
-
esc_html__( 'Deactivate',
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
-
esc_html__( 'Deactivate this Trello Integration from this Form.',
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
@@ -450,15 +450,15 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
450 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
-
'top' => __( 'Top',
|
461 |
-
'bottom' => __( 'Bottom',
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
@@ -633,14 +633,14 @@ class Forminator_Addon_Trello_Form_Settings extends Forminator_Addon_Form_Settin
|
|
633 |
$buttons = array();
|
634 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
635 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
636 |
-
esc_html__( 'Deactivate',
|
637 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
638 |
-
esc_html__( 'Deactivate this Trello Integration from this Form.',
|
639 |
);
|
640 |
}
|
641 |
|
642 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
643 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
644 |
'</div>';
|
645 |
|
646 |
return array(
|
31 |
|
32 |
$this->_update_form_settings_error_message = __(
|
33 |
'The update to your settings for this form failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
+
esc_html__( 'Deactivate this Trello Integration from this Form.', 'forminator' )
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
176 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
+
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.', 'forminator' ) );
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
+
esc_html__( 'Deactivate this Trello Integration from this Form.', 'forminator' )
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
310 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
+
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.', 'forminator' ), $board_name ) );
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
+
esc_html__( 'Deactivate this Trello Integration from this Form.', 'forminator' )
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
450 |
$template = forminator_addon_trello_dir() . 'views/form-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
+
'top' => __( 'Top', 'forminator' ),
|
461 |
+
'bottom' => __( 'Bottom', 'forminator' ),
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
633 |
$buttons = array();
|
634 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
635 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
636 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
637 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
638 |
+
esc_html__( 'Deactivate this Trello Integration from this Form.', 'forminator' )
|
639 |
);
|
640 |
}
|
641 |
|
642 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
643 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
644 |
'</div>';
|
645 |
|
646 |
return array(
|
addons/pro/trello/class-forminator-addon-trello-poll-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Trello_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
41 |
parent::__construct( $addon, $poll_id );
|
42 |
-
$this->_submit_poll_error_message = __( 'Trello failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -305,7 +305,7 @@ class Forminator_Addon_Trello_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
305 |
return array(
|
306 |
'is_sent' => true,
|
307 |
'connection_name' => $connection_settings['name'],
|
308 |
-
'description' => __( 'Successfully send data to Trello',
|
309 |
'data_sent' => $api->get_last_data_sent(),
|
310 |
'data_received' => $api->get_last_data_received(),
|
311 |
'url_request' => $api->get_last_url_request(),
|
@@ -372,10 +372,10 @@ class Forminator_Addon_Trello_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
372 |
$answer = isset( $fields_labels[ $answer_data ] ) ? $fields_labels[ $answer_data ] : $answer_data;
|
373 |
$extra = $extra_field;
|
374 |
|
375 |
-
$markdown = '##' . __( 'Poll Answer',
|
376 |
-
$markdown .= '**' . __( 'Vote',
|
377 |
if ( ! empty( $extra ) ) {
|
378 |
-
$markdown .= "\n**" . __( 'Extra',
|
379 |
}
|
380 |
|
381 |
/**
|
@@ -427,7 +427,7 @@ class Forminator_Addon_Trello_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
427 |
|
428 |
$fields = $this->poll->get_fields();
|
429 |
|
430 |
-
$markdown = '##' . __( 'Poll Results',
|
431 |
if ( ! is_null( $fields ) ) {
|
432 |
foreach ( $fields as $field ) {
|
433 |
$label = addslashes( $field->title );
|
@@ -575,7 +575,7 @@ class Forminator_Addon_Trello_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
575 |
public function on_export_render_title_row() {
|
576 |
|
577 |
$export_headers = array(
|
578 |
-
'info' => __( 'Trello Info',
|
579 |
);
|
580 |
|
581 |
$poll_id = $this->poll_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
41 |
parent::__construct( $addon, $poll_id );
|
42 |
+
$this->_submit_poll_error_message = __( 'Trello failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
305 |
return array(
|
306 |
'is_sent' => true,
|
307 |
'connection_name' => $connection_settings['name'],
|
308 |
+
'description' => __( 'Successfully send data to Trello', 'forminator' ),
|
309 |
'data_sent' => $api->get_last_data_sent(),
|
310 |
'data_received' => $api->get_last_data_received(),
|
311 |
'url_request' => $api->get_last_url_request(),
|
372 |
$answer = isset( $fields_labels[ $answer_data ] ) ? $fields_labels[ $answer_data ] : $answer_data;
|
373 |
$extra = $extra_field;
|
374 |
|
375 |
+
$markdown = '##' . __( 'Poll Answer', 'forminator' ) . "\n";
|
376 |
+
$markdown .= '**' . __( 'Vote', 'forminator' ) . ':** ' . $answer;
|
377 |
if ( ! empty( $extra ) ) {
|
378 |
+
$markdown .= "\n**" . __( 'Extra', 'forminator' ) . ':** ' . $extra;
|
379 |
}
|
380 |
|
381 |
/**
|
427 |
|
428 |
$fields = $this->poll->get_fields();
|
429 |
|
430 |
+
$markdown = '##' . __( 'Poll Results', 'forminator' );
|
431 |
if ( ! is_null( $fields ) ) {
|
432 |
foreach ( $fields as $field ) {
|
433 |
$label = addslashes( $field->title );
|
575 |
public function on_export_render_title_row() {
|
576 |
|
577 |
$export_headers = array(
|
578 |
+
'info' => __( 'Trello Info', 'forminator' ),
|
579 |
);
|
580 |
|
581 |
$poll_id = $this->poll_id;
|
addons/pro/trello/class-forminator-addon-trello-poll-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
31 |
|
32 |
$this->_update_poll_settings_error_message = __(
|
33 |
'The update to your settings for this poll failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -117,14 +117,14 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
-
esc_html__( 'Deactivate',
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
-
esc_html__( 'Deactivate this Trello Integration from this Poll.',
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
@@ -176,7 +176,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
176 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
-
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.',
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
@@ -250,14 +250,14 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
-
esc_html__( 'Deactivate',
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
-
esc_html__( 'Deactivate this Trello Integration from this Poll.',
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
@@ -310,7 +310,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
310 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
@@ -347,7 +347,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
-
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.',
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
@@ -390,14 +390,14 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
-
esc_html__( 'Deactivate',
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
-
esc_html__( 'Deactivate this Trello Integration from this Poll.',
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
@@ -450,15 +450,15 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
450 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
-
'top' => __( 'Top',
|
461 |
-
'bottom' => __( 'Bottom',
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
@@ -485,7 +485,7 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
485 |
);
|
486 |
|
487 |
$var_list = array();
|
488 |
-
$var_list['poll_name'] = __( 'Poll Name',
|
489 |
$var_list = array_merge( $var_list, forminator_get_vars() );
|
490 |
unset( $var_list['custom_value'] );
|
491 |
|
@@ -640,14 +640,14 @@ class Forminator_Addon_Trello_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
640 |
$buttons = array();
|
641 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
642 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
643 |
-
esc_html__( 'Deactivate',
|
644 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
645 |
-
esc_html__( 'Deactivate this Trello Integration from this Poll.',
|
646 |
);
|
647 |
}
|
648 |
|
649 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
650 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
651 |
'</div>';
|
652 |
|
653 |
return array(
|
31 |
|
32 |
$this->_update_poll_settings_error_message = __(
|
33 |
'The update to your settings for this poll failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
+
esc_html__( 'Deactivate this Trello Integration from this Poll.', 'forminator' )
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
176 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
+
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.', 'forminator' ) );
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
+
esc_html__( 'Deactivate this Trello Integration from this Poll.', 'forminator' )
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
310 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
+
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.', 'forminator' ), $board_name ) );
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
+
esc_html__( 'Deactivate this Trello Integration from this Poll.', 'forminator' )
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
450 |
$template = forminator_addon_trello_dir() . 'views/poll-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
+
'top' => __( 'Top', 'forminator' ),
|
461 |
+
'bottom' => __( 'Bottom', 'forminator' ),
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
485 |
);
|
486 |
|
487 |
$var_list = array();
|
488 |
+
$var_list['poll_name'] = __( 'Poll Name', 'forminator' );
|
489 |
$var_list = array_merge( $var_list, forminator_get_vars() );
|
490 |
unset( $var_list['custom_value'] );
|
491 |
|
640 |
$buttons = array();
|
641 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
642 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
643 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
644 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
645 |
+
esc_html__( 'Deactivate this Trello Integration from this Poll.', 'forminator' )
|
646 |
);
|
647 |
}
|
648 |
|
649 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
650 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
651 |
'</div>';
|
652 |
|
653 |
return array(
|
addons/pro/trello/class-forminator-addon-trello-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'Trello failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -312,7 +312,7 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
312 |
return array(
|
313 |
'is_sent' => true,
|
314 |
'connection_name' => $connection_settings['name'],
|
315 |
-
'description' => __( 'Successfully send data to Trello',
|
316 |
'data_sent' => $api->get_last_data_sent(),
|
317 |
'data_received' => $api->get_last_data_received(),
|
318 |
'url_request' => $api->get_last_url_request(),
|
@@ -354,8 +354,8 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
354 |
|
355 |
$markdown .= '###' . $question . "\n";
|
356 |
$markdown .= $answer . "\n";
|
357 |
-
$markdown .= __( 'Correct : ',
|
358 |
-
. '**' . ( $is_correct ? __( 'Yes',
|
359 |
. "\n";
|
360 |
}
|
361 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
@@ -425,11 +425,11 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
425 |
$total_answers ++;
|
426 |
}
|
427 |
|
428 |
-
$markdown .= '##' . __( 'Quiz Result',
|
429 |
-
$markdown .= __( 'Correct Answers : ',
|
430 |
. '**' . $total_correct . '**'
|
431 |
. "\n";
|
432 |
-
$markdown .= __( 'Total Answers : ',
|
433 |
. '**' . $total_answers . '**'
|
434 |
. "\n";
|
435 |
|
@@ -442,7 +442,7 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
442 |
$quiz_entry = $quiz_entry['value'][0]['value'];
|
443 |
$nowrong_result = ( isset( $quiz_entry['result'] ) && isset( $quiz_entry['result']['title'] ) ) ? $quiz_entry['result']['title'] : '';
|
444 |
|
445 |
-
$markdown .= '##' . __( 'Quiz Result',
|
446 |
$markdown .= '**' . $nowrong_result . '**'
|
447 |
. "\n";
|
448 |
|
@@ -479,7 +479,7 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
479 |
public function on_export_render_title_row() {
|
480 |
|
481 |
$export_headers = array(
|
482 |
-
'info' => __( 'Trello Info',
|
483 |
);
|
484 |
|
485 |
$quiz_id = $this->quiz_id;
|
@@ -648,29 +648,29 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
648 |
}
|
649 |
$status = $addon_meta_data['value'];
|
650 |
$additional_entry_item = array(
|
651 |
-
'label' => __( 'Trello Integration',
|
652 |
'value' => '',
|
653 |
);
|
654 |
|
655 |
$sub_entries = array();
|
656 |
if ( isset( $status['connection_name'] ) ) {
|
657 |
$sub_entries[] = array(
|
658 |
-
'label' => __( 'Integration Name',
|
659 |
'value' => $status['connection_name'],
|
660 |
);
|
661 |
}
|
662 |
|
663 |
if ( isset( $status['is_sent'] ) ) {
|
664 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
665 |
$sub_entries[] = array(
|
666 |
-
'label' => __( 'Sent To Trello',
|
667 |
'value' => $is_sent,
|
668 |
);
|
669 |
}
|
670 |
|
671 |
if ( isset( $status['description'] ) ) {
|
672 |
$sub_entries[] = array(
|
673 |
-
'label' => __( 'Info',
|
674 |
'value' => $status['description'],
|
675 |
);
|
676 |
}
|
@@ -679,21 +679,21 @@ class Forminator_Addon_Trello_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
679 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_TRELLO_SHOW_FULL_LOG', true)`
|
680 |
if ( isset( $status['url_request'] ) ) {
|
681 |
$sub_entries[] = array(
|
682 |
-
'label' => __( 'API URL',
|
683 |
'value' => $status['url_request'],
|
684 |
);
|
685 |
}
|
686 |
|
687 |
if ( isset( $status['data_sent'] ) ) {
|
688 |
$sub_entries[] = array(
|
689 |
-
'label' => __( 'Data sent to Trello',
|
690 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
691 |
);
|
692 |
}
|
693 |
|
694 |
if ( isset( $status['data_received'] ) ) {
|
695 |
$sub_entries[] = array(
|
696 |
-
'label' => __( 'Data received from Trello',
|
697 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
698 |
);
|
699 |
}
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'Trello failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
312 |
return array(
|
313 |
'is_sent' => true,
|
314 |
'connection_name' => $connection_settings['name'],
|
315 |
+
'description' => __( 'Successfully send data to Trello', 'forminator' ),
|
316 |
'data_sent' => $api->get_last_data_sent(),
|
317 |
'data_received' => $api->get_last_data_received(),
|
318 |
'url_request' => $api->get_last_url_request(),
|
354 |
|
355 |
$markdown .= '###' . $question . "\n";
|
356 |
$markdown .= $answer . "\n";
|
357 |
+
$markdown .= __( 'Correct : ', 'forminator' )
|
358 |
+
. '**' . ( $is_correct ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' ) ) . '**'
|
359 |
. "\n";
|
360 |
}
|
361 |
} elseif ( 'nowrong' === $this->quiz->quiz_type ) {
|
425 |
$total_answers ++;
|
426 |
}
|
427 |
|
428 |
+
$markdown .= '##' . __( 'Quiz Result', 'forminator' ) . "\n";
|
429 |
+
$markdown .= __( 'Correct Answers : ', 'forminator' )
|
430 |
. '**' . $total_correct . '**'
|
431 |
. "\n";
|
432 |
+
$markdown .= __( 'Total Answers : ', 'forminator' )
|
433 |
. '**' . $total_answers . '**'
|
434 |
. "\n";
|
435 |
|
442 |
$quiz_entry = $quiz_entry['value'][0]['value'];
|
443 |
$nowrong_result = ( isset( $quiz_entry['result'] ) && isset( $quiz_entry['result']['title'] ) ) ? $quiz_entry['result']['title'] : '';
|
444 |
|
445 |
+
$markdown .= '##' . __( 'Quiz Result', 'forminator' ) . "\n";
|
446 |
$markdown .= '**' . $nowrong_result . '**'
|
447 |
. "\n";
|
448 |
|
479 |
public function on_export_render_title_row() {
|
480 |
|
481 |
$export_headers = array(
|
482 |
+
'info' => __( 'Trello Info', 'forminator' ),
|
483 |
);
|
484 |
|
485 |
$quiz_id = $this->quiz_id;
|
648 |
}
|
649 |
$status = $addon_meta_data['value'];
|
650 |
$additional_entry_item = array(
|
651 |
+
'label' => __( 'Trello Integration', 'forminator' ),
|
652 |
'value' => '',
|
653 |
);
|
654 |
|
655 |
$sub_entries = array();
|
656 |
if ( isset( $status['connection_name'] ) ) {
|
657 |
$sub_entries[] = array(
|
658 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
659 |
'value' => $status['connection_name'],
|
660 |
);
|
661 |
}
|
662 |
|
663 |
if ( isset( $status['is_sent'] ) ) {
|
664 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
665 |
$sub_entries[] = array(
|
666 |
+
'label' => __( 'Sent To Trello', 'forminator' ),
|
667 |
'value' => $is_sent,
|
668 |
);
|
669 |
}
|
670 |
|
671 |
if ( isset( $status['description'] ) ) {
|
672 |
$sub_entries[] = array(
|
673 |
+
'label' => __( 'Info', 'forminator' ),
|
674 |
'value' => $status['description'],
|
675 |
);
|
676 |
}
|
679 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_TRELLO_SHOW_FULL_LOG', true)`
|
680 |
if ( isset( $status['url_request'] ) ) {
|
681 |
$sub_entries[] = array(
|
682 |
+
'label' => __( 'API URL', 'forminator' ),
|
683 |
'value' => $status['url_request'],
|
684 |
);
|
685 |
}
|
686 |
|
687 |
if ( isset( $status['data_sent'] ) ) {
|
688 |
$sub_entries[] = array(
|
689 |
+
'label' => __( 'Data sent to Trello', 'forminator' ),
|
690 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
691 |
);
|
692 |
}
|
693 |
|
694 |
if ( isset( $status['data_received'] ) ) {
|
695 |
$sub_entries[] = array(
|
696 |
+
'label' => __( 'Data received from Trello', 'forminator' ),
|
697 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
698 |
);
|
699 |
}
|
addons/pro/trello/class-forminator-addon-trello-quiz-settings.php
CHANGED
@@ -31,7 +31,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
34 |
-
|
35 |
);
|
36 |
}
|
37 |
|
@@ -117,14 +117,14 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
-
esc_html__( 'Deactivate',
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
-
esc_html__( 'Deactivate this Trello Integration from this Quiz.',
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
@@ -176,7 +176,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
176 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
@@ -207,7 +207,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
-
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.',
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
@@ -250,14 +250,14 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
-
esc_html__( 'Deactivate',
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
-
esc_html__( 'Deactivate this Trello Integration from this Quiz.',
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
@@ -310,7 +310,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
310 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
@@ -347,7 +347,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
-
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.',
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
@@ -390,14 +390,14 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
-
esc_html__( 'Deactivate',
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
-
esc_html__( 'Deactivate this Trello Integration from this Quiz.',
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next',
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
@@ -450,15 +450,15 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
450 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
-
'top' => __( 'Top',
|
461 |
-
'bottom' => __( 'Bottom',
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
@@ -486,7 +486,7 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
486 |
);
|
487 |
|
488 |
$var_list = array();
|
489 |
-
$var_list['quiz_name'] = __( 'Quiz Name',
|
490 |
$var_list = array_merge( $var_list, forminator_get_vars() );
|
491 |
unset( $var_list['custom_value'] );
|
492 |
unset( $var_list['query'] );
|
@@ -646,14 +646,14 @@ class Forminator_Addon_Trello_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
646 |
$buttons = array();
|
647 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
648 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
649 |
-
esc_html__( 'Deactivate',
|
650 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
651 |
-
esc_html__( 'Deactivate this Trello Integration from this Quiz.',
|
652 |
);
|
653 |
}
|
654 |
|
655 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
656 |
-
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save',
|
657 |
'</div>';
|
658 |
|
659 |
return array(
|
31 |
|
32 |
$this->_update_quiz_settings_error_message = __(
|
33 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
34 |
+
'forminator'
|
35 |
);
|
36 |
}
|
37 |
|
117 |
$buttons = array();
|
118 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
119 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
120 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
121 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
122 |
+
esc_html__( 'Deactivate this Trello Integration from this Quiz.', 'forminator' )
|
123 |
);
|
124 |
}
|
125 |
|
126 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
127 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
128 |
'</div>';
|
129 |
|
130 |
return array(
|
176 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-board.php';
|
177 |
|
178 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
179 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
180 |
}
|
181 |
|
182 |
$multi_id = $submitted_data['multi_id'];
|
207 |
}
|
208 |
|
209 |
if ( empty( $boards ) ) {
|
210 |
+
throw new Forminator_Addon_Trello_Exception( __( 'No board found on your Trello account. Please create one.', 'forminator' ) );
|
211 |
}
|
212 |
|
213 |
$template_params['boards'] = $boards;
|
250 |
$buttons = array();
|
251 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
252 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
253 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
254 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
255 |
+
esc_html__( 'Deactivate this Trello Integration from this Quiz.', 'forminator' )
|
256 |
);
|
257 |
}
|
258 |
|
259 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
260 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
261 |
'</div>';
|
262 |
|
263 |
return array(
|
310 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-list.php';
|
311 |
|
312 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
313 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
314 |
}
|
315 |
|
316 |
$multi_id = $submitted_data['multi_id'];
|
347 |
|
348 |
if ( empty( $lists ) ) {
|
349 |
/* translators: ... */
|
350 |
+
throw new Forminator_Addon_Trello_Exception( sprintf( __( 'No list found on Trello Board of %1$s. Please create one.', 'forminator' ), $board_name ) );
|
351 |
}
|
352 |
|
353 |
$template_params['lists'] = $lists;
|
390 |
$buttons = array();
|
391 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
392 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
393 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
394 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
395 |
+
esc_html__( 'Deactivate this Trello Integration from this Quiz.', 'forminator' )
|
396 |
);
|
397 |
}
|
398 |
|
399 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
400 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) .
|
401 |
'</div>';
|
402 |
|
403 |
return array(
|
450 |
$template = forminator_addon_trello_dir() . 'views/quiz-settings/setup-card.php';
|
451 |
|
452 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
453 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
454 |
}
|
455 |
|
456 |
$multi_id = $submitted_data['multi_id'];
|
457 |
unset( $submitted_data['multi_id'] );
|
458 |
|
459 |
$positions = array(
|
460 |
+
'top' => __( 'Top', 'forminator' ),
|
461 |
+
'bottom' => __( 'Bottom', 'forminator' ),
|
462 |
);
|
463 |
|
464 |
//todo: validate this, step wizard back if needed
|
486 |
);
|
487 |
|
488 |
$var_list = array();
|
489 |
+
$var_list['quiz_name'] = __( 'Quiz Name', 'forminator' );
|
490 |
$var_list = array_merge( $var_list, forminator_get_vars() );
|
491 |
unset( $var_list['custom_value'] );
|
492 |
unset( $var_list['query'] );
|
646 |
$buttons = array();
|
647 |
if ( $this->setup_name_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
648 |
$buttons['disconnect']['markup'] = Forminator_Addon_Abstract::get_button_markup(
|
649 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
650 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
651 |
+
esc_html__( 'Deactivate this Trello Integration from this Quiz.', 'forminator' )
|
652 |
);
|
653 |
}
|
654 |
|
655 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
656 |
+
Forminator_Addon_Abstract::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
657 |
'</div>';
|
658 |
|
659 |
return array(
|
addons/pro/trello/class-forminator-addon-trello.php
CHANGED
@@ -69,13 +69,13 @@ final class Forminator_Addon_Trello extends Forminator_Addon_Abstract {
|
|
69 |
*/
|
70 |
public function __construct() {
|
71 |
// late init to allow translation
|
72 |
-
$this->_description = __( 'Get awesome by your form.',
|
73 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Trello Integration, don\'t hesitate to contact us',
|
74 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Trello Integration, please try again',
|
75 |
|
76 |
$this->_update_settings_error_message = __(
|
77 |
'Sorry, we failed to update settings, please check your form and try again',
|
78 |
-
|
79 |
);
|
80 |
|
81 |
$this->_icon = forminator_addon_trello_assets_url() . 'icons/trello.png';
|
@@ -109,7 +109,7 @@ final class Forminator_Addon_Trello extends Forminator_Addon_Abstract {
|
|
109 |
try {
|
110 |
// check if its active
|
111 |
if ( ! $this->is_active() ) {
|
112 |
-
throw new Forminator_Addon_Trello_Exception( __( 'Trello is not active',
|
113 |
}
|
114 |
|
115 |
$is_connected = false;
|
@@ -147,17 +147,17 @@ final class Forminator_Addon_Trello extends Forminator_Addon_Abstract {
|
|
147 |
try {
|
148 |
$form_settings_instance = null;
|
149 |
if ( ! $this->is_connected() ) {
|
150 |
-
throw new Forminator_Addon_Trello_Exception( __( ' Trello is not connected',
|
151 |
}
|
152 |
|
153 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
154 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Trello_Form_Settings ) {
|
155 |
-
throw new Forminator_Addon_Trello_Exception( __( 'Invalid Form Settings of Trello',
|
156 |
}
|
157 |
|
158 |
// Mark as active when there is at least one active connection
|
159 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
160 |
-
throw new Forminator_Addon_Trello_Exception( __( 'No active Trello connection found in this form',
|
161 |
}
|
162 |
|
163 |
$is_form_connected = true;
|
@@ -500,7 +500,7 @@ final class Forminator_Addon_Trello extends Forminator_Addon_Abstract {
|
|
500 |
'return_url' => $return_url,
|
501 |
'scope' => 'read,write,account',
|
502 |
'expiration' => 'never',
|
503 |
-
'name' => __( 'Forminator Pro',
|
504 |
'key' => $this->get_app_key(),
|
505 |
'response_type' => 'token',
|
506 |
);
|
@@ -538,7 +538,7 @@ final class Forminator_Addon_Trello extends Forminator_Addon_Abstract {
|
|
538 |
$me_request = $api->get_( 'members/me/' );
|
539 |
|
540 |
if ( ! isset( $me_request->id ) || empty( $me_request->id ) ) {
|
541 |
-
throw new Forminator_Addon_Trello_Exception( __( 'Failed to acquire user ID.',
|
542 |
}
|
543 |
|
544 |
if ( isset( $me_request->url ) ) {
|
69 |
*/
|
70 |
public function __construct() {
|
71 |
// late init to allow translation
|
72 |
+
$this->_description = __( 'Get awesome by your form.', 'forminator' );
|
73 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Trello Integration, don\'t hesitate to contact us', 'forminator' );
|
74 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Trello Integration, please try again', 'forminator' );
|
75 |
|
76 |
$this->_update_settings_error_message = __(
|
77 |
'Sorry, we failed to update settings, please check your form and try again',
|
78 |
+
'forminator'
|
79 |
);
|
80 |
|
81 |
$this->_icon = forminator_addon_trello_assets_url() . 'icons/trello.png';
|
109 |
try {
|
110 |
// check if its active
|
111 |
if ( ! $this->is_active() ) {
|
112 |
+
throw new Forminator_Addon_Trello_Exception( __( 'Trello is not active', 'forminator' ) );
|
113 |
}
|
114 |
|
115 |
$is_connected = false;
|
147 |
try {
|
148 |
$form_settings_instance = null;
|
149 |
if ( ! $this->is_connected() ) {
|
150 |
+
throw new Forminator_Addon_Trello_Exception( __( ' Trello is not connected', 'forminator' ) );
|
151 |
}
|
152 |
|
153 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
154 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Trello_Form_Settings ) {
|
155 |
+
throw new Forminator_Addon_Trello_Exception( __( 'Invalid Form Settings of Trello', 'forminator' ) );
|
156 |
}
|
157 |
|
158 |
// Mark as active when there is at least one active connection
|
159 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
160 |
+
throw new Forminator_Addon_Trello_Exception( __( 'No active Trello connection found in this form', 'forminator' ) );
|
161 |
}
|
162 |
|
163 |
$is_form_connected = true;
|
500 |
'return_url' => $return_url,
|
501 |
'scope' => 'read,write,account',
|
502 |
'expiration' => 'never',
|
503 |
+
'name' => __( 'Forminator Pro', 'forminator' ),
|
504 |
'key' => $this->get_app_key(),
|
505 |
'response_type' => 'token',
|
506 |
);
|
538 |
$me_request = $api->get_( 'members/me/' );
|
539 |
|
540 |
if ( ! isset( $me_request->id ) || empty( $me_request->id ) ) {
|
541 |
+
throw new Forminator_Addon_Trello_Exception( __( 'Failed to acquire user ID.', 'forminator' ) );
|
542 |
}
|
543 |
|
544 |
if ( isset( $me_request->url ) ) {
|
addons/pro/trello/lib/class-forminator-addon-trello-wp-api.php
CHANGED
@@ -66,11 +66,11 @@ class Forminator_Addon_Trello_Wp_Api {
|
|
66 |
public function __construct( $app_key, $token ) {
|
67 |
//prerequisites
|
68 |
if ( ! $app_key ) {
|
69 |
-
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'Missing required APP Key',
|
70 |
}
|
71 |
|
72 |
if ( ! $token ) {
|
73 |
-
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'Missing required Token',
|
74 |
}
|
75 |
|
76 |
$this->_app_key = $app_key;
|
@@ -182,7 +182,7 @@ class Forminator_Addon_Trello_Wp_Api {
|
|
182 |
if ( is_wp_error( $res ) || ! $res ) {
|
183 |
forminator_addon_maybe_log( __METHOD__, $res );
|
184 |
throw new Forminator_Addon_Trello_Wp_Api_Exception(
|
185 |
-
__( 'Failed to process request, make sure you authorized Trello and your server has internet connection.',
|
186 |
);
|
187 |
}
|
188 |
|
@@ -196,10 +196,10 @@ class Forminator_Addon_Trello_Wp_Api {
|
|
196 |
|
197 |
if ( 404 === $status_code ) {
|
198 |
/* translators: ... */
|
199 |
-
throw new Forminator_Addon_Trello_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
200 |
}
|
201 |
/* translators: ... */
|
202 |
-
throw new Forminator_Addon_Trello_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
203 |
}
|
204 |
}
|
205 |
|
@@ -408,13 +408,13 @@ class Forminator_Addon_Trello_Wp_Api {
|
|
408 |
*/
|
409 |
public function create_card( $args = array() ) {
|
410 |
$default_args = array(
|
411 |
-
'name' => __( 'Forminator Trello Card',
|
412 |
'pos' => 'bottom',
|
413 |
);
|
414 |
$args = array_merge( $default_args, $args );
|
415 |
|
416 |
if ( ! isset( $args['idList'] ) ) {
|
417 |
-
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'idList Required to create a Trello Card',
|
418 |
}
|
419 |
|
420 |
return $this->post_( 'cards', $args );
|
66 |
public function __construct( $app_key, $token ) {
|
67 |
//prerequisites
|
68 |
if ( ! $app_key ) {
|
69 |
+
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'Missing required APP Key', 'forminator' ) );
|
70 |
}
|
71 |
|
72 |
if ( ! $token ) {
|
73 |
+
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'Missing required Token', 'forminator' ) );
|
74 |
}
|
75 |
|
76 |
$this->_app_key = $app_key;
|
182 |
if ( is_wp_error( $res ) || ! $res ) {
|
183 |
forminator_addon_maybe_log( __METHOD__, $res );
|
184 |
throw new Forminator_Addon_Trello_Wp_Api_Exception(
|
185 |
+
__( 'Failed to process request, make sure you authorized Trello and your server has internet connection.', 'forminator' )
|
186 |
);
|
187 |
}
|
188 |
|
196 |
|
197 |
if ( 404 === $status_code ) {
|
198 |
/* translators: ... */
|
199 |
+
throw new Forminator_Addon_Trello_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
200 |
}
|
201 |
/* translators: ... */
|
202 |
+
throw new Forminator_Addon_Trello_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
203 |
}
|
204 |
}
|
205 |
|
408 |
*/
|
409 |
public function create_card( $args = array() ) {
|
410 |
$default_args = array(
|
411 |
+
'name' => __( 'Forminator Trello Card', 'forminator' ),
|
412 |
'pos' => 'bottom',
|
413 |
);
|
414 |
$args = array_merge( $default_args, $args );
|
415 |
|
416 |
if ( ! isset( $args['idList'] ) ) {
|
417 |
+
throw new Forminator_Addon_Trello_Wp_Api_Exception( __( 'idList Required to create a Trello Card', 'forminator' ) );
|
418 |
}
|
419 |
|
420 |
return $this->post_( 'cards', $args );
|
addons/pro/trello/views/form-settings/setup-board.php
CHANGED
@@ -14,17 +14,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board',
|
18 |
-
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label" for="trello-board-id"><?php esc_html_e( 'Board',
|
26 |
<select name="board_id" class="sui-select sui-form-control" id="trello-board-id">
|
27 |
-
<option><?php esc_html_e( 'Please select a board',
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label" for="trello-board-id"><?php esc_html_e( 'Board', 'forminator' ); ?></label>
|
26 |
<select name="board_id" class="sui-select sui-form-control" id="trello-board-id">
|
27 |
+
<option><?php esc_html_e( 'Please select a board', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/trello/views/form-settings/setup-card.php
CHANGED
@@ -27,9 +27,9 @@ $has_date = true;
|
|
27 |
|
28 |
<div class="integration-header">
|
29 |
|
30 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields',
|
31 |
|
32 |
-
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.',
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -45,14 +45,14 @@ $has_date = true;
|
|
45 |
|
46 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
47 |
|
48 |
-
<label class="sui-label"><?php esc_html_e( 'Card Name',
|
49 |
|
50 |
<div class="sui-insert-variables">
|
51 |
|
52 |
<input id="card_name"
|
53 |
class="sui-form-control"
|
54 |
name="card_name"
|
55 |
-
placeholder="<?php echo esc_attr( __( 'Card Name',
|
56 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
57 |
|
58 |
<select data-textarea-id="card_name"><?php foreach ( $vars['fields'] as $field ) : ?>
|
@@ -77,7 +77,7 @@ $has_date = true;
|
|
77 |
|
78 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
79 |
|
80 |
-
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description',
|
81 |
|
82 |
<div class="sui-insert-variables">
|
83 |
|
@@ -94,8 +94,8 @@ $has_date = true;
|
|
94 |
<?php endif; ?>
|
95 |
|
96 |
<span class="sui-description">
|
97 |
-
<?php esc_html_e( 'Markdown supported for card description. Find complete guide',
|
98 |
-
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here',
|
99 |
</span>
|
100 |
|
101 |
</div>
|
@@ -107,13 +107,13 @@ $has_date = true;
|
|
107 |
<div class="sui-row">
|
108 |
<div class="sui-col-md-6">
|
109 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
110 |
-
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date',
|
111 |
<div class="sui-insert-variables">
|
112 |
|
113 |
<input id="due_date"
|
114 |
class="sui-form-control"
|
115 |
name="due_date"
|
116 |
-
placeholder="<?php echo esc_attr( __( 'Select a due date',
|
117 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
118 |
|
119 |
<select data-textarea-id="due_date">
|
@@ -129,7 +129,7 @@ $has_date = true;
|
|
129 |
<?php }
|
130 |
endforeach;
|
131 |
if ( $has_date ) { ?>
|
132 |
-
<option value=""><?php echo esc_html__( 'You don\'t have a datepicker field in your form.',
|
133 |
<?php } ?>
|
134 |
</select>
|
135 |
|
@@ -143,7 +143,7 @@ $has_date = true;
|
|
143 |
</div>
|
144 |
<div class="sui-col-md-6">
|
145 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
146 |
-
<label class="sui-label" for="position"><?php esc_html_e( 'Card Position',
|
147 |
<select name="position" class="sui-select" id="position">
|
148 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
149 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
@@ -159,13 +159,13 @@ $has_date = true;
|
|
159 |
<div class="sui-row">
|
160 |
<div class="sui-col-md-12">
|
161 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
162 |
-
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels',
|
163 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
164 |
multiple="multiple"
|
165 |
data-reorder="1"
|
166 |
data-tags="false"
|
167 |
data-token-separators="[',']"
|
168 |
-
data-placeholder="<?php esc_html_e( 'Click here to add labels',
|
169 |
data-allow-clear="false">
|
170 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
171 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
@@ -199,7 +199,7 @@ $has_date = true;
|
|
199 |
<div class="sui-row">
|
200 |
<div class="sui-col-md-12">
|
201 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
202 |
-
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members',
|
203 |
<select class="sui-select fui-multi-select"
|
204 |
name="member_ids[]"
|
205 |
id="member_ids"
|
@@ -207,7 +207,7 @@ $has_date = true;
|
|
207 |
data-reorder="1"
|
208 |
data-tags="false"
|
209 |
data-token-separators="[',']"
|
210 |
-
data-placeholder="<?php esc_html_e( 'Click here to add members',
|
211 |
data-allow-clear="false">
|
212 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
213 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
27 |
|
28 |
<div class="integration-header">
|
29 |
|
30 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields', 'forminator' ) ); ?></h3>
|
31 |
|
32 |
+
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.', 'forminator' ); ?></p>
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
45 |
|
46 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
47 |
|
48 |
+
<label class="sui-label"><?php esc_html_e( 'Card Name', 'forminator' ); ?></label>
|
49 |
|
50 |
<div class="sui-insert-variables">
|
51 |
|
52 |
<input id="card_name"
|
53 |
class="sui-form-control"
|
54 |
name="card_name"
|
55 |
+
placeholder="<?php echo esc_attr( __( 'Card Name', 'forminator' ) ); ?>"
|
56 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
57 |
|
58 |
<select data-textarea-id="card_name"><?php foreach ( $vars['fields'] as $field ) : ?>
|
77 |
|
78 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
79 |
|
80 |
+
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description', 'forminator' ); ?></label>
|
81 |
|
82 |
<div class="sui-insert-variables">
|
83 |
|
94 |
<?php endif; ?>
|
95 |
|
96 |
<span class="sui-description">
|
97 |
+
<?php esc_html_e( 'Markdown supported for card description. Find complete guide', 'forminator' ); ?>
|
98 |
+
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here', 'forminator' ); ?></a>.
|
99 |
</span>
|
100 |
|
101 |
</div>
|
107 |
<div class="sui-row">
|
108 |
<div class="sui-col-md-6">
|
109 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
110 |
+
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date', 'forminator' ); ?></label>
|
111 |
<div class="sui-insert-variables">
|
112 |
|
113 |
<input id="due_date"
|
114 |
class="sui-form-control"
|
115 |
name="due_date"
|
116 |
+
placeholder="<?php echo esc_attr( __( 'Select a due date', 'forminator' ) ); ?>"
|
117 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
118 |
|
119 |
<select data-textarea-id="due_date">
|
129 |
<?php }
|
130 |
endforeach;
|
131 |
if ( $has_date ) { ?>
|
132 |
+
<option value=""><?php echo esc_html__( 'You don\'t have a datepicker field in your form.', 'forminator' ); ?></option>
|
133 |
<?php } ?>
|
134 |
</select>
|
135 |
|
143 |
</div>
|
144 |
<div class="sui-col-md-6">
|
145 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
146 |
+
<label class="sui-label" for="position"><?php esc_html_e( 'Card Position', 'forminator' ); ?></label>
|
147 |
<select name="position" class="sui-select" id="position">
|
148 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
149 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
159 |
<div class="sui-row">
|
160 |
<div class="sui-col-md-12">
|
161 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
162 |
+
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels', 'forminator' ); ?></label>
|
163 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
164 |
multiple="multiple"
|
165 |
data-reorder="1"
|
166 |
data-tags="false"
|
167 |
data-token-separators="[',']"
|
168 |
+
data-placeholder="<?php esc_html_e( 'Click here to add labels', 'forminator' ); ?>"
|
169 |
data-allow-clear="false">
|
170 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
171 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
199 |
<div class="sui-row">
|
200 |
<div class="sui-col-md-12">
|
201 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
202 |
+
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members', 'forminator' ); ?></label>
|
203 |
<select class="sui-select fui-multi-select"
|
204 |
name="member_ids[]"
|
205 |
id="member_ids"
|
207 |
data-reorder="1"
|
208 |
data-tags="false"
|
209 |
data-token-separators="[',']"
|
210 |
+
data-placeholder="<?php esc_html_e( 'Click here to add members', 'forminator' ); ?>"
|
211 |
data-allow-clear="false">
|
212 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
213 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
addons/pro/trello/views/form-settings/setup-list.php
CHANGED
@@ -17,13 +17,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
-
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?',
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List',
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -31,9 +31,9 @@ $vars['step_description'] = sprintf(
|
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
-
<label class="sui-label" for="trello-list-id"><?php esc_html_e( 'List',
|
35 |
<select name="list_id" class="sui-select sui-form-control" id="trello-list-id">
|
36 |
-
<option><?php esc_html_e( 'Please select a list',
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
+
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?', 'forminator' ),
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List', 'forminator' ) ); ?></h3>
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
+
<label class="sui-label" for="trello-list-id"><?php esc_html_e( 'List', 'forminator' ); ?></label>
|
35 |
<select name="list_id" class="sui-select sui-form-control" id="trello-list-id">
|
36 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
addons/pro/trello/views/form-settings/setup-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/trello/views/poll-settings/setup-board.php
CHANGED
@@ -14,17 +14,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board',
|
18 |
-
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label"><?php esc_html_e( 'Board',
|
26 |
<select name="board_id" class="sui-select sui-form-control">
|
27 |
-
<option><?php esc_html_e( 'Please select a board',
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label"><?php esc_html_e( 'Board', 'forminator' ); ?>
|
26 |
<select name="board_id" class="sui-select sui-form-control">
|
27 |
+
<option><?php esc_html_e( 'Please select a board', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/trello/views/poll-settings/setup-card.php
CHANGED
@@ -27,9 +27,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
27 |
|
28 |
<div class="integration-header">
|
29 |
|
30 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields',
|
31 |
|
32 |
-
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.',
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -45,14 +45,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
45 |
|
46 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
47 |
|
48 |
-
<label class="sui-label"><?php esc_html_e( 'Card Name',
|
49 |
|
50 |
<div class="sui-insert-variables">
|
51 |
|
52 |
<input id="card_name"
|
53 |
class="sui-form-control"
|
54 |
name="card_name"
|
55 |
-
placeholder="<?php echo esc_attr( __( 'Card Name',
|
56 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
57 |
|
58 |
<select data-textarea-id="card_name"><?php foreach ( $vars['name_fields'] as $key => $field ) : ?>
|
@@ -77,7 +77,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
77 |
|
78 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
79 |
|
80 |
-
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description',
|
81 |
|
82 |
<div class="sui-insert-variables">
|
83 |
|
@@ -94,8 +94,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
94 |
<?php endif; ?>
|
95 |
|
96 |
<span class="sui-description">
|
97 |
-
<?php esc_html_e( 'Markdown supported for card description. Find complete guide',
|
98 |
-
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here',
|
99 |
</span>
|
100 |
|
101 |
</div>
|
@@ -107,11 +107,11 @@ foreach ( $template_vars as $key => $val ) {
|
|
107 |
<div class="sui-row">
|
108 |
<div class="sui-col-md-6">
|
109 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
110 |
-
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date',
|
111 |
<input id="due_date"
|
112 |
class="sui-form-control"
|
113 |
name="due_date"
|
114 |
-
placeholder="<?php echo esc_attr( __( 'Select a due date',
|
115 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
116 |
|
117 |
<?php if ( ! empty( $vars['due_date_error'] ) ) : ?>
|
@@ -122,7 +122,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
122 |
</div>
|
123 |
<div class="sui-col-md-6">
|
124 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
125 |
-
<label class="sui-label" for="position"><?php esc_html_e( 'Position',
|
126 |
<select name="position" id="position">
|
127 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
128 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
@@ -139,13 +139,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
139 |
<div class="sui-row">
|
140 |
<div class="sui-col-md-12">
|
141 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
142 |
-
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels',
|
143 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
144 |
multiple="multiple"
|
145 |
data-reorder="1"
|
146 |
data-tags="false"
|
147 |
data-token-separators="[',']"
|
148 |
-
data-placeholder="<?php esc_html_e( 'Enter label name',
|
149 |
data-allow-clear="false">
|
150 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
151 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
@@ -178,13 +178,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
178 |
<div class="sui-row">
|
179 |
<div class="sui-col-md-12">
|
180 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
181 |
-
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members',
|
182 |
<select class="sui-select fui-multi-select" name="member_ids[]" id="member_ids"
|
183 |
multiple="multiple"
|
184 |
data-reorder="1"
|
185 |
data-tags="false"
|
186 |
data-token-separators="[',']"
|
187 |
-
data-placeholder="<?php esc_html_e( 'Enter member name',
|
188 |
data-allow-clear="false">
|
189 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
190 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
27 |
|
28 |
<div class="integration-header">
|
29 |
|
30 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields', 'forminator' ) ); ?></h3>
|
31 |
|
32 |
+
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.', 'forminator' ); ?></p>
|
33 |
|
34 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
35 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
45 |
|
46 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
47 |
|
48 |
+
<label class="sui-label"><?php esc_html_e( 'Card Name', 'forminator' ); ?></label>
|
49 |
|
50 |
<div class="sui-insert-variables">
|
51 |
|
52 |
<input id="card_name"
|
53 |
class="sui-form-control"
|
54 |
name="card_name"
|
55 |
+
placeholder="<?php echo esc_attr( __( 'Card Name', 'forminator' ) ); ?>"
|
56 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
57 |
|
58 |
<select data-textarea-id="card_name"><?php foreach ( $vars['name_fields'] as $key => $field ) : ?>
|
77 |
|
78 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
79 |
|
80 |
+
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description', 'forminator' ); ?></label>
|
81 |
|
82 |
<div class="sui-insert-variables">
|
83 |
|
94 |
<?php endif; ?>
|
95 |
|
96 |
<span class="sui-description">
|
97 |
+
<?php esc_html_e( 'Markdown supported for card description. Find complete guide', 'forminator' ); ?>
|
98 |
+
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here', 'forminator' ); ?></a>.
|
99 |
</span>
|
100 |
|
101 |
</div>
|
107 |
<div class="sui-row">
|
108 |
<div class="sui-col-md-6">
|
109 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
110 |
+
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date', 'forminator' ); ?></label>
|
111 |
<input id="due_date"
|
112 |
class="sui-form-control"
|
113 |
name="due_date"
|
114 |
+
placeholder="<?php echo esc_attr( __( 'Select a due date', 'forminator' ) ); ?>"
|
115 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
116 |
|
117 |
<?php if ( ! empty( $vars['due_date_error'] ) ) : ?>
|
122 |
</div>
|
123 |
<div class="sui-col-md-6">
|
124 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
125 |
+
<label class="sui-label" for="position"><?php esc_html_e( 'Position', 'forminator' ); ?></label>
|
126 |
<select name="position" id="position">
|
127 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
128 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
139 |
<div class="sui-row">
|
140 |
<div class="sui-col-md-12">
|
141 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
142 |
+
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels', 'forminator' ); ?></label>
|
143 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
144 |
multiple="multiple"
|
145 |
data-reorder="1"
|
146 |
data-tags="false"
|
147 |
data-token-separators="[',']"
|
148 |
+
data-placeholder="<?php esc_html_e( 'Enter label name', 'forminator' ); ?>"
|
149 |
data-allow-clear="false">
|
150 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
151 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
178 |
<div class="sui-row">
|
179 |
<div class="sui-col-md-12">
|
180 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
181 |
+
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members', 'forminator' ); ?></label>
|
182 |
<select class="sui-select fui-multi-select" name="member_ids[]" id="member_ids"
|
183 |
multiple="multiple"
|
184 |
data-reorder="1"
|
185 |
data-tags="false"
|
186 |
data-token-separators="[',']"
|
187 |
+
data-placeholder="<?php esc_html_e( 'Enter member name', 'forminator' ); ?>"
|
188 |
data-allow-clear="false">
|
189 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
190 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
addons/pro/trello/views/poll-settings/setup-list.php
CHANGED
@@ -17,13 +17,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
-
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?',
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List',
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -31,9 +31,9 @@ $vars['step_description'] = sprintf(
|
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
-
<label class="sui-label"><?php esc_html_e( 'List',
|
35 |
<select name="list_id" class="sui-select sui-form-control">
|
36 |
-
<option><?php esc_html_e( 'Please select a list',
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
+
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?', 'forminator' ),
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List', 'forminator' ) ); ?></h3>
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
+
<label class="sui-label"><?php esc_html_e( 'List', 'forminator' ); ?>
|
35 |
<select name="list_id" class="sui-select sui-form-control">
|
36 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
addons/pro/trello/views/poll-settings/setup-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/trello/views/quiz-settings/setup-board.php
CHANGED
@@ -14,17 +14,17 @@ foreach ( $template_vars as $key => $val ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board',
|
18 |
-
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.',
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
-
<label class="sui-label"><?php esc_html_e( 'Board',
|
26 |
<select name="board_id" class="sui-select sui-form-control">
|
27 |
-
<option><?php esc_html_e( 'Please select a board',
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
14 |
|
15 |
?>
|
16 |
<div class="integration-header">
|
17 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign Board', 'forminator' ) ); ?></h3>
|
18 |
+
<p><?php esc_html_e( 'Your account is now authorized, choose which board you want Trello cards to be added to.', 'forminator' ); ?></p>
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
20 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
21 |
<?php endif; ?>
|
22 |
</div>
|
23 |
<form>
|
24 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['board_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
25 |
+
<label class="sui-label"><?php esc_html_e( 'Board', 'forminator' ); ?>
|
26 |
<select name="board_id" class="sui-select sui-form-control">
|
27 |
+
<option><?php esc_html_e( 'Please select a board', 'forminator' ); ?></option>
|
28 |
<?php foreach ( $vars['boards'] as $board_id => $board_name ) : ?>
|
29 |
<option value="<?php echo esc_attr( $board_id ); ?>" <?php selected( $vars['board_id'], $board_id ); ?>><?php echo esc_html( $board_name ); ?></option>
|
30 |
<?php endforeach; ?>
|
addons/pro/trello/views/quiz-settings/setup-card.php
CHANGED
@@ -28,9 +28,9 @@ foreach ( $template_vars as $key => $val ) {
|
|
28 |
|
29 |
<div class="integration-header">
|
30 |
|
31 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields',
|
32 |
|
33 |
-
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.',
|
34 |
|
35 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
36 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -46,14 +46,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
46 |
|
47 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
48 |
|
49 |
-
<label class="sui-label"><?php esc_html_e( 'Card Name',
|
50 |
|
51 |
<div class="sui-insert-variables">
|
52 |
|
53 |
<input id="card_name"
|
54 |
class="sui-form-control"
|
55 |
name="card_name"
|
56 |
-
placeholder="<?php echo esc_attr( __( 'Card Name',
|
57 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
58 |
|
59 |
<select data-textarea-id="card_name"><?php foreach ( $vars['name_fields'] as $key => $field ) : ?>
|
@@ -84,7 +84,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
84 |
|
85 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
86 |
|
87 |
-
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description',
|
88 |
|
89 |
<div class="sui-insert-variables">
|
90 |
|
@@ -107,8 +107,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
107 |
<?php endif; ?>
|
108 |
|
109 |
<span class="sui-description">
|
110 |
-
<?php esc_html_e( 'Markdown supported for card description. Find complete guide',
|
111 |
-
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here',
|
112 |
</span>
|
113 |
|
114 |
</div>
|
@@ -120,11 +120,11 @@ foreach ( $template_vars as $key => $val ) {
|
|
120 |
<div class="sui-row">
|
121 |
<div class="sui-col-md-6">
|
122 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
123 |
-
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date',
|
124 |
<input id="due_date"
|
125 |
class="sui-form-control"
|
126 |
name="due_date"
|
127 |
-
placeholder="<?php echo esc_attr( __( 'Select a due date',
|
128 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
129 |
|
130 |
<?php if ( ! empty( $vars['due_date_error'] ) ) : ?>
|
@@ -135,7 +135,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
135 |
</div>
|
136 |
<div class="sui-col-md-6">
|
137 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
138 |
-
<label class="sui-label" for="position"><?php esc_html_e( 'Position',
|
139 |
<select name="position" id="position">
|
140 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
141 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
@@ -152,13 +152,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
152 |
<div class="sui-row">
|
153 |
<div class="sui-col-md-12">
|
154 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
155 |
-
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels',
|
156 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
157 |
multiple="multiple"
|
158 |
data-reorder="1"
|
159 |
data-tags="false"
|
160 |
data-token-separators="[',']"
|
161 |
-
data-placeholder="<?php esc_html_e( 'Enter label name',
|
162 |
data-allow-clear="false">
|
163 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
164 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
@@ -190,13 +190,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
190 |
<div class="sui-row">
|
191 |
<div class="sui-col-md-12">
|
192 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
193 |
-
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members',
|
194 |
<select class="sui-select fui-multi-select" name="member_ids[]" id="member_ids"
|
195 |
multiple="multiple"
|
196 |
data-reorder="1"
|
197 |
data-tags="false"
|
198 |
data-token-separators="[',']"
|
199 |
-
data-placeholder="<?php esc_html_e( 'Enter member name',
|
200 |
data-allow-clear="false">
|
201 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
202 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
28 |
|
29 |
<div class="integration-header">
|
30 |
|
31 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Customize Fields', 'forminator' ) ); ?></h3>
|
32 |
|
33 |
+
<p><?php esc_html_e( 'Set up how you want your cards to be created in Trello.', 'forminator' ); ?></p>
|
34 |
|
35 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
36 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
46 |
|
47 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
48 |
|
49 |
+
<label class="sui-label"><?php esc_html_e( 'Card Name', 'forminator' ); ?></label>
|
50 |
|
51 |
<div class="sui-insert-variables">
|
52 |
|
53 |
<input id="card_name"
|
54 |
class="sui-form-control"
|
55 |
name="card_name"
|
56 |
+
placeholder="<?php echo esc_attr( __( 'Card Name', 'forminator' ) ); ?>"
|
57 |
value="<?php echo esc_attr( $vars['card_name'] ); ?>">
|
58 |
|
59 |
<select data-textarea-id="card_name"><?php foreach ( $vars['name_fields'] as $key => $field ) : ?>
|
84 |
|
85 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['card_description_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
86 |
|
87 |
+
<label class="sui-label" for="card_description"><?php esc_html_e( 'Card Description', 'forminator' ); ?></label>
|
88 |
|
89 |
<div class="sui-insert-variables">
|
90 |
|
107 |
<?php endif; ?>
|
108 |
|
109 |
<span class="sui-description">
|
110 |
+
<?php esc_html_e( 'Markdown supported for card description. Find complete guide', 'forminator' ); ?>
|
111 |
+
<a href="https://help.trello.com/article/821-using-markdown-in-trello" target="_blank"><?php esc_html_e( 'here', 'forminator' ); ?></a>.
|
112 |
</span>
|
113 |
|
114 |
</div>
|
120 |
<div class="sui-row">
|
121 |
<div class="sui-col-md-6">
|
122 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['due_date_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
123 |
+
<label class="sui-label" for="due_date"><?php esc_html_e( 'Due Date', 'forminator' ); ?></label>
|
124 |
<input id="due_date"
|
125 |
class="sui-form-control"
|
126 |
name="due_date"
|
127 |
+
placeholder="<?php echo esc_attr( __( 'Select a due date', 'forminator' ) ); ?>"
|
128 |
value="<?php echo esc_attr( $vars['due_date'] ); ?>">
|
129 |
|
130 |
<?php if ( ! empty( $vars['due_date_error'] ) ) : ?>
|
135 |
</div>
|
136 |
<div class="sui-col-md-6">
|
137 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['position_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
138 |
+
<label class="sui-label" for="position"><?php esc_html_e( 'Position', 'forminator' ); ?></label>
|
139 |
<select name="position" id="position">
|
140 |
<?php foreach ( $vars['positions'] as $pos_id => $pos_name ) : ?>
|
141 |
<option value="<?php echo esc_attr( $pos_id ); ?>" <?php selected( $vars['position'], $pos_id ); ?>><?php echo esc_html( $pos_name ); ?></option>
|
152 |
<div class="sui-row">
|
153 |
<div class="sui-col-md-12">
|
154 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['label_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
155 |
+
<label class="sui-label" for="label_ids"><?php esc_html_e( 'Labels', 'forminator' ); ?></label>
|
156 |
<select class="sui-select fui-multi-select" name="label_ids[]" id="label_ids"
|
157 |
multiple="multiple"
|
158 |
data-reorder="1"
|
159 |
data-tags="false"
|
160 |
data-token-separators="[',']"
|
161 |
+
data-placeholder="<?php esc_html_e( 'Enter label name', 'forminator' ); ?>"
|
162 |
data-allow-clear="false">
|
163 |
<?php foreach ( $vars['label_ids'] as $label_id ) : ?>
|
164 |
<?php if ( isset( $vars['labels'][ $label_id ] ) ) : ?>
|
190 |
<div class="sui-row">
|
191 |
<div class="sui-col-md-12">
|
192 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['member_ids_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
193 |
+
<label class="sui-label" for="member_ids"><?php esc_html_e( 'Members', 'forminator' ); ?></label>
|
194 |
<select class="sui-select fui-multi-select" name="member_ids[]" id="member_ids"
|
195 |
multiple="multiple"
|
196 |
data-reorder="1"
|
197 |
data-tags="false"
|
198 |
data-token-separators="[',']"
|
199 |
+
data-placeholder="<?php esc_html_e( 'Enter member name', 'forminator' ); ?>"
|
200 |
data-allow-clear="false">
|
201 |
<?php foreach ( $vars['member_ids'] as $member_id ) : ?>
|
202 |
<?php if ( isset( $vars['members'][ $member_id ] ) ) : ?>
|
addons/pro/trello/views/quiz-settings/setup-list.php
CHANGED
@@ -17,13 +17,13 @@ foreach ( $template_vars as $key => $val ) {
|
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
-
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?',
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List',
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
@@ -31,9 +31,9 @@ $vars['step_description'] = sprintf(
|
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
-
<label class="sui-label"><?php esc_html_e( 'List',
|
35 |
<select name="list_id" class="sui-select sui-form-control">
|
36 |
-
<option><?php esc_html_e( 'Please select a list',
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
17 |
|
18 |
$vars['step_description'] = sprintf(
|
19 |
/* translators: ... */
|
20 |
+
esc_html__( 'Which list from %1$s do you want auto-generated cards to be added to?', 'forminator' ),
|
21 |
'<b>' . $vars['board_name'] . '</b>'
|
22 |
);
|
23 |
|
24 |
?>
|
25 |
<div class="integration-header">
|
26 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Assign List', 'forminator' ) ); ?></h3>
|
27 |
<p><?php echo $vars['step_description']; // phpcs:ignore ?></p>
|
28 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
29 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
31 |
</div>
|
32 |
<form>
|
33 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['list_id_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
34 |
+
<label class="sui-label"><?php esc_html_e( 'List', 'forminator' ); ?>
|
35 |
<select name="list_id" class="sui-select sui-form-control">
|
36 |
+
<option><?php esc_html_e( 'Please select a list', 'forminator' ); ?></option>
|
37 |
<?php foreach ( $vars['lists'] as $list_id => $list_name ) : ?>
|
38 |
<option value="<?php echo esc_attr( $list_id ); ?>" <?php selected( $vars['list_id'], $list_id ); ?>><?php echo esc_html( $list_name ); ?></option>
|
39 |
<?php endforeach; ?>
|
addons/pro/trello/views/quiz-settings/setup-name.php
CHANGED
@@ -13,18 +13,18 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name',
|
17 |
-
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.',
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
-
<label class="sui-label"><?php esc_html_e( 'Name',
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
-
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name',
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
13 |
|
14 |
?>
|
15 |
<div class="integration-header">
|
16 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php echo esc_html( __( 'Setup Name', 'forminator' ) ); ?></h3>
|
17 |
+
<p><?php esc_html_e( 'Setup friendly name for this integration, so it will be easily identified by you.', 'forminator' ); ?></p>
|
18 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
19 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
20 |
<?php endif; ?>
|
21 |
</div>
|
22 |
<form>
|
23 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
24 |
+
<label class="sui-label"><?php esc_html_e( 'Name', 'forminator' ); ?></label>
|
25 |
<input
|
26 |
class="sui-form-control"
|
27 |
+
name="name" placeholder="<?php echo esc_attr( __( 'Friendly Name', 'forminator' ) ); ?>"
|
28 |
value="<?php echo esc_attr( $vars['name'] ); ?>">
|
29 |
<?php if ( ! empty( $vars['name_error'] ) ) : ?>
|
30 |
<span class="sui-error-message"><?php echo esc_html( $vars['name_error'] ); ?></span>
|
addons/pro/trello/views/sections/authorize.php
CHANGED
@@ -13,7 +13,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Trello',
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
@@ -24,14 +24,14 @@ foreach ( $template_vars as $key => $val ) {
|
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized Trello, you can go back to integration settings.',
|
27 |
-
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice-loading">
|
34 |
-
<p><?php esc_html_e( 'Please Wait...',
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
13 |
<div id="forminator-integrations" class="wpmudev-settings--box">
|
14 |
<div class="sui-box">
|
15 |
<div class="sui-box-header">
|
16 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'Authorizing Trello', 'forminator' ); ?></h2>
|
17 |
</div>
|
18 |
<div class="sui-box-body">
|
19 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
24 |
<?php
|
25 |
esc_html_e(
|
26 |
'Successfully authorized Trello, you can go back to integration settings.',
|
27 |
+
'forminator'
|
28 |
);
|
29 |
?>
|
30 |
</p>
|
31 |
</span>
|
32 |
<?php else : ?>
|
33 |
<span class="sui-notice sui-notice-loading">
|
34 |
+
<p><?php esc_html_e( 'Please Wait...', 'forminator' ); ?></p>
|
35 |
</span>
|
36 |
<?php endif; ?>
|
37 |
</div>
|
addons/pro/trello/views/settings/authorize.php
CHANGED
@@ -15,19 +15,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
<h3 class="sui-box-title" id="dialogTitle2">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
-
echo esc_html( sprintf( __( 'Connect %1$s',
|
19 |
?>
|
20 |
</h3>
|
21 |
<?php if ( ! empty( $vars['connected_account'] ) ) : ?>
|
22 |
-
<p><?php esc_html_e( 'Your Trello account is now authorized',
|
23 |
<strong><?php echo esc_html( $vars['connected_account']['email'] ); ?></strong>
|
24 |
<?php else : ?>
|
25 |
-
<p><?php esc_html_e( 'Authorize Forminator to connect with your Trello account in order to send data from your forms.',
|
26 |
<?php endif ?>
|
27 |
</div>
|
28 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
29 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'AUTHORIZE',
|
30 |
<?php endif ?>
|
31 |
<?php if ( $vars['is_connected'] ) : ?>
|
32 |
-
<button class="sui-button sui-button-ghost forminator-addon-disconnect"><?php esc_html_e( 'DISCONNECT',
|
33 |
<?php endif ?>
|
15 |
<h3 class="sui-box-title" id="dialogTitle2">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
+
echo esc_html( sprintf( __( 'Connect %1$s', 'forminator' ), 'Trello' ) );
|
19 |
?>
|
20 |
</h3>
|
21 |
<?php if ( ! empty( $vars['connected_account'] ) ) : ?>
|
22 |
+
<p><?php esc_html_e( 'Your Trello account is now authorized', 'forminator' ); ?> </p>
|
23 |
<strong><?php echo esc_html( $vars['connected_account']['email'] ); ?></strong>
|
24 |
<?php else : ?>
|
25 |
+
<p><?php esc_html_e( 'Authorize Forminator to connect with your Trello account in order to send data from your forms.', 'forminator' ); ?></p>
|
26 |
<?php endif ?>
|
27 |
</div>
|
28 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
29 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button sui-button-primary forminator-addon-connect"><?php esc_html_e( 'AUTHORIZE', 'forminator' ); ?></a>
|
30 |
<?php endif ?>
|
31 |
<?php if ( $vars['is_connected'] ) : ?>
|
32 |
+
<button class="sui-button sui-button-ghost forminator-addon-disconnect"><?php esc_html_e( 'DISCONNECT', 'forminator' ); ?></button>
|
33 |
<?php endif ?>
|
addons/pro/trello/views/settings/success-authorize.php
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
6 |
?>
|
7 |
</h3>
|
8 |
-
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
9 |
</div>
|
10 |
-
<button class="sui-button forminator-addon-close"><?php esc_html_e( 'Close',
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'Trello' ) );
|
6 |
?>
|
7 |
</h3>
|
8 |
+
<p><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></p>
|
9 |
</div>
|
10 |
+
<button class="sui-button forminator-addon-close"><?php esc_html_e( 'Close', 'forminator' ); ?></button>
|
addons/pro/trello/views/settings/wait-authorize.php
CHANGED
@@ -15,8 +15,8 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
<p class="" aria-label="Loading content">
|
16 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
17 |
</p>
|
18 |
-
<p><?php esc_html_e( 'We are waiting for authorization from Trello...',
|
19 |
</div>
|
20 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
21 |
-
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button disable-loader"><?php esc_html_e( 'RETRY',
|
22 |
<?php endif ?>
|
15 |
<p class="" aria-label="Loading content">
|
16 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
17 |
</p>
|
18 |
+
<p><?php esc_html_e( 'We are waiting for authorization from Trello...', 'forminator' ); ?></p>
|
19 |
</div>
|
20 |
<?php if ( empty( $vars['token'] ) ) : ?>
|
21 |
+
<a href="<?php echo esc_attr( $vars['auth_url'] ); ?>" target="_blank" class="sui-button disable-loader"><?php esc_html_e( 'RETRY', 'forminator' ); ?></a>
|
22 |
<?php endif ?>
|
addons/pro/zapier/class-forminator-addon-zapier-form-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
-
$this->_submit_form_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
|
@@ -148,7 +148,7 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
148 |
//check required fields
|
149 |
try {
|
150 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
151 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup',
|
152 |
}
|
153 |
|
154 |
$endpoint = $connection_settings['webhook_url'];
|
@@ -218,7 +218,7 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
218 |
return array(
|
219 |
'is_sent' => true,
|
220 |
'connection_name' => $connection_settings['name'],
|
221 |
-
'description' => __( 'Successfully send data to Zapier',
|
222 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
223 |
'data_received' => $zapier_api->get_last_data_received(),
|
224 |
'url_request' => $zapier_api->get_last_url_request(),
|
@@ -340,29 +340,29 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
340 |
}
|
341 |
$status = $addon_meta_data['value'];
|
342 |
$additional_entry_item = array(
|
343 |
-
'label' => __( 'Zapier Integration',
|
344 |
'value' => '',
|
345 |
);
|
346 |
|
347 |
$sub_entries = array();
|
348 |
if ( isset( $status['connection_name'] ) ) {
|
349 |
$sub_entries[] = array(
|
350 |
-
'label' => __( 'Integration Name',
|
351 |
'value' => $status['connection_name'],
|
352 |
);
|
353 |
}
|
354 |
|
355 |
if ( isset( $status['is_sent'] ) ) {
|
356 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
357 |
$sub_entries[] = array(
|
358 |
-
'label' => __( 'Sent To Zapier',
|
359 |
'value' => $is_sent,
|
360 |
);
|
361 |
}
|
362 |
|
363 |
if ( isset( $status['description'] ) ) {
|
364 |
$sub_entries[] = array(
|
365 |
-
'label' => __( 'Info',
|
366 |
'value' => $status['description'],
|
367 |
);
|
368 |
}
|
@@ -371,21 +371,21 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
371 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ZAPIER_SHOW_FULL_LOG', true)`
|
372 |
if ( isset( $status['url_request'] ) ) {
|
373 |
$sub_entries[] = array(
|
374 |
-
'label' => __( 'API URL',
|
375 |
'value' => $status['url_request'],
|
376 |
);
|
377 |
}
|
378 |
|
379 |
if ( isset( $status['data_sent'] ) ) {
|
380 |
$sub_entries[] = array(
|
381 |
-
'label' => __( 'Data sent to Zapier',
|
382 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
383 |
);
|
384 |
}
|
385 |
|
386 |
if ( isset( $status['data_received'] ) ) {
|
387 |
$sub_entries[] = array(
|
388 |
-
'label' => __( 'Data received from Zapier',
|
389 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
390 |
);
|
391 |
}
|
@@ -407,7 +407,7 @@ class Forminator_Addon_Zapier_Form_Hooks extends Forminator_Addon_Form_Hooks_Abs
|
|
407 |
public function on_export_render_title_row() {
|
408 |
|
409 |
$export_headers = array(
|
410 |
-
'info' => __( 'Zapier Info',
|
411 |
);
|
412 |
|
413 |
$form_id = $this->form_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $form_id ) {
|
41 |
parent::__construct( $addon, $form_id );
|
42 |
+
$this->_submit_form_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
|
148 |
//check required fields
|
149 |
try {
|
150 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
151 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup', 'forminator' ) );
|
152 |
}
|
153 |
|
154 |
$endpoint = $connection_settings['webhook_url'];
|
218 |
return array(
|
219 |
'is_sent' => true,
|
220 |
'connection_name' => $connection_settings['name'],
|
221 |
+
'description' => __( 'Successfully send data to Zapier', 'forminator' ),
|
222 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
223 |
'data_received' => $zapier_api->get_last_data_received(),
|
224 |
'url_request' => $zapier_api->get_last_url_request(),
|
340 |
}
|
341 |
$status = $addon_meta_data['value'];
|
342 |
$additional_entry_item = array(
|
343 |
+
'label' => __( 'Zapier Integration', 'forminator' ),
|
344 |
'value' => '',
|
345 |
);
|
346 |
|
347 |
$sub_entries = array();
|
348 |
if ( isset( $status['connection_name'] ) ) {
|
349 |
$sub_entries[] = array(
|
350 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
351 |
'value' => $status['connection_name'],
|
352 |
);
|
353 |
}
|
354 |
|
355 |
if ( isset( $status['is_sent'] ) ) {
|
356 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
357 |
$sub_entries[] = array(
|
358 |
+
'label' => __( 'Sent To Zapier', 'forminator' ),
|
359 |
'value' => $is_sent,
|
360 |
);
|
361 |
}
|
362 |
|
363 |
if ( isset( $status['description'] ) ) {
|
364 |
$sub_entries[] = array(
|
365 |
+
'label' => __( 'Info', 'forminator' ),
|
366 |
'value' => $status['description'],
|
367 |
);
|
368 |
}
|
371 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ZAPIER_SHOW_FULL_LOG', true)`
|
372 |
if ( isset( $status['url_request'] ) ) {
|
373 |
$sub_entries[] = array(
|
374 |
+
'label' => __( 'API URL', 'forminator' ),
|
375 |
'value' => $status['url_request'],
|
376 |
);
|
377 |
}
|
378 |
|
379 |
if ( isset( $status['data_sent'] ) ) {
|
380 |
$sub_entries[] = array(
|
381 |
+
'label' => __( 'Data sent to Zapier', 'forminator' ),
|
382 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
383 |
);
|
384 |
}
|
385 |
|
386 |
if ( isset( $status['data_received'] ) ) {
|
387 |
$sub_entries[] = array(
|
388 |
+
'label' => __( 'Data received from Zapier', 'forminator' ),
|
389 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
390 |
);
|
391 |
}
|
407 |
public function on_export_render_title_row() {
|
408 |
|
409 |
$export_headers = array(
|
410 |
+
'info' => __( 'Zapier Info', 'forminator' ),
|
411 |
);
|
412 |
|
413 |
$form_id = $this->form_id;
|
addons/pro/zapier/class-forminator-addon-zapier-form-settings.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Form_Settings extends Forminator_Addon_Form_Settin
|
|
39 |
|
40 |
$this->_update_form_settings_error_message = __(
|
41 |
'The update to your settings for this form failed, check the form input and try again.',
|
42 |
-
|
43 |
);
|
44 |
}
|
45 |
|
@@ -108,7 +108,7 @@ class Forminator_Addon_Zapier_Form_Settings extends Forminator_Addon_Form_Settin
|
|
108 |
if ( $is_submit ) {
|
109 |
$input_exceptions = new Forminator_Addon_Zapier_Form_Settings_Exception();
|
110 |
if ( empty( $current_data['name'] ) ) {
|
111 |
-
$input_exceptions->add_input_exception( __( 'Please create a name for this Zapier integration',
|
112 |
}
|
113 |
|
114 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
@@ -138,37 +138,37 @@ class Forminator_Addon_Zapier_Form_Settings extends Forminator_Addon_Form_Settin
|
|
138 |
$buttons = array();
|
139 |
if ( $this->setup_webhook_url_is_completed( $current_data ) ) {
|
140 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
141 |
-
esc_html__( 'Deactivate',
|
142 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
143 |
-
esc_html__( 'Deactivate Zapier from this Form.',
|
144 |
);
|
145 |
}
|
146 |
|
147 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
148 |
-
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save',
|
149 |
'</div>';
|
150 |
|
151 |
-
$help_message = esc_html__( 'Put your ZAP Webhook URL below.',
|
152 |
|
153 |
$notice_message = sprintf(
|
154 |
/* translators: ... */
|
155 |
-
__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$s as Trigger App.',
|
156 |
'<a href="' . $this->new_zap_url . '" target="_blank">',
|
157 |
'</a>',
|
158 |
'<strong>Webhooks by Zapier</strong>'
|
159 |
);
|
160 |
|
161 |
return array(
|
162 |
-
'html' => '<div class="integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Setup Webhook',
|
163 |
<span class="sui-description" style="margin-top: 20px;">' . $help_message . '</span>
|
164 |
' . $error_message . '</div>
|
165 |
<form enctype="multipart/form-data">
|
166 |
<div class="sui-form-field ' . ( isset( $input_error_messages['name'] ) ? 'sui-form-field-error' : '' ) . '">
|
167 |
-
<label class="sui-label">' . esc_html__( 'Zapier Integration Name',
|
168 |
<div class="sui-control-with-icon">
|
169 |
<input type="text"
|
170 |
name="name"
|
171 |
-
placeholder="' . esc_attr__( 'Friendly Name',
|
172 |
value="' . esc_attr( $current_data['name'] ) . '"
|
173 |
class="sui-form-control"
|
174 |
/>
|
@@ -177,12 +177,12 @@ class Forminator_Addon_Zapier_Form_Settings extends Forminator_Addon_Form_Settin
|
|
177 |
' . ( isset( $input_error_messages['name'] ) ? '<span class="sui-error-message">' . esc_html( $input_error_messages['name'] ) . '</span>' : '' ) . '
|
178 |
</div>
|
179 |
<div class="sui-form-field ' . ( isset( $input_error_messages['webhook_url'] ) ? 'sui-form-field-error' : '' ) . '">
|
180 |
-
<label class="sui-label">' . esc_html__( 'Webhook URL',
|
181 |
<div class="sui-control-with-icon">
|
182 |
<input
|
183 |
type="text"
|
184 |
name="webhook_url"
|
185 |
-
placeholder="' . esc_attr__( 'Webhook URL',
|
186 |
value="' . esc_attr( $current_data['webhook_url'] ) . '"
|
187 |
class="sui-form-control" />
|
188 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
@@ -220,25 +220,25 @@ class Forminator_Addon_Zapier_Form_Settings extends Forminator_Addon_Form_Settin
|
|
220 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Form_Settings_Exception $current_input_exception ) {
|
221 |
$form_id = $this->form_id;
|
222 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
223 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
224 |
throw $current_input_exception;
|
225 |
}
|
226 |
|
227 |
// must be this prefix
|
228 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
229 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
230 |
throw $current_input_exception;
|
231 |
}
|
232 |
|
233 |
// must not be in silent mode
|
234 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
235 |
-
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.',
|
236 |
throw $current_input_exception;
|
237 |
}
|
238 |
|
239 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
240 |
if ( false === $endpoint ) {
|
241 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
242 |
throw $current_input_exception;
|
243 |
}
|
244 |
|
39 |
|
40 |
$this->_update_form_settings_error_message = __(
|
41 |
'The update to your settings for this form failed, check the form input and try again.',
|
42 |
+
'forminator'
|
43 |
);
|
44 |
}
|
45 |
|
108 |
if ( $is_submit ) {
|
109 |
$input_exceptions = new Forminator_Addon_Zapier_Form_Settings_Exception();
|
110 |
if ( empty( $current_data['name'] ) ) {
|
111 |
+
$input_exceptions->add_input_exception( __( 'Please create a name for this Zapier integration', 'forminator' ), 'name' );
|
112 |
}
|
113 |
|
114 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
138 |
$buttons = array();
|
139 |
if ( $this->setup_webhook_url_is_completed( $current_data ) ) {
|
140 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
141 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
142 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
143 |
+
esc_html__( 'Deactivate Zapier from this Form.', 'forminator' )
|
144 |
);
|
145 |
}
|
146 |
|
147 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
148 |
+
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
149 |
'</div>';
|
150 |
|
151 |
+
$help_message = esc_html__( 'Put your ZAP Webhook URL below.', 'forminator' );
|
152 |
|
153 |
$notice_message = sprintf(
|
154 |
/* translators: ... */
|
155 |
+
__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$s as Trigger App.', 'forminator' ),
|
156 |
'<a href="' . $this->new_zap_url . '" target="_blank">',
|
157 |
'</a>',
|
158 |
'<strong>Webhooks by Zapier</strong>'
|
159 |
);
|
160 |
|
161 |
return array(
|
162 |
+
'html' => '<div class="integration-header"><h3 class="sui-box-title" id="dialogTitle2">' . __( 'Setup Webhook', 'forminator' ) . '</h3>
|
163 |
<span class="sui-description" style="margin-top: 20px;">' . $help_message . '</span>
|
164 |
' . $error_message . '</div>
|
165 |
<form enctype="multipart/form-data">
|
166 |
<div class="sui-form-field ' . ( isset( $input_error_messages['name'] ) ? 'sui-form-field-error' : '' ) . '">
|
167 |
+
<label class="sui-label">' . esc_html__( 'Zapier Integration Name', 'forminator' ) . '</label>
|
168 |
<div class="sui-control-with-icon">
|
169 |
<input type="text"
|
170 |
name="name"
|
171 |
+
placeholder="' . esc_attr__( 'Friendly Name', 'forminator' ) . '"
|
172 |
value="' . esc_attr( $current_data['name'] ) . '"
|
173 |
class="sui-form-control"
|
174 |
/>
|
177 |
' . ( isset( $input_error_messages['name'] ) ? '<span class="sui-error-message">' . esc_html( $input_error_messages['name'] ) . '</span>' : '' ) . '
|
178 |
</div>
|
179 |
<div class="sui-form-field ' . ( isset( $input_error_messages['webhook_url'] ) ? 'sui-form-field-error' : '' ) . '">
|
180 |
+
<label class="sui-label">' . esc_html__( 'Webhook URL', 'forminator' ) . '</label>
|
181 |
<div class="sui-control-with-icon">
|
182 |
<input
|
183 |
type="text"
|
184 |
name="webhook_url"
|
185 |
+
placeholder="' . esc_attr__( 'Webhook URL', 'forminator' ) . '"
|
186 |
value="' . esc_attr( $current_data['webhook_url'] ) . '"
|
187 |
class="sui-form-control" />
|
188 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
220 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Form_Settings_Exception $current_input_exception ) {
|
221 |
$form_id = $this->form_id;
|
222 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
223 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url' );
|
224 |
throw $current_input_exception;
|
225 |
}
|
226 |
|
227 |
// must be this prefix
|
228 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
229 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url' );
|
230 |
throw $current_input_exception;
|
231 |
}
|
232 |
|
233 |
// must not be in silent mode
|
234 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
235 |
+
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.', 'forminator' ), 'webhook_url' );
|
236 |
throw $current_input_exception;
|
237 |
}
|
238 |
|
239 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
240 |
if ( false === $endpoint ) {
|
241 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url' );
|
242 |
throw $current_input_exception;
|
243 |
}
|
244 |
|
addons/pro/zapier/class-forminator-addon-zapier-poll-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
41 |
parent::__construct( $addon, $poll_id );
|
42 |
-
$this->_submit_poll_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -144,7 +144,7 @@ class Forminator_Addon_Zapier_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
144 |
//check required fields
|
145 |
try {
|
146 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
147 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup',
|
148 |
}
|
149 |
|
150 |
$endpoint = $connection_settings['webhook_url'];
|
@@ -247,7 +247,7 @@ class Forminator_Addon_Zapier_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
247 |
return array(
|
248 |
'is_sent' => true,
|
249 |
'connection_name' => $connection_settings['name'],
|
250 |
-
'description' => __( 'Successfully send data to Zapier',
|
251 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
252 |
'data_received' => $zapier_api->get_last_data_received(),
|
253 |
'url_request' => $zapier_api->get_last_url_request(),
|
@@ -277,7 +277,7 @@ class Forminator_Addon_Zapier_Poll_Hooks extends Forminator_Addon_Poll_Hooks_Abs
|
|
277 |
public function on_export_render_title_row() {
|
278 |
|
279 |
$export_headers = array(
|
280 |
-
'info' => __( 'Zapier Info',
|
281 |
);
|
282 |
|
283 |
$poll_id = $this->poll_id;
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $poll_id ) {
|
41 |
parent::__construct( $addon, $poll_id );
|
42 |
+
$this->_submit_poll_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
144 |
//check required fields
|
145 |
try {
|
146 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
147 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup', 'forminator' ) );
|
148 |
}
|
149 |
|
150 |
$endpoint = $connection_settings['webhook_url'];
|
247 |
return array(
|
248 |
'is_sent' => true,
|
249 |
'connection_name' => $connection_settings['name'],
|
250 |
+
'description' => __( 'Successfully send data to Zapier', 'forminator' ),
|
251 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
252 |
'data_received' => $zapier_api->get_last_data_received(),
|
253 |
'url_request' => $zapier_api->get_last_url_request(),
|
277 |
public function on_export_render_title_row() {
|
278 |
|
279 |
$export_headers = array(
|
280 |
+
'info' => __( 'Zapier Info', 'forminator' ),
|
281 |
);
|
282 |
|
283 |
$poll_id = $this->poll_id;
|
addons/pro/zapier/class-forminator-addon-zapier-poll-settings.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
39 |
|
40 |
$this->_update_poll_settings_error_message = __(
|
41 |
'The update to your settings for this poll failed, check the form input and try again.',
|
42 |
-
|
43 |
);
|
44 |
}
|
45 |
|
@@ -74,7 +74,7 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
74 |
$template = forminator_addon_zapier_dir() . 'views/poll-settings/setup-webhook.php';
|
75 |
|
76 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
77 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
78 |
}
|
79 |
|
80 |
$multi_id = $submitted_data['multi_id'];
|
@@ -103,7 +103,7 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
103 |
$input_exceptions = new Forminator_Addon_Zapier_Poll_Settings_Exception();
|
104 |
|
105 |
if ( empty( $name ) ) {
|
106 |
-
$input_exceptions->add_input_exception( __( 'Please specify integration name.',
|
107 |
}
|
108 |
|
109 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
@@ -124,7 +124,7 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
124 |
|
125 |
$notification = array(
|
126 |
'type' => 'success',
|
127 |
-
'text' => '<strong>' . $this->addon->get_title() . '</strong> ' . __( 'Successfully connected and sent sample data to your ZAP',
|
128 |
);
|
129 |
$is_close = true;
|
130 |
|
@@ -140,14 +140,14 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
140 |
$buttons = array();
|
141 |
if ( $this->setup_webhook_url_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
142 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
143 |
-
esc_html__( 'Deactivate',
|
144 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
145 |
-
esc_html__( 'Deactivate Zapier from this Poll.',
|
146 |
);
|
147 |
}
|
148 |
|
149 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
150 |
-
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save',
|
151 |
'</div>';
|
152 |
|
153 |
return array(
|
@@ -179,25 +179,25 @@ class Forminator_Addon_Zapier_Poll_Settings extends Forminator_Addon_Poll_Settin
|
|
179 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Poll_Settings_Exception $current_input_exception ) {
|
180 |
$poll_id = $this->poll_id;
|
181 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
182 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
183 |
throw $current_input_exception;
|
184 |
}
|
185 |
|
186 |
// must be this prefix
|
187 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
188 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
189 |
throw $current_input_exception;
|
190 |
}
|
191 |
|
192 |
// must not be in silent mode
|
193 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
194 |
-
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.',
|
195 |
throw $current_input_exception;
|
196 |
}
|
197 |
|
198 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
199 |
if ( false === $endpoint ) {
|
200 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
201 |
throw $current_input_exception;
|
202 |
}
|
203 |
|
39 |
|
40 |
$this->_update_poll_settings_error_message = __(
|
41 |
'The update to your settings for this poll failed, check the form input and try again.',
|
42 |
+
'forminator'
|
43 |
);
|
44 |
}
|
45 |
|
74 |
$template = forminator_addon_zapier_dir() . 'views/poll-settings/setup-webhook.php';
|
75 |
|
76 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
77 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
78 |
}
|
79 |
|
80 |
$multi_id = $submitted_data['multi_id'];
|
103 |
$input_exceptions = new Forminator_Addon_Zapier_Poll_Settings_Exception();
|
104 |
|
105 |
if ( empty( $name ) ) {
|
106 |
+
$input_exceptions->add_input_exception( __( 'Please specify integration name.', 'forminator' ), 'name_error' );
|
107 |
}
|
108 |
|
109 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
124 |
|
125 |
$notification = array(
|
126 |
'type' => 'success',
|
127 |
+
'text' => '<strong>' . $this->addon->get_title() . '</strong> ' . __( 'Successfully connected and sent sample data to your ZAP', 'forminator' ),
|
128 |
);
|
129 |
$is_close = true;
|
130 |
|
140 |
$buttons = array();
|
141 |
if ( $this->setup_webhook_url_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
142 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
143 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
144 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
145 |
+
esc_html__( 'Deactivate Zapier from this Poll.', 'forminator' )
|
146 |
);
|
147 |
}
|
148 |
|
149 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
150 |
+
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
151 |
'</div>';
|
152 |
|
153 |
return array(
|
179 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Poll_Settings_Exception $current_input_exception ) {
|
180 |
$poll_id = $this->poll_id;
|
181 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
182 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
183 |
throw $current_input_exception;
|
184 |
}
|
185 |
|
186 |
// must be this prefix
|
187 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
188 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
189 |
throw $current_input_exception;
|
190 |
}
|
191 |
|
192 |
// must not be in silent mode
|
193 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
194 |
+
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
195 |
throw $current_input_exception;
|
196 |
}
|
197 |
|
198 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
199 |
if ( false === $endpoint ) {
|
200 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
201 |
throw $current_input_exception;
|
202 |
}
|
203 |
|
addons/pro/zapier/class-forminator-addon-zapier-quiz-hooks.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
-
$this->_submit_quiz_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again',
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -145,7 +145,7 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
145 |
//check required fields
|
146 |
try {
|
147 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
148 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup',
|
149 |
}
|
150 |
|
151 |
$endpoint = $connection_settings['webhook_url'];
|
@@ -200,7 +200,7 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
200 |
return array(
|
201 |
'is_sent' => true,
|
202 |
'connection_name' => $connection_settings['name'],
|
203 |
-
'description' => __( 'Successfully send data to Zapier',
|
204 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
205 |
'data_received' => $zapier_api->get_last_data_received(),
|
206 |
'url_request' => $zapier_api->get_last_url_request(),
|
@@ -335,7 +335,7 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
335 |
public function on_export_render_title_row() {
|
336 |
|
337 |
$export_headers = array(
|
338 |
-
'info' => __( 'Zapier Info',
|
339 |
);
|
340 |
|
341 |
$quiz_id = $this->quiz_id;
|
@@ -504,29 +504,29 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
504 |
}
|
505 |
$status = $addon_meta_data['value'];
|
506 |
$additional_entry_item = array(
|
507 |
-
'label' => __( 'Zapier Integration',
|
508 |
'value' => '',
|
509 |
);
|
510 |
|
511 |
$sub_entries = array();
|
512 |
if ( isset( $status['connection_name'] ) ) {
|
513 |
$sub_entries[] = array(
|
514 |
-
'label' => __( 'Integration Name',
|
515 |
'value' => $status['connection_name'],
|
516 |
);
|
517 |
}
|
518 |
|
519 |
if ( isset( $status['is_sent'] ) ) {
|
520 |
-
$is_sent = true === $status['is_sent'] ? __( 'Yes',
|
521 |
$sub_entries[] = array(
|
522 |
-
'label' => __( 'Sent To Zapier',
|
523 |
'value' => $is_sent,
|
524 |
);
|
525 |
}
|
526 |
|
527 |
if ( isset( $status['description'] ) ) {
|
528 |
$sub_entries[] = array(
|
529 |
-
'label' => __( 'Info',
|
530 |
'value' => $status['description'],
|
531 |
);
|
532 |
}
|
@@ -535,21 +535,21 @@ class Forminator_Addon_Zapier_Quiz_Hooks extends Forminator_Addon_Quiz_Hooks_Abs
|
|
535 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ZAPIER_SHOW_FULL_LOG', true)`
|
536 |
if ( isset( $status['url_request'] ) ) {
|
537 |
$sub_entries[] = array(
|
538 |
-
'label' => __( 'API URL',
|
539 |
'value' => $status['url_request'],
|
540 |
);
|
541 |
}
|
542 |
|
543 |
if ( isset( $status['data_sent'] ) ) {
|
544 |
$sub_entries[] = array(
|
545 |
-
'label' => __( 'Data sent to Zapier',
|
546 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
547 |
);
|
548 |
}
|
549 |
|
550 |
if ( isset( $status['data_received'] ) ) {
|
551 |
$sub_entries[] = array(
|
552 |
-
'label' => __( 'Data received from Zapier',
|
553 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
554 |
);
|
555 |
}
|
39 |
*/
|
40 |
public function __construct( Forminator_Addon_Abstract $addon, $quiz_id ) {
|
41 |
parent::__construct( $addon, $quiz_id );
|
42 |
+
$this->_submit_quiz_error_message = __( 'Zapier failed to process submitted data. Please check your form and try again', 'forminator' );
|
43 |
}
|
44 |
|
45 |
/**
|
145 |
//check required fields
|
146 |
try {
|
147 |
if ( ! isset( $connection_settings['webhook_url'] ) ) {
|
148 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Webhook URL is not properly setup', 'forminator' ) );
|
149 |
}
|
150 |
|
151 |
$endpoint = $connection_settings['webhook_url'];
|
200 |
return array(
|
201 |
'is_sent' => true,
|
202 |
'connection_name' => $connection_settings['name'],
|
203 |
+
'description' => __( 'Successfully send data to Zapier', 'forminator' ),
|
204 |
'data_sent' => $zapier_api->get_last_data_sent(),
|
205 |
'data_received' => $zapier_api->get_last_data_received(),
|
206 |
'url_request' => $zapier_api->get_last_url_request(),
|
335 |
public function on_export_render_title_row() {
|
336 |
|
337 |
$export_headers = array(
|
338 |
+
'info' => __( 'Zapier Info', 'forminator' ),
|
339 |
);
|
340 |
|
341 |
$quiz_id = $this->quiz_id;
|
504 |
}
|
505 |
$status = $addon_meta_data['value'];
|
506 |
$additional_entry_item = array(
|
507 |
+
'label' => __( 'Zapier Integration', 'forminator' ),
|
508 |
'value' => '',
|
509 |
);
|
510 |
|
511 |
$sub_entries = array();
|
512 |
if ( isset( $status['connection_name'] ) ) {
|
513 |
$sub_entries[] = array(
|
514 |
+
'label' => __( 'Integration Name', 'forminator' ),
|
515 |
'value' => $status['connection_name'],
|
516 |
);
|
517 |
}
|
518 |
|
519 |
if ( isset( $status['is_sent'] ) ) {
|
520 |
+
$is_sent = true === $status['is_sent'] ? __( 'Yes', 'forminator' ) : __( 'No', 'forminator' );
|
521 |
$sub_entries[] = array(
|
522 |
+
'label' => __( 'Sent To Zapier', 'forminator' ),
|
523 |
'value' => $is_sent,
|
524 |
);
|
525 |
}
|
526 |
|
527 |
if ( isset( $status['description'] ) ) {
|
528 |
$sub_entries[] = array(
|
529 |
+
'label' => __( 'Info', 'forminator' ),
|
530 |
'value' => $status['description'],
|
531 |
);
|
532 |
}
|
535 |
// too long to be added on entry data enable this with `define('FORMINATOR_ADDON_ZAPIER_SHOW_FULL_LOG', true)`
|
536 |
if ( isset( $status['url_request'] ) ) {
|
537 |
$sub_entries[] = array(
|
538 |
+
'label' => __( 'API URL', 'forminator' ),
|
539 |
'value' => $status['url_request'],
|
540 |
);
|
541 |
}
|
542 |
|
543 |
if ( isset( $status['data_sent'] ) ) {
|
544 |
$sub_entries[] = array(
|
545 |
+
'label' => __( 'Data sent to Zapier', 'forminator' ),
|
546 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_sent'], JSON_PRETTY_PRINT ) . '</pre>',
|
547 |
);
|
548 |
}
|
549 |
|
550 |
if ( isset( $status['data_received'] ) ) {
|
551 |
$sub_entries[] = array(
|
552 |
+
'label' => __( 'Data received from Zapier', 'forminator' ),
|
553 |
'value' => '<pre class="sui-code-snippet">' . wp_json_encode( $status['data_received'], JSON_PRETTY_PRINT ) . '</pre>',
|
554 |
);
|
555 |
}
|
addons/pro/zapier/class-forminator-addon-zapier-quiz-settings.php
CHANGED
@@ -39,7 +39,7 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
39 |
|
40 |
$this->_update_quiz_settings_error_message = __(
|
41 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
42 |
-
|
43 |
);
|
44 |
}
|
45 |
|
@@ -74,7 +74,7 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
74 |
$template = forminator_addon_zapier_dir() . 'views/quiz-settings/setup-webhook.php';
|
75 |
|
76 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
77 |
-
return $this->get_force_closed_wizard( __( 'Please pick valid connection',
|
78 |
}
|
79 |
|
80 |
$multi_id = $submitted_data['multi_id'];
|
@@ -103,7 +103,7 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
103 |
$input_exceptions = new Forminator_Addon_Zapier_Quiz_Settings_Exception();
|
104 |
|
105 |
if ( empty( $name ) ) {
|
106 |
-
$input_exceptions->add_input_exception( __( 'Please specify integration name.',
|
107 |
}
|
108 |
|
109 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
@@ -124,7 +124,7 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
124 |
|
125 |
$notification = array(
|
126 |
'type' => 'success',
|
127 |
-
'text' => '<strong>' . $this->addon->get_title() . '</strong> ' . __( 'Successfully connected and sent sample data to your ZAP',
|
128 |
);
|
129 |
$is_close = true;
|
130 |
|
@@ -140,14 +140,14 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
140 |
$buttons = array();
|
141 |
if ( $this->setup_webhook_url_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
142 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
143 |
-
esc_html__( 'Deactivate',
|
144 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
145 |
-
esc_html__( 'Deactivate Zapier from this Quiz.',
|
146 |
);
|
147 |
}
|
148 |
|
149 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
150 |
-
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save',
|
151 |
'</div>';
|
152 |
|
153 |
return array(
|
@@ -179,25 +179,25 @@ class Forminator_Addon_Zapier_Quiz_Settings extends Forminator_Addon_Quiz_Settin
|
|
179 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Quiz_Settings_Exception $current_input_exception ) {
|
180 |
$quiz_id = $this->quiz_id;
|
181 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
182 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
183 |
throw $current_input_exception;
|
184 |
}
|
185 |
|
186 |
// must be this prefix
|
187 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
188 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
189 |
throw $current_input_exception;
|
190 |
}
|
191 |
|
192 |
// must not be in silent mode
|
193 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
194 |
-
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.',
|
195 |
throw $current_input_exception;
|
196 |
}
|
197 |
|
198 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
199 |
if ( false === $endpoint ) {
|
200 |
-
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.',
|
201 |
throw $current_input_exception;
|
202 |
}
|
203 |
|
39 |
|
40 |
$this->_update_quiz_settings_error_message = __(
|
41 |
'The update to your settings for this quiz failed, check the form input and try again.',
|
42 |
+
'forminator'
|
43 |
);
|
44 |
}
|
45 |
|
74 |
$template = forminator_addon_zapier_dir() . 'views/quiz-settings/setup-webhook.php';
|
75 |
|
76 |
if ( ! isset( $submitted_data['multi_id'] ) ) {
|
77 |
+
return $this->get_force_closed_wizard( __( 'Please pick valid connection', 'forminator' ) );
|
78 |
}
|
79 |
|
80 |
$multi_id = $submitted_data['multi_id'];
|
103 |
$input_exceptions = new Forminator_Addon_Zapier_Quiz_Settings_Exception();
|
104 |
|
105 |
if ( empty( $name ) ) {
|
106 |
+
$input_exceptions->add_input_exception( __( 'Please specify integration name.', 'forminator' ), 'name_error' );
|
107 |
}
|
108 |
|
109 |
$this->validate_and_send_sample( $submitted_data, $input_exceptions );
|
124 |
|
125 |
$notification = array(
|
126 |
'type' => 'success',
|
127 |
+
'text' => '<strong>' . $this->addon->get_title() . '</strong> ' . __( 'Successfully connected and sent sample data to your ZAP', 'forminator' ),
|
128 |
);
|
129 |
$is_close = true;
|
130 |
|
140 |
$buttons = array();
|
141 |
if ( $this->setup_webhook_url_is_completed( array( 'multi_id' => $multi_id ) ) ) {
|
142 |
$buttons['disconnect']['markup'] = Forminator_Addon_Zapier::get_button_markup(
|
143 |
+
esc_html__( 'Deactivate', 'forminator' ),
|
144 |
'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect',
|
145 |
+
esc_html__( 'Deactivate Zapier from this Quiz.', 'forminator' )
|
146 |
);
|
147 |
}
|
148 |
|
149 |
$buttons['next']['markup'] = '<div class="sui-actions-right">' .
|
150 |
+
Forminator_Addon_Zapier::get_button_markup( esc_html__( 'Save', 'forminator' ), 'sui-button-primary forminator-addon-finish' ) .
|
151 |
'</div>';
|
152 |
|
153 |
return array(
|
179 |
private function validate_and_send_sample( $submitted_data, Forminator_Addon_Zapier_Quiz_Settings_Exception $current_input_exception ) {
|
180 |
$quiz_id = $this->quiz_id;
|
181 |
if ( ! isset( $submitted_data['webhook_url'] ) ) {
|
182 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
183 |
throw $current_input_exception;
|
184 |
}
|
185 |
|
186 |
// must be this prefix
|
187 |
if ( stripos( $submitted_data['webhook_url'], 'https://hooks.zapier.com/' ) !== 0 ) {
|
188 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
189 |
throw $current_input_exception;
|
190 |
}
|
191 |
|
192 |
// must not be in silent mode
|
193 |
if ( stripos( $submitted_data['webhook_url'], 'silent' ) !== false ) {
|
194 |
+
$current_input_exception->add_input_exception( __( 'Please disable Silent Mode on Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
195 |
throw $current_input_exception;
|
196 |
}
|
197 |
|
198 |
$endpoint = wp_http_validate_url( $submitted_data['webhook_url'] );
|
199 |
if ( false === $endpoint ) {
|
200 |
+
$current_input_exception->add_input_exception( __( 'Please put a valid Webhook URL.', 'forminator' ), 'webhook_url_error' );
|
201 |
throw $current_input_exception;
|
202 |
}
|
203 |
|
addons/pro/zapier/class-forminator-addon-zapier.php
CHANGED
@@ -42,28 +42,28 @@ final class Forminator_Addon_Zapier extends Forminator_Addon_Abstract {
|
|
42 |
*/
|
43 |
public function __construct() {
|
44 |
// late init to allow translation
|
45 |
-
$this->_description = __( 'Make your form Zap-able',
|
46 |
$doc_description = forminator_is_show_addons_documentation_link() ?
|
47 |
sprintf(
|
48 |
/* translators: 1: article anchor start, 2: article anchor end. */
|
49 |
-
__( 'Refer to this %1$sarticle%2$s for tips and tricks on using Zapier integration and creating automated workflows.',
|
50 |
'<a href="https://wpmudev.com/blog/zapier-wordpress-form-integrations/" target="_blank">',
|
51 |
'</a>'
|
52 |
) : '';
|
53 |
$this->_promotion = sprintf(
|
54 |
/* translators: ... */
|
55 |
-
__( 'Zapier connects Forminator with %1$s1000+ apps%2$s. You can use it to send your submissions to third party apps not natively supported in Forminator and automate your after-submission workflows. %3$s Happy automating!',
|
56 |
'<a href="https://zapier.com/apps" target="_blank">',
|
57 |
'</a>',
|
58 |
$doc_description
|
59 |
);
|
60 |
|
61 |
-
$this->_activation_error_message = __( 'Sorry but we failed to activate Zapier Integration, don\'t hesitate to contact us',
|
62 |
-
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Zapier Integration, please try again',
|
63 |
|
64 |
$this->_update_settings_error_message = __(
|
65 |
'Sorry, we failed to update settings, please check your form and try again',
|
66 |
-
|
67 |
);
|
68 |
|
69 |
$this->_icon = forminator_addon_zapier_assets_url() . 'icons/zapier.png';
|
@@ -141,7 +141,7 @@ final class Forminator_Addon_Zapier extends Forminator_Addon_Abstract {
|
|
141 |
|
142 |
try {
|
143 |
if ( empty( $connect ) ) {
|
144 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Please Connect Zapier',
|
145 |
}
|
146 |
|
147 |
if ( ! forminator_addon_is_active( $this->_slug ) ) {
|
@@ -168,16 +168,16 @@ final class Forminator_Addon_Zapier extends Forminator_Addon_Abstract {
|
|
168 |
|
169 |
if ( $show_success ) {
|
170 |
$buttons['close'] = array(
|
171 |
-
'markup' => self::get_button_markup( esc_html__( 'Close',
|
172 |
);
|
173 |
} else {
|
174 |
if ( $this->is_connected() ) {
|
175 |
$buttons['disconnect'] = array(
|
176 |
-
'markup' => self::get_button_markup( esc_html__( 'Disconnect',
|
177 |
);
|
178 |
} else {
|
179 |
$buttons['submit'] = array(
|
180 |
-
'markup' => self::get_button_markup( esc_html__( 'Activate',
|
181 |
);
|
182 |
}
|
183 |
}
|
@@ -202,7 +202,7 @@ final class Forminator_Addon_Zapier extends Forminator_Addon_Abstract {
|
|
202 |
try {
|
203 |
// check if its active
|
204 |
if ( ! $this->is_active() ) {
|
205 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Zapier is not active',
|
206 |
}
|
207 |
$is_connected = true;
|
208 |
} catch ( Forminator_Addon_Zapier_Exception $e ) {
|
@@ -234,17 +234,17 @@ final class Forminator_Addon_Zapier extends Forminator_Addon_Abstract {
|
|
234 |
try {
|
235 |
$form_settings_instance = null;
|
236 |
if ( ! $this->is_connected() ) {
|
237 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Zapier is not connected',
|
238 |
}
|
239 |
|
240 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
241 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Zapier_Form_Settings ) {
|
242 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'Invalid Form Settings of Zapier',
|
243 |
}
|
244 |
|
245 |
// Mark as active when there is at least one active connection
|
246 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
247 |
-
throw new Forminator_Addon_Zapier_Exception( __( 'No active Zapier connection found in this form',
|
248 |
}
|
249 |
|
250 |
$is_form_connected = true;
|
42 |
*/
|
43 |
public function __construct() {
|
44 |
// late init to allow translation
|
45 |
+
$this->_description = __( 'Make your form Zap-able', 'forminator' );
|
46 |
$doc_description = forminator_is_show_addons_documentation_link() ?
|
47 |
sprintf(
|
48 |
/* translators: 1: article anchor start, 2: article anchor end. */
|
49 |
+
__( 'Refer to this %1$sarticle%2$s for tips and tricks on using Zapier integration and creating automated workflows.', 'forminator' ),
|
50 |
'<a href="https://wpmudev.com/blog/zapier-wordpress-form-integrations/" target="_blank">',
|
51 |
'</a>'
|
52 |
) : '';
|
53 |
$this->_promotion = sprintf(
|
54 |
/* translators: ... */
|
55 |
+
__( 'Zapier connects Forminator with %1$s1000+ apps%2$s. You can use it to send your submissions to third party apps not natively supported in Forminator and automate your after-submission workflows. %3$s Happy automating!', 'forminator' ),
|
56 |
'<a href="https://zapier.com/apps" target="_blank">',
|
57 |
'</a>',
|
58 |
$doc_description
|
59 |
);
|
60 |
|
61 |
+
$this->_activation_error_message = __( 'Sorry but we failed to activate Zapier Integration, don\'t hesitate to contact us', 'forminator' );
|
62 |
+
$this->_deactivation_error_message = __( 'Sorry but we failed to deactivate Zapier Integration, please try again', 'forminator' );
|
63 |
|
64 |
$this->_update_settings_error_message = __(
|
65 |
'Sorry, we failed to update settings, please check your form and try again',
|
66 |
+
'forminator'
|
67 |
);
|
68 |
|
69 |
$this->_icon = forminator_addon_zapier_assets_url() . 'icons/zapier.png';
|
141 |
|
142 |
try {
|
143 |
if ( empty( $connect ) ) {
|
144 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Please Connect Zapier', 'forminator' ) );
|
145 |
}
|
146 |
|
147 |
if ( ! forminator_addon_is_active( $this->_slug ) ) {
|
168 |
|
169 |
if ( $show_success ) {
|
170 |
$buttons['close'] = array(
|
171 |
+
'markup' => self::get_button_markup( esc_html__( 'Close', 'forminator' ), 'sui-button-ghost forminator-addon-close' ),
|
172 |
);
|
173 |
} else {
|
174 |
if ( $this->is_connected() ) {
|
175 |
$buttons['disconnect'] = array(
|
176 |
+
'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ),
|
177 |
);
|
178 |
} else {
|
179 |
$buttons['submit'] = array(
|
180 |
+
'markup' => self::get_button_markup( esc_html__( 'Activate', 'forminator' ), 'forminator-addon-connect' ),
|
181 |
);
|
182 |
}
|
183 |
}
|
202 |
try {
|
203 |
// check if its active
|
204 |
if ( ! $this->is_active() ) {
|
205 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Zapier is not active', 'forminator' ) );
|
206 |
}
|
207 |
$is_connected = true;
|
208 |
} catch ( Forminator_Addon_Zapier_Exception $e ) {
|
234 |
try {
|
235 |
$form_settings_instance = null;
|
236 |
if ( ! $this->is_connected() ) {
|
237 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Zapier is not connected', 'forminator' ) );
|
238 |
}
|
239 |
|
240 |
$form_settings_instance = $this->get_addon_form_settings( $form_id );
|
241 |
if ( ! $form_settings_instance instanceof Forminator_Addon_Zapier_Form_Settings ) {
|
242 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'Invalid Form Settings of Zapier', 'forminator' ) );
|
243 |
}
|
244 |
|
245 |
// Mark as active when there is at least one active connection
|
246 |
if ( false === $form_settings_instance->find_one_active_connection() ) {
|
247 |
+
throw new Forminator_Addon_Zapier_Exception( __( 'No active Zapier connection found in this form', 'forminator' ) );
|
248 |
}
|
249 |
|
250 |
$is_form_connected = true;
|
addons/pro/zapier/lib/class-forminator-addon-zapier-wp-api.php
CHANGED
@@ -61,7 +61,7 @@ class Forminator_Addon_Zapier_Wp_Api {
|
|
61 |
$wpdb->last_error;
|
62 |
//prerequisites
|
63 |
if ( ! $_endpoint ) {
|
64 |
-
throw new Forminator_Addon_Zapier_Wp_Api_Exception( __( 'Missing required Static Webhook URL',
|
65 |
}
|
66 |
|
67 |
$this->_endpoint = $_endpoint;
|
@@ -203,7 +203,7 @@ class Forminator_Addon_Zapier_Wp_Api {
|
|
203 |
if ( is_wp_error( $res ) || ! $res ) {
|
204 |
forminator_addon_maybe_log( __METHOD__, $res );
|
205 |
throw new Forminator_Addon_Zapier_Wp_Api_Exception(
|
206 |
-
__( 'Failed to process request, make sure your Webhook URL is correct and your server has internet connection.',
|
207 |
);
|
208 |
}
|
209 |
|
@@ -217,10 +217,10 @@ class Forminator_Addon_Zapier_Wp_Api {
|
|
217 |
|
218 |
if ( 404 === $status_code ) {
|
219 |
/* translators: ... */
|
220 |
-
throw new Forminator_Addon_Zapier_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s',
|
221 |
}
|
222 |
/* translators: ... */
|
223 |
-
throw new Forminator_Addon_Zapier_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s',
|
224 |
}
|
225 |
}
|
226 |
|
61 |
$wpdb->last_error;
|
62 |
//prerequisites
|
63 |
if ( ! $_endpoint ) {
|
64 |
+
throw new Forminator_Addon_Zapier_Wp_Api_Exception( __( 'Missing required Static Webhook URL', 'forminator' ) );
|
65 |
}
|
66 |
|
67 |
$this->_endpoint = $_endpoint;
|
203 |
if ( is_wp_error( $res ) || ! $res ) {
|
204 |
forminator_addon_maybe_log( __METHOD__, $res );
|
205 |
throw new Forminator_Addon_Zapier_Wp_Api_Exception(
|
206 |
+
__( 'Failed to process request, make sure your Webhook URL is correct and your server has internet connection.', 'forminator' )
|
207 |
);
|
208 |
}
|
209 |
|
217 |
|
218 |
if ( 404 === $status_code ) {
|
219 |
/* translators: ... */
|
220 |
+
throw new Forminator_Addon_Zapier_Wp_Api_Not_Found_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
221 |
}
|
222 |
/* translators: ... */
|
223 |
+
throw new Forminator_Addon_Zapier_Wp_Api_Exception( sprintf( __( 'Failed to process request : %s', 'forminator' ), $msg ) );
|
224 |
}
|
225 |
}
|
226 |
|
addons/pro/zapier/views/poll-settings/setup-webhook.php
CHANGED
@@ -16,19 +16,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php esc_html_e( 'Setup Webhook',
|
20 |
-
<p><?php esc_html_e( 'Put your ZAP Webhook URL below. ',
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<?php endif; ?>
|
24 |
</div>
|
25 |
<form enctype="multipart/form-data">
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
-
<label class="sui-label"><?php esc_html_e( 'Zapier Integration Name',
|
28 |
<div class="sui-control-with-icon">
|
29 |
<input type="text"
|
30 |
name="name"
|
31 |
-
placeholder="<?php esc_attr_e( 'Friendly Name',
|
32 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
33 |
class="sui-form-control"
|
34 |
/>
|
@@ -39,12 +39,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
39 |
<?php endif; ?>
|
40 |
</div>
|
41 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['webhook_url_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
42 |
-
<label class="sui-label"><?php esc_html_e( 'Webhook URL',
|
43 |
<div class="sui-control-with-icon">
|
44 |
<input
|
45 |
type="text"
|
46 |
name="webhook_url"
|
47 |
-
placeholder="<?php esc_attr_e( 'Webhook URL',
|
48 |
value="<?php echo esc_attr( $vars['webhook_url'] ); ?>"
|
49 |
class="sui-form-control"/>
|
50 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
@@ -59,7 +59,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
59 |
<p>
|
60 |
<?php
|
61 |
echo sprintf(/* translators: ... */
|
62 |
-
esc_html__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$sWebhooks by Zapier%4$s as Trigger App.',
|
63 |
'<a href="' . esc_url( $vars['new_zap_url'] ) . '" target="_blank">',
|
64 |
'</a>',
|
65 |
'<strong>',
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php esc_html_e( 'Setup Webhook', 'forminator' ); ?></h3>
|
20 |
+
<p><?php esc_html_e( 'Put your ZAP Webhook URL below. ', 'forminator' ); ?></p>
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<?php endif; ?>
|
24 |
</div>
|
25 |
<form enctype="multipart/form-data">
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
+
<label class="sui-label"><?php esc_html_e( 'Zapier Integration Name', 'forminator' ); ?></label>
|
28 |
<div class="sui-control-with-icon">
|
29 |
<input type="text"
|
30 |
name="name"
|
31 |
+
placeholder="<?php esc_attr_e( 'Friendly Name', 'forminator' ); ?>"
|
32 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
33 |
class="sui-form-control"
|
34 |
/>
|
39 |
<?php endif; ?>
|
40 |
</div>
|
41 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['webhook_url_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
42 |
+
<label class="sui-label"><?php esc_html_e( 'Webhook URL', 'forminator' ); ?></label>
|
43 |
<div class="sui-control-with-icon">
|
44 |
<input
|
45 |
type="text"
|
46 |
name="webhook_url"
|
47 |
+
placeholder="<?php esc_attr_e( 'Webhook URL', 'forminator' ); ?>"
|
48 |
value="<?php echo esc_attr( $vars['webhook_url'] ); ?>"
|
49 |
class="sui-form-control"/>
|
50 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
59 |
<p>
|
60 |
<?php
|
61 |
echo sprintf(/* translators: ... */
|
62 |
+
esc_html__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$sWebhooks by Zapier%4$s as Trigger App.', 'forminator' ),
|
63 |
'<a href="' . esc_url( $vars['new_zap_url'] ) . '" target="_blank">',
|
64 |
'</a>',
|
65 |
'<strong>',
|
addons/pro/zapier/views/quiz-settings/setup-webhook.php
CHANGED
@@ -16,19 +16,19 @@ foreach ( $template_vars as $key => $val ) {
|
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
-
<h3 class="sui-box-title" id="dialogTitle2"><?php esc_html_e( 'Setup Webhook',
|
20 |
-
<p><?php esc_html_e( 'Put your ZAP Webhook URL below. ',
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<?php endif; ?>
|
24 |
</div>
|
25 |
<form enctype="multipart/form-data">
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
-
<label class="sui-label"><?php esc_html_e( 'Zapier Integration Name',
|
28 |
<div class="sui-control-with-icon">
|
29 |
<input type="text"
|
30 |
name="name"
|
31 |
-
placeholder="<?php esc_attr_e( 'Friendly Name',
|
32 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
33 |
class="sui-form-control"
|
34 |
/>
|
@@ -39,12 +39,12 @@ foreach ( $template_vars as $key => $val ) {
|
|
39 |
<?php endif; ?>
|
40 |
</div>
|
41 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['webhook_url_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
42 |
-
<label class="sui-label"><?php esc_html_e( 'Webhook URL',
|
43 |
<div class="sui-control-with-icon">
|
44 |
<input
|
45 |
type="text"
|
46 |
name="webhook_url"
|
47 |
-
placeholder="<?php esc_attr_e( 'Webhook URL',
|
48 |
value="<?php echo esc_attr( $vars['webhook_url'] ); ?>"
|
49 |
class="sui-form-control"/>
|
50 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
@@ -59,7 +59,7 @@ foreach ( $template_vars as $key => $val ) {
|
|
59 |
<p>
|
60 |
<?php
|
61 |
echo sprintf(/* translators: ... */
|
62 |
-
esc_html__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$sWebhooks by Zapier%4$s as Trigger App.',
|
63 |
'<a href="' . esc_url( $vars['new_zap_url'] ) . '" target="_blank">',
|
64 |
'</a>',
|
65 |
'<strong>',
|
16 |
|
17 |
?>
|
18 |
<div class="integration-header">
|
19 |
+
<h3 class="sui-box-title" id="dialogTitle2"><?php esc_html_e( 'Setup Webhook', 'forminator' ); ?></h3>
|
20 |
+
<p><?php esc_html_e( 'Put your ZAP Webhook URL below. ', 'forminator' ); ?></p>
|
21 |
<?php if ( ! empty( $vars['error_message'] ) ) : ?>
|
22 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $vars['error_message'] ); ?></p></span>
|
23 |
<?php endif; ?>
|
24 |
</div>
|
25 |
<form enctype="multipart/form-data">
|
26 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['name_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
27 |
+
<label class="sui-label"><?php esc_html_e( 'Zapier Integration Name', 'forminator' ); ?></label>
|
28 |
<div class="sui-control-with-icon">
|
29 |
<input type="text"
|
30 |
name="name"
|
31 |
+
placeholder="<?php esc_attr_e( 'Friendly Name', 'forminator' ); ?>"
|
32 |
value="<?php echo esc_attr( $vars['name'] ); ?>"
|
33 |
class="sui-form-control"
|
34 |
/>
|
39 |
<?php endif; ?>
|
40 |
</div>
|
41 |
<div class="sui-form-field <?php echo esc_attr( ! empty( $vars['webhook_url_error'] ) ? 'sui-form-field-error' : '' ); ?>">
|
42 |
+
<label class="sui-label"><?php esc_html_e( 'Webhook URL', 'forminator' ); ?></label>
|
43 |
<div class="sui-control-with-icon">
|
44 |
<input
|
45 |
type="text"
|
46 |
name="webhook_url"
|
47 |
+
placeholder="<?php esc_attr_e( 'Webhook URL', 'forminator' ); ?>"
|
48 |
value="<?php echo esc_attr( $vars['webhook_url'] ); ?>"
|
49 |
class="sui-form-control"/>
|
50 |
<i class="sui-icon-link" aria-hidden="true"></i>
|
59 |
<p>
|
60 |
<?php
|
61 |
echo sprintf(/* translators: ... */
|
62 |
+
esc_html__( 'Please go %1$shere%2$s if you do not have any ZAP created. Remember to choose %3$sWebhooks by Zapier%4$s as Trigger App.', 'forminator' ),
|
63 |
'<a href="' . esc_url( $vars['new_zap_url'] ) . '" target="_blank">',
|
64 |
'</a>',
|
65 |
'<strong>',
|
addons/pro/zapier/views/settings/setup-connect-success.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
-
echo esc_html( sprintf( __( '%1$s Added',
|
6 |
?>
|
7 |
</h3>
|
8 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration',
|
9 |
</div>
|
2 |
<h3 class="sui-box-title" id="dialogTitle2">
|
3 |
<?php
|
4 |
/* translators: ... */
|
5 |
+
echo esc_html( sprintf( __( '%1$s Added', 'forminator' ), 'Zapier' ) );
|
6 |
?>
|
7 |
</h3>
|
8 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'You can now go to your forms and assign them to this integration', 'forminator' ); ?></span>
|
9 |
</div>
|
addons/pro/zapier/views/settings/setup-connect.php
CHANGED
@@ -15,15 +15,15 @@ foreach ( $template_vars as $key => $val ) {
|
|
15 |
<h3 id="dialogTitle2" class="sui-box-title">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
-
echo esc_html( sprintf( __( 'Activate %1$s',
|
19 |
?>
|
20 |
</h3>
|
21 |
|
22 |
-
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Activate Zapier to start using it on your forms.',
|
23 |
|
24 |
<?php if ( ! empty( $vars['is_connected'] ) ) : ?>
|
25 |
<div class="sui-notice sui-notice-success" style="text-align: left;">
|
26 |
-
<p><?php esc_html_e( 'Zapier is already active.',
|
27 |
</div>
|
28 |
<?php endif; ?>
|
29 |
|
15 |
<h3 id="dialogTitle2" class="sui-box-title">
|
16 |
<?php
|
17 |
/* translators: ... */
|
18 |
+
echo esc_html( sprintf( __( 'Activate %1$s', 'forminator' ), 'Zapier' ) );
|
19 |
?>
|
20 |
</h3>
|
21 |
|
22 |
+
<span class="sui-description" style="margin-top: 20px;"><?php esc_html_e( 'Activate Zapier to start using it on your forms.', 'forminator' ); ?></span>
|
23 |
|
24 |
<?php if ( ! empty( $vars['is_connected'] ) ) : ?>
|
25 |
<div class="sui-notice sui-notice-success" style="text-align: left;">
|
26 |
+
<p><?php esc_html_e( 'Zapier is already active.', 'forminator' ); ?></p>
|
27 |
</div>
|
28 |
<?php endif; ?>
|
29 |
|
admin/abstracts/class-admin-import-mediator.php
CHANGED
@@ -231,24 +231,24 @@ abstract class Forminator_Import_Mediator {
|
|
231 |
public function try_form_import( $import_data ) {
|
232 |
try {
|
233 |
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
234 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.',
|
235 |
}
|
236 |
|
237 |
if ( ! isset( $import_data['type'] ) || 'form' !== $import_data['type'] ) {
|
238 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.',
|
239 |
}
|
240 |
|
241 |
$import_data = $this->parse_import_data( $import_data );
|
242 |
|
243 |
-
$model =
|
244 |
|
245 |
|
246 |
if ( is_wp_error( $model ) ) {
|
247 |
throw new Exception( $model->get_error_message() );
|
248 |
}
|
249 |
|
250 |
-
if ( ! $model instanceof
|
251 |
-
throw new Exception( __( 'Failed to import form, please make sure import text is valid, and try again.',
|
252 |
}
|
253 |
|
254 |
$return_url = admin_url( 'admin.php?page=forminator-cform' );
|
231 |
public function try_form_import( $import_data ) {
|
232 |
try {
|
233 |
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
234 |
+
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', 'forminator' ) );
|
235 |
}
|
236 |
|
237 |
if ( ! isset( $import_data['type'] ) || 'form' !== $import_data['type'] ) {
|
238 |
+
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', 'forminator' ) );
|
239 |
}
|
240 |
|
241 |
$import_data = $this->parse_import_data( $import_data );
|
242 |
|
243 |
+
$model = Forminator_Form_Model::create_from_import_data( $import_data );
|
244 |
|
245 |
|
246 |
if ( is_wp_error( $model ) ) {
|
247 |
throw new Exception( $model->get_error_message() );
|
248 |
}
|
249 |
|
250 |
+
if ( ! $model instanceof Forminator_Form_Model ) {
|
251 |
+
throw new Exception( __( 'Failed to import form, please make sure import text is valid, and try again.', 'forminator' ) );
|
252 |
}
|
253 |
|
254 |
$return_url = admin_url( 'admin.php?page=forminator-cform' );
|
admin/abstracts/class-admin-module-edit-page.php
CHANGED
@@ -10,6 +10,545 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
*/
|
11 |
abstract class Forminator_Admin_Module_Edit_Page extends Forminator_Admin_Page {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Reset views data
|
15 |
*
|
10 |
*/
|
11 |
abstract class Forminator_Admin_Module_Edit_Page extends Forminator_Admin_Page {
|
12 |
|
13 |
+
/**
|
14 |
+
* Page number
|
15 |
+
*
|
16 |
+
* @var int
|
17 |
+
*/
|
18 |
+
protected $page_number = 1;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Initialize
|
22 |
+
*
|
23 |
+
* @since 1.0
|
24 |
+
*/
|
25 |
+
public function init() {
|
26 |
+
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; // WPCS: CSRF OK
|
27 |
+
$this->page_number = max( 1, $pagenum );
|
28 |
+
$this->processRequest();
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Trigger before render
|
33 |
+
*/
|
34 |
+
public function before_render() {
|
35 |
+
wp_enqueue_script( 'forminator-chart', forminator_plugin_url() . 'assets/js/library/Chart.bundle.min.js', array( 'jquery' ), '2.7.2', false );
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Count modules
|
40 |
+
*
|
41 |
+
* @param string $status Modules status.
|
42 |
+
* @since 1.0
|
43 |
+
* @return int
|
44 |
+
*/
|
45 |
+
public function countModules( $status = '' ) {
|
46 |
+
$class_name = 'Forminator_' . forminator_get_prefix( static::$module_slug, '', true ) . '_Model';
|
47 |
+
return $class_name::model()->count_all( $status );
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Get modules
|
52 |
+
*
|
53 |
+
* @since 1.0
|
54 |
+
* @return array
|
55 |
+
*/
|
56 |
+
public function getModules( $search_keyword = null ) {
|
57 |
+
$modules = array();
|
58 |
+
$limit = null;
|
59 |
+
$const = 'FORMINATOR_' . strtoupper( static::$module_slug ) . '_LIST_LIMIT';
|
60 |
+
if ( defined( $const ) && constant( $const ) ) {
|
61 |
+
$limit = constant( $const );
|
62 |
+
}
|
63 |
+
if ( ! is_null( $search_keyword ) ) {
|
64 |
+
$limit = -1;
|
65 |
+
}
|
66 |
+
$data = $this->get_models( $limit );
|
67 |
+
$form_view = Forminator_Form_Views_Model::get_instance();
|
68 |
+
|
69 |
+
// Fallback
|
70 |
+
if ( ! isset( $data['models'] ) || empty( $data['models'] ) ) {
|
71 |
+
return $modules;
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( ! is_null( $search_keyword ) ) {
|
75 |
+
$search_keyword = explode( " ", $search_keyword );
|
76 |
+
}
|
77 |
+
|
78 |
+
foreach ( $data['models'] as $model ) {
|
79 |
+
|
80 |
+
// Form search
|
81 |
+
if ( ! is_null( $search_keyword ) ) {
|
82 |
+
|
83 |
+
foreach ( $search_keyword as $keyword ) {
|
84 |
+
// If found
|
85 |
+
if ( false !== stripos( $model->settings['formName'], $keyword ) ) {
|
86 |
+
$modules[] = $this->module_array(
|
87 |
+
$model->id,
|
88 |
+
$model->name,
|
89 |
+
$form_view->count_views( $model->id ),
|
90 |
+
date( get_option( 'date_format' ), strtotime( $model->raw->post_date ) ),
|
91 |
+
$model->status,
|
92 |
+
$model
|
93 |
+
);
|
94 |
+
// prevent duplicates
|
95 |
+
break;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
// Display modules
|
100 |
+
} else {
|
101 |
+
$modules[] = $this->module_array(
|
102 |
+
$model->id,
|
103 |
+
$model->name,
|
104 |
+
$form_view->count_views( $model->id ),
|
105 |
+
date( get_option( 'date_format' ), strtotime( $model->raw->post_date ) ),
|
106 |
+
$model->status,
|
107 |
+
$model
|
108 |
+
);
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
return $modules;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Calculate rate
|
117 |
+
*
|
118 |
+
* @since 1.0
|
119 |
+
*
|
120 |
+
* @param $module
|
121 |
+
*
|
122 |
+
* @return float|int
|
123 |
+
*/
|
124 |
+
public function getRate( $module ) {
|
125 |
+
if ( $module['views'] > 0 ) {
|
126 |
+
$rate = round( ( $module["entries"] * 100 ) / $module["views"], 1 );
|
127 |
+
} else {
|
128 |
+
$rate = 0;
|
129 |
+
}
|
130 |
+
|
131 |
+
return $rate;
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Pagination
|
136 |
+
*
|
137 |
+
* @since 1.0
|
138 |
+
*/
|
139 |
+
public function pagination( $is_search, $count ) {
|
140 |
+
echo '<span class="sui-pagination-results">'
|
141 |
+
/* translators: ... */
|
142 |
+
. esc_html( sprintf( _n( '%s result', '%s results', $count, 'forminator' ), $count ) )
|
143 |
+
. '</span>';
|
144 |
+
|
145 |
+
if ( $is_search ) {
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
forminator_list_pagination( $count );
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Get models
|
153 |
+
*
|
154 |
+
* @since 1.0
|
155 |
+
* @since 1.6 add $limit
|
156 |
+
* @param int $limit
|
157 |
+
*
|
158 |
+
* @return array
|
159 |
+
*/
|
160 |
+
public function get_models( $limit = null ) {
|
161 |
+
$class_name = 'Forminator_' . forminator_get_prefix( static::$module_slug, '', true ) . '_Model';
|
162 |
+
$data = $class_name::model()->get_all_paged( $this->page_number, $limit );
|
163 |
+
|
164 |
+
return $data;
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Clone Module
|
169 |
+
*
|
170 |
+
* @since 1.6
|
171 |
+
*
|
172 |
+
* @param $id
|
173 |
+
*/
|
174 |
+
public function clone_module( $id ) {
|
175 |
+
//check if this id is valid and the record is exists
|
176 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
177 |
+
|
178 |
+
if ( is_object( $model ) ) {
|
179 |
+
//create one
|
180 |
+
//reset id
|
181 |
+
$model->id = null;
|
182 |
+
|
183 |
+
//update title
|
184 |
+
if ( isset( $model->settings['formName'] ) ) {
|
185 |
+
$model->settings['formName'] = sprintf( __( "Copy of %s", 'forminator' ), $model->settings['formName'] );
|
186 |
+
}
|
187 |
+
|
188 |
+
//save it to create new record
|
189 |
+
$new_id = $model->save( true );
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Action called after module cloned
|
193 |
+
*
|
194 |
+
* @since 1.11
|
195 |
+
*
|
196 |
+
* @param int $id - module id
|
197 |
+
* @param object $model - module model
|
198 |
+
*
|
199 |
+
*/
|
200 |
+
do_action( 'forminator_' . static::$module_slug . '_action_clone', $new_id, $model );
|
201 |
+
|
202 |
+
$function = 'forminator_clone_' . static::$module_slug . '_submissions_retention';
|
203 |
+
if ( function_exists( $function ) ) {
|
204 |
+
$function( $id, $new_id );
|
205 |
+
}
|
206 |
+
|
207 |
+
// Purge count forms cache
|
208 |
+
$cache_prefix = 'forminator_' . static::$module_slug . '_total_entries';
|
209 |
+
wp_cache_delete( $cache_prefix, $cache_prefix );
|
210 |
+
wp_cache_delete( $cache_prefix . '_publish', $cache_prefix . '_publish' );
|
211 |
+
wp_cache_delete( $cache_prefix . '_draft', $cache_prefix . '_draft' );
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Delete module
|
217 |
+
*
|
218 |
+
* @since 1.6
|
219 |
+
*
|
220 |
+
* @param $id
|
221 |
+
*/
|
222 |
+
public function delete_module( $id ) {
|
223 |
+
//check if this id is valid and the record is exists
|
224 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
225 |
+
if ( is_object( $model ) ) {
|
226 |
+
Forminator_Form_Entry_Model::delete_by_form( $id );
|
227 |
+
$form_view = Forminator_Form_Views_Model::get_instance();
|
228 |
+
$form_view->delete_by_form( $id );
|
229 |
+
|
230 |
+
$function = 'forminator_update_' . static::$module_slug . '_submissions_retention';
|
231 |
+
if ( function_exists( $function ) ) {
|
232 |
+
$function( $id, null, null );
|
233 |
+
}
|
234 |
+
wp_delete_post( $id );
|
235 |
+
|
236 |
+
// Purge count forms cache
|
237 |
+
$cache_prefix = 'forminator_' . static::$module_slug . '_total_entries';
|
238 |
+
wp_cache_delete( $cache_prefix, $cache_prefix );
|
239 |
+
wp_cache_delete( $cache_prefix . '_publish', $cache_prefix . '_publish' );
|
240 |
+
wp_cache_delete( $cache_prefix . '_draft', $cache_prefix . '_draft' );
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Action called after module deleted
|
244 |
+
*
|
245 |
+
* @since 1.11
|
246 |
+
*
|
247 |
+
* @param int $id - module id
|
248 |
+
*
|
249 |
+
*/
|
250 |
+
do_action( 'forminator_' . static::$module_slug . '_action_delete', $id );
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Delete module entries
|
256 |
+
*
|
257 |
+
* @since 1.6
|
258 |
+
*
|
259 |
+
* @param $id
|
260 |
+
*/
|
261 |
+
public function delete_module_entries( $id ) {
|
262 |
+
//check if this id is valid and the record is exists
|
263 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
264 |
+
if ( is_object( $model ) ) {
|
265 |
+
Forminator_Form_Entry_Model::delete_by_form( $id );
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* Export module
|
271 |
+
*
|
272 |
+
* @since 1.6
|
273 |
+
*
|
274 |
+
* @param $id
|
275 |
+
*/
|
276 |
+
public function export_module( $id ) {
|
277 |
+
|
278 |
+
$exportable = array();
|
279 |
+
$model_name = '';
|
280 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
281 |
+
if ( $model instanceof Forminator_Base_Form_Model ) {
|
282 |
+
$model_name = $model->name;
|
283 |
+
$exportable = $model->to_exportable_data();
|
284 |
+
}
|
285 |
+
$encoded = wp_json_encode( $exportable );
|
286 |
+
$fp = fopen( 'php://memory', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen
|
287 |
+
fwrite( $fp, $encoded ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
|
288 |
+
fseek( $fp, 0 );
|
289 |
+
|
290 |
+
$filename = sanitize_title( __( 'forminator', 'forminator' ) ) . '-' . sanitize_title( $model_name ) . '-' . static::$module_slug . '-export' . '.txt';
|
291 |
+
|
292 |
+
header( 'Content-Description: File Transfer' );
|
293 |
+
header( 'Content-Type: text/plain' );
|
294 |
+
header( 'Content-Disposition: attachment; filename="' . basename( $filename ) . '"' );
|
295 |
+
header( 'Cache-Control: must-revalidate' );
|
296 |
+
header( 'Content-Length: ' . strlen( $encoded ) );
|
297 |
+
|
298 |
+
// make php send the generated csv lines to the browser
|
299 |
+
fpassthru( $fp );
|
300 |
+
}
|
301 |
+
|
302 |
+
/**
|
303 |
+
* Override scripts to be loaded
|
304 |
+
*
|
305 |
+
* @since 1.11
|
306 |
+
*
|
307 |
+
* @param $hook
|
308 |
+
*/
|
309 |
+
public function enqueue_scripts( $hook ) {
|
310 |
+
parent::enqueue_scripts( $hook );
|
311 |
+
|
312 |
+
forminator_print_front_styles();
|
313 |
+
forminator_print_front_scripts();
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Process request
|
318 |
+
*
|
319 |
+
* @since 1.0
|
320 |
+
*/
|
321 |
+
public function processRequest() {
|
322 |
+
if ( ! isset( $_POST['forminator_action'] ) ) {
|
323 |
+
return;
|
324 |
+
}
|
325 |
+
// Check if the page is not the relevant module type page and not forminator dashboard page.
|
326 |
+
if ( ! isset( $_REQUEST['page'] ) || ( 'forminator-' . forminator_get_prefix( static::$module_slug, 'c' ) !== $_REQUEST['page'] && 'forminator' !== $_REQUEST['page'] ) ) {
|
327 |
+
return;
|
328 |
+
}
|
329 |
+
// In forminator dashboard, check if form type is not the relevant module type.
|
330 |
+
if ( 'forminator' === $_REQUEST['page'] && isset( $_REQUEST['form_type'] ) && forminator_get_prefix( static::$module_slug, 'custom-' ) !== $_REQUEST['form_type'] ) {
|
331 |
+
return;
|
332 |
+
}
|
333 |
+
|
334 |
+
$action = isset( $_POST['forminator_action'] ) ? $_POST['forminator_action'] : '';
|
335 |
+
$id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : 0;
|
336 |
+
// Set nonce names first for verification.
|
337 |
+
switch ( $action ) {
|
338 |
+
case 'clone':
|
339 |
+
$nonce_name = 'forminatorNonce';
|
340 |
+
$nonce_action = 'forminator-nonce-clone-' . $id;
|
341 |
+
break;
|
342 |
+
|
343 |
+
case 'reset-views':
|
344 |
+
$nonce_name = 'forminatorNonce';
|
345 |
+
$nonce_action = 'forminator-nonce-reset-views-' . $id;
|
346 |
+
break;
|
347 |
+
|
348 |
+
case 'update-status' :
|
349 |
+
$nonce_name = 'forminator-nonce-update-status-' . $id;
|
350 |
+
$nonce_action = $nonce_name;
|
351 |
+
break;
|
352 |
+
|
353 |
+
default:
|
354 |
+
$nonce_name = 'forminatorNonce';
|
355 |
+
$nonce_action = 'forminator_' . static::$module_slug . '_request';
|
356 |
+
break;
|
357 |
+
}
|
358 |
+
|
359 |
+
// Verify nonce.
|
360 |
+
if ( ! isset( $_POST[ $nonce_name ] ) || ! wp_verify_nonce( $_POST[ $nonce_name ], $nonce_action ) ) {
|
361 |
+
return;
|
362 |
+
}
|
363 |
+
|
364 |
+
$plural_slug = forminator_get_prefix( static::$module_slug, '', false, true );
|
365 |
+
$is_redirect = true;
|
366 |
+
$ids = isset( $_POST['ids'] ) ? $_POST['ids'] : '';
|
367 |
+
switch ( $action ) {
|
368 |
+
case 'delete':
|
369 |
+
if ( ! empty( $id ) ) {
|
370 |
+
$this->delete_module( $id );
|
371 |
+
$notice = static::$module_slug . '_deleted';
|
372 |
+
}
|
373 |
+
break;
|
374 |
+
|
375 |
+
case 'clone':
|
376 |
+
if ( ! empty( $id ) ) {
|
377 |
+
$this->clone_module( $id );
|
378 |
+
$notice = static::$module_slug . '_duplicated';
|
379 |
+
}
|
380 |
+
break;
|
381 |
+
|
382 |
+
case 'reset-views' :
|
383 |
+
if ( ! empty( $id ) ) {
|
384 |
+
self::reset_module_views( $id );
|
385 |
+
$notice = static::$module_slug . '_reset';
|
386 |
+
}
|
387 |
+
break;
|
388 |
+
|
389 |
+
case 'delete-votes' :
|
390 |
+
case 'delete-entries' :
|
391 |
+
if ( ! empty( $id ) ) {
|
392 |
+
$this->delete_module_entries( $id );
|
393 |
+
}
|
394 |
+
break;
|
395 |
+
|
396 |
+
case 'export':
|
397 |
+
if ( ! empty( $id ) ) {
|
398 |
+
$this->export_module( $id );
|
399 |
+
}
|
400 |
+
$is_redirect = false;
|
401 |
+
break;
|
402 |
+
|
403 |
+
case 'delete-' . $plural_slug :
|
404 |
+
if ( ! empty( $ids ) ) {
|
405 |
+
$module_ids = explode( ',', $ids );
|
406 |
+
if ( is_array( $module_ids ) && count( $module_ids ) > 0 ) {
|
407 |
+
foreach ( $module_ids as $id ) {
|
408 |
+
$this->delete_module( $id );
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
break;
|
413 |
+
|
414 |
+
case 'delete-votes-polls' :
|
415 |
+
case 'delete-entries-' . $plural_slug :
|
416 |
+
if ( ! empty( $ids ) ) {
|
417 |
+
$form_ids = explode( ',', $ids );
|
418 |
+
if ( is_array( $form_ids ) && count( $form_ids ) > 0 ) {
|
419 |
+
foreach ( $form_ids as $id ) {
|
420 |
+
$this->delete_module_entries( $id );
|
421 |
+
}
|
422 |
+
}
|
423 |
+
}
|
424 |
+
break;
|
425 |
+
|
426 |
+
case 'clone-' . $plural_slug :
|
427 |
+
if ( ! empty( $ids ) ) {
|
428 |
+
$module_ids = explode( ',', $ids );
|
429 |
+
if ( is_array( $module_ids ) && count( $module_ids ) > 0 ) {
|
430 |
+
foreach ( $module_ids as $id ) {
|
431 |
+
$this->clone_module( $id );
|
432 |
+
}
|
433 |
+
}
|
434 |
+
}
|
435 |
+
break;
|
436 |
+
|
437 |
+
case 'reset-views-' . $plural_slug :
|
438 |
+
if ( ! empty( $ids ) ) {
|
439 |
+
$form_ids = explode( ',', $ids );
|
440 |
+
if ( is_array( $form_ids ) && count( $form_ids ) > 0 ) {
|
441 |
+
foreach ( $form_ids as $id ) {
|
442 |
+
self::reset_module_views( $id );
|
443 |
+
}
|
444 |
+
}
|
445 |
+
}
|
446 |
+
break;
|
447 |
+
|
448 |
+
case 'update-status' :
|
449 |
+
$status = isset( $_POST['status'] ) ? sanitize_text_field( $_POST['status'] ) : '';
|
450 |
+
|
451 |
+
if ( ! empty( $id ) && ! empty( $status ) ) {
|
452 |
+
// only publish and draft status avail
|
453 |
+
if ( in_array( $status, array( 'publish', 'draft' ), true ) ) {
|
454 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
455 |
+
if ( $model instanceof Forminator_Base_Form_Model ) {
|
456 |
+
$model->status = $status;
|
457 |
+
$model->save();
|
458 |
+
}
|
459 |
+
}
|
460 |
+
}
|
461 |
+
break;
|
462 |
+
case 'update-statuses' :
|
463 |
+
$status = isset( $_POST['status'] ) ? sanitize_text_field( $_POST['status'] ) : '';
|
464 |
+
|
465 |
+
if ( ! empty( $ids ) && ! empty( $status ) ) {
|
466 |
+
// only publish and draft status avail
|
467 |
+
if ( in_array( $status, array( 'publish', 'draft' ), true ) ) {
|
468 |
+
$form_ids = explode( ',', $ids );
|
469 |
+
if ( is_array( $form_ids ) && count( $form_ids ) > 0 ) {
|
470 |
+
foreach ( $form_ids as $id ) {
|
471 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
472 |
+
if ( $model instanceof Forminator_Base_Form_Model ) {
|
473 |
+
$model->status = $status;
|
474 |
+
$model->save();
|
475 |
+
}
|
476 |
+
}
|
477 |
+
}
|
478 |
+
}
|
479 |
+
}
|
480 |
+
break;
|
481 |
+
|
482 |
+
case 'draft-forms' :
|
483 |
+
if ( ! empty( $ids ) ) {
|
484 |
+
$form_ids = explode( ',', $ids );
|
485 |
+
if ( is_array( $form_ids ) && count( $form_ids ) > 0 ) {
|
486 |
+
foreach ( $form_ids as $form_id ) {
|
487 |
+
$this->update_module_status( $form_id, 'draft' );
|
488 |
+
}
|
489 |
+
}
|
490 |
+
}
|
491 |
+
break;
|
492 |
+
|
493 |
+
case 'publish-forms' :
|
494 |
+
if ( ! empty( $ids ) ) {
|
495 |
+
$form_ids = explode( ',', $ids );
|
496 |
+
if ( is_array( $form_ids ) && count( $form_ids ) > 0 ) {
|
497 |
+
foreach ( $form_ids as $form_id ) {
|
498 |
+
$this->update_module_status( $form_id, 'publish' );
|
499 |
+
}
|
500 |
+
}
|
501 |
+
}
|
502 |
+
break;
|
503 |
+
|
504 |
+
default:
|
505 |
+
break;
|
506 |
+
}
|
507 |
+
|
508 |
+
if ( $is_redirect ) {
|
509 |
+
$to_referer = true;
|
510 |
+
|
511 |
+
if ( isset( $_POST['forminatorRedirect' ] ) && "false" === $_POST['forminatorRedirect' ] ) {
|
512 |
+
$to_referer = false;
|
513 |
+
}
|
514 |
+
|
515 |
+
$args = array(
|
516 |
+
'page' => $this->get_admin_page(),
|
517 |
+
);
|
518 |
+
if ( ! empty( $notice ) ) {
|
519 |
+
$args['forminator_notice'] = $notice;
|
520 |
+
$to_referer = false;
|
521 |
+
}
|
522 |
+
$fallback_redirect = add_query_arg(
|
523 |
+
$args,
|
524 |
+
admin_url( 'admin.php' )
|
525 |
+
);
|
526 |
+
|
527 |
+
$this->maybe_redirect_to_referer( $fallback_redirect, $to_referer );
|
528 |
+
}
|
529 |
+
|
530 |
+
exit;
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Update Module Status
|
535 |
+
*
|
536 |
+
* @since 1.6
|
537 |
+
*
|
538 |
+
* @param $id
|
539 |
+
* @param $status
|
540 |
+
*/
|
541 |
+
public function update_module_status( $id, $status ) {
|
542 |
+
// only publish and draft status avail
|
543 |
+
if ( in_array( $status, array( 'publish', 'draft' ), true ) ) {
|
544 |
+
$model = Forminator_Base_Form_Model::get_model( $id );
|
545 |
+
if ( $model instanceof Forminator_Base_Form_Model ) {
|
546 |
+
$model->status = $status;
|
547 |
+
$model->save();
|
548 |
+
}
|
549 |
+
}
|
550 |
+
}
|
551 |
+
|
552 |
/**
|
553 |
* Reset views data
|
554 |
*
|
admin/abstracts/class-admin-module.php
CHANGED
@@ -30,6 +30,11 @@ abstract class Forminator_Admin_Module {
|
|
30 |
*/
|
31 |
public $page_entries = '';
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
/**
|
34 |
* Forminator_Admin_Module constructor.
|
35 |
*
|
@@ -77,14 +82,22 @@ abstract class Forminator_Admin_Module {
|
|
77 |
*
|
78 |
* @since 1.0
|
79 |
*/
|
80 |
-
public function hide_menu_pages() {
|
|
|
|
|
|
|
81 |
|
82 |
/**
|
83 |
* Used to include files
|
84 |
*
|
85 |
* @since 1.0
|
86 |
*/
|
87 |
-
public function includes() {
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
/**
|
90 |
* Inject module options to JS
|
30 |
*/
|
31 |
public $page_entries = '';
|
32 |
|
33 |
+
/**
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
public $dir = '';
|
37 |
+
|
38 |
/**
|
39 |
* Forminator_Admin_Module constructor.
|
40 |
*
|
82 |
*
|
83 |
* @since 1.0
|
84 |
*/
|
85 |
+
public function hide_menu_pages() {
|
86 |
+
remove_submenu_page( 'forminator', $this->page_edit );
|
87 |
+
remove_submenu_page( 'forminator', $this->page_entries );
|
88 |
+
}
|
89 |
|
90 |
/**
|
91 |
* Used to include files
|
92 |
*
|
93 |
* @since 1.0
|
94 |
*/
|
95 |
+
public function includes() {
|
96 |
+
include_once $this->dir . '/admin-page-new.php';
|
97 |
+
include_once $this->dir . '/admin-page-view.php';
|
98 |
+
include_once $this->dir . '/admin-page-entries.php';
|
99 |
+
include_once $this->dir . '/admin-renderer-entries.php';
|
100 |
+
}
|
101 |
|
102 |
/**
|
103 |
* Inject module options to JS
|
admin/abstracts/class-admin-page.php
CHANGED
@@ -31,13 +31,6 @@ abstract class Forminator_Admin_Page {
|
|
31 |
*/
|
32 |
protected $folder = '';
|
33 |
|
34 |
-
/**
|
35 |
-
* All registered content boxes
|
36 |
-
*
|
37 |
-
* @var array
|
38 |
-
*/
|
39 |
-
protected $content_boxes = array();
|
40 |
-
|
41 |
/**
|
42 |
* @since 1.0
|
43 |
*
|
@@ -108,7 +101,6 @@ abstract class Forminator_Admin_Page {
|
|
108 |
* @since 1.0
|
109 |
*/
|
110 |
public function render_page_hooks() {
|
111 |
-
add_action( 'load-' . $this->page_id, array( $this, 'register_content_boxes' ) );
|
112 |
add_action( 'load-' . $this->page_id, array( $this, 'before_render' ) );
|
113 |
add_action( 'load-' . $this->page_id, array( $this, 'trigger_before_render_action' ) );
|
114 |
add_filter( 'load-' . $this->page_id, array( $this, 'add_page_hooks' ) );
|
@@ -124,14 +116,6 @@ abstract class Forminator_Admin_Page {
|
|
124 |
return $this->page_slug;
|
125 |
}
|
126 |
|
127 |
-
/**
|
128 |
-
* Used to register content boxes for the page
|
129 |
-
*
|
130 |
-
* @since 1.0
|
131 |
-
*/
|
132 |
-
public function register_content_boxes() {
|
133 |
-
}
|
134 |
-
|
135 |
/**
|
136 |
* Called when page is loaded and content not rendered yet
|
137 |
*
|
@@ -181,27 +165,20 @@ abstract class Forminator_Admin_Page {
|
|
181 |
* @param $hook
|
182 |
*/
|
183 |
public function enqueue_scripts( $hook ) {
|
184 |
-
// Load jquery ui
|
185 |
-
forminator_admin_jquery_ui();
|
186 |
-
|
187 |
-
// Load shared-ui scripts
|
188 |
-
forminator_sui_scripts();
|
189 |
-
|
190 |
-
// Load admin fonts
|
191 |
-
forminator_admin_enqueue_fonts( FORMINATOR_VERSION );
|
192 |
-
|
193 |
-
// Load admin styles
|
194 |
-
forminator_admin_enqueue_styles( FORMINATOR_VERSION );
|
195 |
-
|
196 |
-
$forminator_data = new Forminator_Admin_Data();
|
197 |
-
$forminator_l10n = new Forminator_Admin_L10n();
|
198 |
-
|
199 |
// Load admin scripts
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
FORMINATOR_VERSION,
|
202 |
-
|
203 |
-
$forminator_l10n->get_l10n_strings()
|
204 |
);
|
|
|
205 |
}
|
206 |
|
207 |
/**
|
@@ -222,20 +199,15 @@ abstract class Forminator_Admin_Page {
|
|
222 |
* @since 1.0
|
223 |
*/
|
224 |
protected function render_header() {
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
$this->template( $this->folder . '/header' );
|
231 |
-
} else {
|
232 |
-
?>
|
233 |
<h1 class="sui-header-title"><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
<?php
|
239 |
}
|
240 |
|
241 |
/**
|
@@ -264,29 +236,29 @@ abstract class Forminator_Admin_Page {
|
|
264 |
|
265 |
<?php if ( ! $hide_footer ) : ?>
|
266 |
<ul class="sui-footer-nav">
|
267 |
-
<li><a href="https://wpmudev.com/hub2/" target="_blank"><?php esc_html_e( 'The Hub',
|
268 |
-
<li><a href="https://wpmudev.com/projects/category/plugins/" target="_blank"><?php esc_html_e( 'Plugins',
|
269 |
-
<li><a href="https://wpmudev.com/roadmap/" target="_blank"><?php esc_html_e( 'Roadmap',
|
270 |
-
<li><a href="https://wpmudev.com/hub/support/" target="_blank"><?php esc_html_e( 'Support',
|
271 |
-
<li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs',
|
272 |
-
<li><a href="https://wpmudev.com/hub2/community/" target="_blank"><?php esc_html_e( 'Community',
|
273 |
-
<li><a href="https://wpmudev.com/academy/" target="_blank"><?php esc_html_e( 'Academy',
|
274 |
-
<li><a href="https://wpmudev.com/terms-of-service/" target="_blank"><?php esc_html_e( 'Terms of Service',
|
275 |
-
<li><a href="https://incsub.com/privacy-policy/" target="_blank"><?php esc_html_e( 'Privacy Policy',
|
276 |
</ul>
|
277 |
<?php endif; ?>
|
278 |
|
279 |
<?php } else { ?>
|
280 |
|
281 |
<ul class="sui-footer-nav">
|
282 |
-
<li><a href="https://profiles.wordpress.org/wpmudev#content-plugins" target="_blank"><?php esc_html_e( 'Free Plugins',
|
283 |
-
<li><a href="https://wpmudev.com/features/" target="_blank"><?php esc_html_e( 'Membership',
|
284 |
-
<li><a href="https://wpmudev.com/roadmap/" target="_blank"><?php esc_html_e( 'Roadmap',
|
285 |
-
<li><a href="https://wordpress.org/support/plugin/forminator" target="_blank"><?php esc_html_e( 'Support',
|
286 |
-
<li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs',
|
287 |
-
<li><a href="https://wpmudev.com/hub-welcome/" target="_blank"><?php esc_html_e( 'The Hub',
|
288 |
-
<li><a href="https://wpmudev.com/terms-of-service/" target="_blank"><?php esc_html_e( 'Terms of Service',
|
289 |
-
<li><a href="https://incsub.com/privacy-policy/" target="_blank"><?php esc_html_e( 'Privacy Policy',
|
290 |
</ul>
|
291 |
|
292 |
<?php } ?>
|
@@ -295,15 +267,15 @@ abstract class Forminator_Admin_Page {
|
|
295 |
<ul class="sui-footer-social">
|
296 |
<li><a href="https://www.facebook.com/wpmudev" target="_blank">
|
297 |
<i class="sui-icon-social-facebook" aria-hidden="true"></i>
|
298 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Facebook',
|
299 |
</a></li>
|
300 |
<li><a href="https://twitter.com/wpmudev" target="_blank">
|
301 |
<i class="sui-icon-social-twitter" aria-hidden="true"></i>
|
302 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Twitter',
|
303 |
</a></li>
|
304 |
<li><a href="https://www.instagram.com/wpmu_dev/" target="_blank">
|
305 |
<i class="sui-icon-instagram" aria-hidden="true"></i>
|
306 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Instagram',
|
307 |
</a></li>
|
308 |
</ul>
|
309 |
<?php endif; ?>
|
@@ -398,132 +370,6 @@ abstract class Forminator_Admin_Page {
|
|
398 |
return is_file( $file );
|
399 |
}
|
400 |
|
401 |
-
/**
|
402 |
-
* Add a box to the page
|
403 |
-
*
|
404 |
-
* @since 1.0
|
405 |
-
*
|
406 |
-
* @param $box_id
|
407 |
-
* @param $title
|
408 |
-
* @param $class
|
409 |
-
* @param string $header_callback
|
410 |
-
* @param string $main_callback
|
411 |
-
* @param string $footer_callback
|
412 |
-
* @param array $args
|
413 |
-
*/
|
414 |
-
public function add_box(
|
415 |
-
$box_id,
|
416 |
-
$title,
|
417 |
-
$class,
|
418 |
-
$header_callback = '',
|
419 |
-
$main_callback = '',
|
420 |
-
$footer_callback = '',
|
421 |
-
$args = array()
|
422 |
-
) {
|
423 |
-
$args = wp_parse_args( $args, array() );
|
424 |
-
|
425 |
-
if ( ! isset( $this->content_boxes[ $this->page_slug ] ) ) {
|
426 |
-
$this->content_boxes[ $this->page_slug ] = array();
|
427 |
-
}
|
428 |
-
|
429 |
-
$box = array(
|
430 |
-
'id' => $box_id,
|
431 |
-
'title' => $title,
|
432 |
-
'class' => $class,
|
433 |
-
'header_callback' => $header_callback,
|
434 |
-
'main_callback' => $main_callback,
|
435 |
-
'footer_callback' => $footer_callback,
|
436 |
-
'args' => $args,
|
437 |
-
);
|
438 |
-
|
439 |
-
$box = apply_filters(
|
440 |
-
'forminator_add_box',
|
441 |
-
$box,
|
442 |
-
$this->page_slug,
|
443 |
-
$this->page_id
|
444 |
-
);
|
445 |
-
|
446 |
-
$box = apply_filters(
|
447 |
-
'forminator_add_box_' . $box_id,
|
448 |
-
$box,
|
449 |
-
$this->page_slug,
|
450 |
-
$this->page_id
|
451 |
-
);
|
452 |
-
|
453 |
-
if ( $box ) {
|
454 |
-
$this->content_boxes[ $this->page_slug ][ $box_id ] = $box;
|
455 |
-
}
|
456 |
-
}
|
457 |
-
|
458 |
-
/**
|
459 |
-
* Check if content box exist
|
460 |
-
*
|
461 |
-
* @since 1.0
|
462 |
-
*
|
463 |
-
* @param $box_id
|
464 |
-
*
|
465 |
-
* @return bool
|
466 |
-
*/
|
467 |
-
protected function box_exist( $box_id ) {
|
468 |
-
return ! empty( $this->content_boxes[ $this->page_slug ][ $box_id ] );
|
469 |
-
}
|
470 |
-
|
471 |
-
/**
|
472 |
-
* Print content box
|
473 |
-
*
|
474 |
-
* @since 1.0
|
475 |
-
*
|
476 |
-
* @param $box_id
|
477 |
-
*/
|
478 |
-
protected function do_content_box( $box_id ) {
|
479 |
-
if ( ! isset( $this->content_boxes[ $this->page_slug ][ $box_id ] ) ) {
|
480 |
-
return;
|
481 |
-
}
|
482 |
-
|
483 |
-
do_action_ref_array( 'forminator_admin_print_content_box' . $this->page_slug, array( &$this ) );
|
484 |
-
|
485 |
-
$box_data = $this->content_boxes[ $this->page_slug ][ $box_id ];
|
486 |
-
$args = array(
|
487 |
-
'title' => $box_data['title'],
|
488 |
-
'id' => $box_id,
|
489 |
-
'class' => $box_data['class'],
|
490 |
-
'header_callback' => $box_data['header_callback'],
|
491 |
-
'main_callback' => $box_data['main_callback'],
|
492 |
-
'footer_callback' => $box_data['footer_callback'],
|
493 |
-
'args' => $box_data['args'],
|
494 |
-
);
|
495 |
-
|
496 |
-
$this->template( 'boxes/content-box', $args );
|
497 |
-
}
|
498 |
-
|
499 |
-
/**
|
500 |
-
* Print popup box
|
501 |
-
*
|
502 |
-
* @since 1.0
|
503 |
-
*
|
504 |
-
* @param $box_id
|
505 |
-
*/
|
506 |
-
protected function do_popup_box( $box_id ) {
|
507 |
-
if ( ! isset( $this->content_boxes[ $this->page_slug ][ $box_id ] ) ) {
|
508 |
-
return;
|
509 |
-
}
|
510 |
-
|
511 |
-
do_action_ref_array( 'forminator_admin_print_popup_box' . $this->page_slug, array( &$this ) );
|
512 |
-
|
513 |
-
$box_data = $this->content_boxes[ $this->page_slug ][ $box_id ];
|
514 |
-
$args = array(
|
515 |
-
'title' => $box_data['title'],
|
516 |
-
'id' => $box_id,
|
517 |
-
'class' => $box_data['class'],
|
518 |
-
'header_callback' => $box_data['header_callback'],
|
519 |
-
'main_callback' => $box_data['main_callback'],
|
520 |
-
'footer_callback' => $box_data['footer_callback'],
|
521 |
-
'args' => $box_data['args'],
|
522 |
-
);
|
523 |
-
|
524 |
-
$this->template( 'boxes/popup-box', $args );
|
525 |
-
}
|
526 |
-
|
527 |
/**
|
528 |
* Generates the admin body class required for WPMU DEV Shared UI
|
529 |
*
|
31 |
*/
|
32 |
protected $folder = '';
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
/**
|
35 |
* @since 1.0
|
36 |
*
|
101 |
* @since 1.0
|
102 |
*/
|
103 |
public function render_page_hooks() {
|
|
|
104 |
add_action( 'load-' . $this->page_id, array( $this, 'before_render' ) );
|
105 |
add_action( 'load-' . $this->page_id, array( $this, 'trigger_before_render_action' ) );
|
106 |
add_filter( 'load-' . $this->page_id, array( $this, 'add_page_hooks' ) );
|
116 |
return $this->page_slug;
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
/**
|
120 |
* Called when page is loaded and content not rendered yet
|
121 |
*
|
165 |
* @param $hook
|
166 |
*/
|
167 |
public function enqueue_scripts( $hook ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
// Load admin scripts
|
169 |
+
wp_register_script(
|
170 |
+
'forminator-admin',
|
171 |
+
forminator_plugin_url() . 'build/main.js',
|
172 |
+
array(
|
173 |
+
'backbone',
|
174 |
+
'underscore',
|
175 |
+
'jquery',
|
176 |
+
'wp-color-picker',
|
177 |
+
),
|
178 |
FORMINATOR_VERSION,
|
179 |
+
true
|
|
|
180 |
);
|
181 |
+
forminator_common_admin_enqueue_scripts();
|
182 |
}
|
183 |
|
184 |
/**
|
199 |
* @since 1.0
|
200 |
*/
|
201 |
protected function render_header() {
|
202 |
+
if ( $this->template_exists( $this->folder . '/header' ) ) {
|
203 |
+
$this->template( $this->folder . '/header' );
|
204 |
+
} else {
|
205 |
+
?>
|
206 |
+
<header class="sui-header">
|
|
|
|
|
|
|
207 |
<h1 class="sui-header-title"><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
208 |
+
</header>
|
209 |
+
<?php
|
210 |
+
}
|
|
|
|
|
211 |
}
|
212 |
|
213 |
/**
|
236 |
|
237 |
<?php if ( ! $hide_footer ) : ?>
|
238 |
<ul class="sui-footer-nav">
|
239 |
+
<li><a href="https://wpmudev.com/hub2/" target="_blank"><?php esc_html_e( 'The Hub', 'forminator' ); ?></a></li>
|
240 |
+
<li><a href="https://wpmudev.com/projects/category/plugins/" target="_blank"><?php esc_html_e( 'Plugins', 'forminator' ); ?></a></li>
|
241 |
+
<li><a href="https://wpmudev.com/roadmap/" target="_blank"><?php esc_html_e( 'Roadmap', 'forminator' ); ?></a></li>
|
242 |
+
<li><a href="https://wpmudev.com/hub/support/" target="_blank"><?php esc_html_e( 'Support', 'forminator' ); ?></a></li>
|
243 |
+
<li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'forminator' ); ?></a></li>
|
244 |
+
<li><a href="https://wpmudev.com/hub2/community/" target="_blank"><?php esc_html_e( 'Community', 'forminator' ); ?></a></li>
|
245 |
+
<li><a href="https://wpmudev.com/academy/" target="_blank"><?php esc_html_e( 'Academy', 'forminator' ); ?></a></li>
|
246 |
+
<li><a href="https://wpmudev.com/terms-of-service/" target="_blank"><?php esc_html_e( 'Terms of Service', 'forminator' ); ?></a></li>
|
247 |
+
<li><a href="https://incsub.com/privacy-policy/" target="_blank"><?php esc_html_e( 'Privacy Policy', 'forminator' ); ?></a></li>
|
248 |
</ul>
|
249 |
<?php endif; ?>
|
250 |
|
251 |
<?php } else { ?>
|
252 |
|
253 |
<ul class="sui-footer-nav">
|
254 |
+
<li><a href="https://profiles.wordpress.org/wpmudev#content-plugins" target="_blank"><?php esc_html_e( 'Free Plugins', 'forminator' ); ?></a></li>
|
255 |
+
<li><a href="https://wpmudev.com/features/" target="_blank"><?php esc_html_e( 'Membership', 'forminator' ); ?></a></li>
|
256 |
+
<li><a href="https://wpmudev.com/roadmap/" target="_blank"><?php esc_html_e( 'Roadmap', 'forminator' ); ?></a></li>
|
257 |
+
<li><a href="https://wordpress.org/support/plugin/forminator" target="_blank"><?php esc_html_e( 'Support', 'forminator' ); ?></a></li>
|
258 |
+
<li><a href="https://wpmudev.com/docs/" target="_blank"><?php esc_html_e( 'Docs', 'forminator' ); ?></a></li>
|
259 |
+
<li><a href="https://wpmudev.com/hub-welcome/" target="_blank"><?php esc_html_e( 'The Hub', 'forminator' ); ?></a></li>
|
260 |
+
<li><a href="https://wpmudev.com/terms-of-service/" target="_blank"><?php esc_html_e( 'Terms of Service', 'forminator' ); ?></a></li>
|
261 |
+
<li><a href="https://incsub.com/privacy-policy/" target="_blank"><?php esc_html_e( 'Privacy Policy', 'forminator' ); ?></a></li>
|
262 |
</ul>
|
263 |
|
264 |
<?php } ?>
|
267 |
<ul class="sui-footer-social">
|
268 |
<li><a href="https://www.facebook.com/wpmudev" target="_blank">
|
269 |
<i class="sui-icon-social-facebook" aria-hidden="true"></i>
|
270 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Facebook', 'forminator' ); ?></span>
|
271 |
</a></li>
|
272 |
<li><a href="https://twitter.com/wpmudev" target="_blank">
|
273 |
<i class="sui-icon-social-twitter" aria-hidden="true"></i>
|
274 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Twitter', 'forminator' ); ?></span>
|
275 |
</a></li>
|
276 |
<li><a href="https://www.instagram.com/wpmu_dev/" target="_blank">
|
277 |
<i class="sui-icon-instagram" aria-hidden="true"></i>
|
278 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Instagram', 'forminator' ); ?></span>
|
279 |
</a></li>
|
280 |
</ul>
|
281 |
<?php endif; ?>
|
370 |
return is_file( $file );
|
371 |
}
|
372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
/**
|
374 |
* Generates the admin body class required for WPMU DEV Shared UI
|
375 |
*
|
admin/abstracts/class-admin-view-page.php
ADDED
@@ -0,0 +1,648 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
die();
|
4 |
+
}
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class Forminator_View_Page
|
8 |
+
*
|
9 |
+
* @since 1.0
|
10 |
+
*/
|
11 |
+
abstract class Forminator_Admin_View_Page extends Forminator_Admin_Page {
|
12 |
+
/**
|
13 |
+
* Current model
|
14 |
+
*
|
15 |
+
* @var object|bool
|
16 |
+
*/
|
17 |
+
protected $model = false;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Current form id
|
21 |
+
*
|
22 |
+
* @var int
|
23 |
+
*/
|
24 |
+
protected $form_id = 0;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Fields
|
28 |
+
*
|
29 |
+
* @var array
|
30 |
+
*/
|
31 |
+
protected $fields = array();
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Visible Fields
|
35 |
+
*
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
protected $visible_fields = array();
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Number of checked fields
|
42 |
+
*
|
43 |
+
* @var int
|
44 |
+
*/
|
45 |
+
protected $checked_fields = 0;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Number of total fields
|
49 |
+
*
|
50 |
+
* @var int
|
51 |
+
*/
|
52 |
+
protected $total_fields = 0;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Error message if avail
|
56 |
+
*
|
57 |
+
* @var string
|
58 |
+
*/
|
59 |
+
protected $error_message = '';
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Total Entries
|
63 |
+
*
|
64 |
+
* @var int
|
65 |
+
*/
|
66 |
+
protected $total_entries = 0;
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Per page
|
70 |
+
*
|
71 |
+
* @var int
|
72 |
+
*/
|
73 |
+
protected $per_page = 10;
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Page number
|
77 |
+
*
|
78 |
+
* @var int
|
79 |
+
*/
|
80 |
+
protected $page_number = 1;
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Filters to be used
|
84 |
+
*
|
85 |
+
* [key=>value]
|
86 |
+
* ['search'=>'search term']
|
87 |
+
*
|
88 |
+
* @since 1.5.4
|
89 |
+
* @var array
|
90 |
+
*/
|
91 |
+
public $filters = array();
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Order to be used
|
95 |
+
*
|
96 |
+
* [key=>order]
|
97 |
+
* ['entry_date' => 'ASC']
|
98 |
+
*
|
99 |
+
* @since 1.5.4
|
100 |
+
* @var array
|
101 |
+
*/
|
102 |
+
public $order = array();
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Entries
|
106 |
+
*
|
107 |
+
* @var array
|
108 |
+
*/
|
109 |
+
protected $entries = array();
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Total filtered Entries
|
113 |
+
*
|
114 |
+
* @since 1.5.4
|
115 |
+
* @var int
|
116 |
+
*/
|
117 |
+
protected $filtered_total_entries = 0;
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Flag fields is currently filtered
|
121 |
+
*
|
122 |
+
* @since 1.5.4
|
123 |
+
* @var bool
|
124 |
+
*/
|
125 |
+
public $fields_is_filtered = false;
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @var Forminator_Addon_Abstract[]
|
129 |
+
*/
|
130 |
+
protected static $connected_addons = null;
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @var Forminator_Addon_Abstract[]
|
134 |
+
*/
|
135 |
+
protected static $registered_addons = null;
|
136 |
+
|
137 |
+
/** @noinspection PhpMissingParentConstructorInspection
|
138 |
+
*
|
139 |
+
* Construct Entries Renderer
|
140 |
+
*
|
141 |
+
* @since 1.0.5
|
142 |
+
*
|
143 |
+
* @param string $folder
|
144 |
+
*/
|
145 |
+
protected function entries_construct( $folder ) {
|
146 |
+
$this->folder = $folder;
|
147 |
+
$this->before_render();
|
148 |
+
$this->trigger_before_render_action();
|
149 |
+
$this->add_page_hooks();
|
150 |
+
}
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Get fields
|
154 |
+
*
|
155 |
+
* @since 1.0
|
156 |
+
* @return array
|
157 |
+
*/
|
158 |
+
public function get_fields() {
|
159 |
+
return $this->fields;
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* Visible fields
|
164 |
+
*
|
165 |
+
* @since 1.0
|
166 |
+
* @return array
|
167 |
+
*/
|
168 |
+
public function get_visible_fields() {
|
169 |
+
return $this->visible_fields;
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Checked field option
|
174 |
+
*
|
175 |
+
* @since 1.0
|
176 |
+
*
|
177 |
+
* @param string $slug - the field slug
|
178 |
+
*
|
179 |
+
* @return string
|
180 |
+
*/
|
181 |
+
public function checked_field( $slug ) {
|
182 |
+
if ( ! empty( $this->visible_fields ) && is_array( $this->visible_fields ) ) {
|
183 |
+
if ( in_array( $slug, $this->visible_fields, true ) ) {
|
184 |
+
return checked( $slug, $slug );
|
185 |
+
} else {
|
186 |
+
return '';
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
return checked( $slug, $slug );
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Get model name
|
195 |
+
*
|
196 |
+
* @since 1.0
|
197 |
+
* @return string
|
198 |
+
*/
|
199 |
+
public function get_model_name() {
|
200 |
+
if ( $this->model ) {
|
201 |
+
return $this->model->name;
|
202 |
+
}
|
203 |
+
|
204 |
+
return '';
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Fields header
|
209 |
+
*
|
210 |
+
* @since 1.0
|
211 |
+
*/
|
212 |
+
public function fields_header() {
|
213 |
+
echo esc_html( sprintf( __( 'Showing %$1s of %$2s fields', 'forminator' ), $this->checked_fields, $this->total_fields ) );
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* The total entries
|
218 |
+
*
|
219 |
+
* @since 1.0
|
220 |
+
* @return int
|
221 |
+
*/
|
222 |
+
public function total_entries() {
|
223 |
+
return $this->total_entries;
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* The total filtered entries
|
228 |
+
*
|
229 |
+
* @since 1.5.4
|
230 |
+
* @return int
|
231 |
+
*/
|
232 |
+
public function filtered_total_entries() {
|
233 |
+
return $this->filtered_total_entries;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Get Entries
|
238 |
+
*
|
239 |
+
* @since 1.0
|
240 |
+
* @return array
|
241 |
+
*/
|
242 |
+
public function get_entries() {
|
243 |
+
return $this->entries;
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Get Page Number
|
248 |
+
*
|
249 |
+
* @since 1.0
|
250 |
+
* @return int
|
251 |
+
*/
|
252 |
+
public function get_page_number() {
|
253 |
+
return $this->page_number;
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Get Per Page
|
258 |
+
*
|
259 |
+
* @since 1.0
|
260 |
+
* @return int
|
261 |
+
*/
|
262 |
+
public function get_per_page() {
|
263 |
+
return $this->per_page;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* Get fields table
|
268 |
+
*
|
269 |
+
* @since 1.0
|
270 |
+
* @return Forminator_Entries_List_Table
|
271 |
+
*/
|
272 |
+
public function get_table() {
|
273 |
+
return new Forminator_Entries_List_Table(
|
274 |
+
array(
|
275 |
+
'model' => $this->model,
|
276 |
+
'visible_fields' => $this->visible_fields,
|
277 |
+
)
|
278 |
+
);
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Pagination
|
283 |
+
*
|
284 |
+
* @since 1.0
|
285 |
+
*/
|
286 |
+
public function paginate() {
|
287 |
+
$count = $this->filtered_total_entries;
|
288 |
+
echo '<span class="sui-pagination-results">'
|
289 |
+
. esc_html( sprintf( _n( '%s result', '%s results', $count, 'forminator' ), $count ) )
|
290 |
+
. '</span>';
|
291 |
+
forminator_list_pagination( $count, 'entries' );
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Bulk actions
|
296 |
+
*
|
297 |
+
* @since 1.0
|
298 |
+
*
|
299 |
+
* @param string $position
|
300 |
+
*/
|
301 |
+
public function bulk_actions( $position = 'top' ) { ?>
|
302 |
+
|
303 |
+
<select name="<?php echo ( 'top' === $position ) ? 'entries-action' : 'entries-action-bottom'; ?>"
|
304 |
+
class="sui-select-sm sui-select-inline"
|
305 |
+
style="min-width: 200px;">
|
306 |
+
<option value=""><?php esc_html_e( "Bulk Actions", 'forminator' ); ?></option>
|
307 |
+
<option value="delete-all"><?php esc_html_e( "Delete Entries", 'forminator' ); ?></option>
|
308 |
+
</select>
|
309 |
+
|
310 |
+
<button class="sui-button"><?php esc_html_e( "Apply", 'forminator' ); ?></button>
|
311 |
+
|
312 |
+
<?php
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* Prepare results
|
317 |
+
*
|
318 |
+
* @since 1.0
|
319 |
+
*/
|
320 |
+
public function prepare_results() {
|
321 |
+
if ( is_object( $this->model ) ) {
|
322 |
+
$paged = $this->page_number;
|
323 |
+
$per_page = $this->per_page;
|
324 |
+
$offset = ( $paged - 1 ) * $per_page;
|
325 |
+
|
326 |
+
$this->total_entries = Forminator_Form_Entry_Model::count_entries( $this->model->id );
|
327 |
+
|
328 |
+
$args = array(
|
329 |
+
'form_id' => $this->model->id,
|
330 |
+
'is_spam' => 0,
|
331 |
+
'per_page' => $per_page,
|
332 |
+
'offset' => $offset,
|
333 |
+
'order_by' => 'entries.date_created',
|
334 |
+
'order' => 'DESC',
|
335 |
+
);
|
336 |
+
|
337 |
+
$args = wp_parse_args( $this->filters, $args );
|
338 |
+
$args = wp_parse_args( $this->order, $args );
|
339 |
+
|
340 |
+
$count = 0;
|
341 |
+
|
342 |
+
$this->entries = Forminator_Form_Entry_Model::query_entries( $args, $count );
|
343 |
+
$this->filtered_total_entries = $count;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Called when page is loaded and content not rendered yet
|
349 |
+
*
|
350 |
+
* @since 1.0
|
351 |
+
*/
|
352 |
+
public function before_render() {
|
353 |
+
$this->model = Forminator_Base_Form_Model::get_model( $this->form_id );
|
354 |
+
if ( is_object( $this->model ) ) {
|
355 |
+
$this->fields = $this->model->get_fields();
|
356 |
+
if ( is_null( $this->fields ) ) {
|
357 |
+
$this->fields = array();
|
358 |
+
}
|
359 |
+
} else {
|
360 |
+
$this->model = false;
|
361 |
+
}
|
362 |
+
|
363 |
+
$this->pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; // WPCS: CSRF OK
|
364 |
+
|
365 |
+
$this->parse_filters();
|
366 |
+
$this->parse_order();
|
367 |
+
|
368 |
+
$this->per_page = forminator_form_view_per_page( 'entries' );
|
369 |
+
$this->page_number = max( 1, $this->pagenum );
|
370 |
+
$this->total_fields = count( $this->fields );
|
371 |
+
$this->checked_fields = $this->total_fields;
|
372 |
+
}
|
373 |
+
|
374 |
+
/**
|
375 |
+
* Parsing filters from $_REQUEST
|
376 |
+
*
|
377 |
+
* @since 1.5.4
|
378 |
+
*/
|
379 |
+
protected function parse_filters() {
|
380 |
+
$request_data = $_REQUEST;// WPCS CSRF ok.
|
381 |
+
$data_range = isset( $request_data['date_range'] ) ? sanitize_text_field( $request_data['date_range'] ) : '';
|
382 |
+
$search = isset( $request_data['search'] ) ? sanitize_text_field( $request_data['search'] ) : '';
|
383 |
+
$min_id = isset( $request_data['min_id'] ) ? sanitize_text_field( $request_data['min_id'] ) : '';
|
384 |
+
$max_id = isset( $request_data['max_id'] ) ? sanitize_text_field( $request_data['max_id'] ) : '';
|
385 |
+
|
386 |
+
$filters = array();
|
387 |
+
if ( ! empty( $data_range ) ) {
|
388 |
+
$date_ranges = explode( ' - ', $data_range );
|
389 |
+
if ( is_array( $date_ranges ) && isset( $date_ranges[0] ) && isset( $date_ranges[1] ) ) {
|
390 |
+
$date_ranges[0] = date( 'Y-m-d', strtotime( $date_ranges[0] ) );
|
391 |
+
$date_ranges[1] = date( 'Y-m-d', strtotime( $date_ranges[1] ) );
|
392 |
+
|
393 |
+
forminator_maybe_log( __METHOD__, $date_ranges );
|
394 |
+
$filters['date_created'] = array( $date_ranges[0], $date_ranges[1] );
|
395 |
+
}
|
396 |
+
}
|
397 |
+
if ( ! empty( $search ) ) {
|
398 |
+
$filters['search'] = $search;
|
399 |
+
}
|
400 |
+
|
401 |
+
if ( ! empty( $min_id ) ) {
|
402 |
+
$min_id = intval( $min_id );
|
403 |
+
if ( $min_id > 0 ) {
|
404 |
+
$filters['min_id'] = $min_id;
|
405 |
+
}
|
406 |
+
}
|
407 |
+
|
408 |
+
if ( ! empty( $max_id ) ) {
|
409 |
+
$max_id = intval( $max_id );
|
410 |
+
if ( $max_id > 0 ) {
|
411 |
+
$filters['max_id'] = $max_id;
|
412 |
+
}
|
413 |
+
}
|
414 |
+
|
415 |
+
$this->filters = $filters;
|
416 |
+
}
|
417 |
+
|
418 |
+
/**
|
419 |
+
* Parsing order from $_REQUEST
|
420 |
+
*
|
421 |
+
* @since 1.5.4
|
422 |
+
*/
|
423 |
+
protected function parse_order() {
|
424 |
+
$valid_order_bys = array(
|
425 |
+
'entries.date_created',
|
426 |
+
'entries.entry_id',
|
427 |
+
);
|
428 |
+
|
429 |
+
$valid_orders = array(
|
430 |
+
'DESC',
|
431 |
+
'ASC',
|
432 |
+
);
|
433 |
+
$request_data = $_REQUEST;// WPCS CSRF ok.
|
434 |
+
$order_by = 'entries.date_created';
|
435 |
+
if ( isset( $request_data['order_by' ] ) ) {
|
436 |
+
switch ( $request_data['order_by' ] ) {
|
437 |
+
case 'entries.entry_id':
|
438 |
+
$order_by = 'entries.entry_id';
|
439 |
+
break;
|
440 |
+
case 'entries.date_created':
|
441 |
+
$order_by = 'entries.date_created';
|
442 |
+
break;
|
443 |
+
default:
|
444 |
+
break;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
$order = 'DESC';
|
449 |
+
if ( isset( $request_data['order'] ) ) {
|
450 |
+
switch ( $request_data['order' ] ) {
|
451 |
+
case 'DESC':
|
452 |
+
$order = 'DESC';
|
453 |
+
break;
|
454 |
+
case 'ASC':
|
455 |
+
$order = 'ASC';
|
456 |
+
break;
|
457 |
+
default:
|
458 |
+
break;
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
if ( ! empty( $order_by ) ) {
|
463 |
+
if ( ! in_array( $order, $valid_order_bys, true ) ) {
|
464 |
+
$order_by = 'entries.date_created';
|
465 |
+
}
|
466 |
+
|
467 |
+
$this->order['order_by'] = $order_by;
|
468 |
+
}
|
469 |
+
|
470 |
+
if ( ! empty( $order ) ) {
|
471 |
+
$order = strtoupper( $order );
|
472 |
+
if ( ! in_array( $order, $valid_orders, true ) ) {
|
473 |
+
$order = 'DESC';
|
474 |
+
}
|
475 |
+
|
476 |
+
$this->order['order'] = $order;
|
477 |
+
}
|
478 |
+
}
|
479 |
+
|
480 |
+
/**
|
481 |
+
* Executor of adding additional items on entry page
|
482 |
+
*
|
483 |
+
* @see self::on_render_entry()
|
484 |
+
* @since 1.1
|
485 |
+
*
|
486 |
+
* @param Forminator_Form_Entry_Model $entry_model
|
487 |
+
*
|
488 |
+
* @return array
|
489 |
+
*/
|
490 |
+
protected function attach_addon_on_render_entry( Forminator_Form_Entry_Model $entry_model ) {
|
491 |
+
$additional_items = array();
|
492 |
+
//find all registered addons, so history can be shown even for deactivated addons
|
493 |
+
$registered_addons = $this->get_registered_addons();
|
494 |
+
|
495 |
+
$method = 'get_addon_' . static::$module_slug . '_hooks';
|
496 |
+
foreach ( $registered_addons as $registered_addon ) {
|
497 |
+
try {
|
498 |
+
$hooks = $registered_addon->{$method}( $this->form_id );
|
499 |
+
$meta_data = forminator_find_addon_meta_data_from_entry_model( $registered_addon, $entry_model );
|
500 |
+
|
501 |
+
$addon_additional_items = $hooks->on_render_entry( $entry_model, $meta_data );// run and forget.
|
502 |
+
$addon_additional_items = self::format_addon_additional_items( $addon_additional_items );
|
503 |
+
$additional_items = array_merge( $additional_items, $addon_additional_items );
|
504 |
+
} catch ( Exception $e ) {
|
505 |
+
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to on_render_entry', $e->getMessage() );
|
506 |
+
}
|
507 |
+
}
|
508 |
+
|
509 |
+
return $additional_items;
|
510 |
+
}
|
511 |
+
|
512 |
+
/**
|
513 |
+
* Flag whether box filter opened or nope
|
514 |
+
*
|
515 |
+
* @since 1.5.4
|
516 |
+
* @return bool
|
517 |
+
*/
|
518 |
+
protected function is_filter_box_enabled() {
|
519 |
+
return ( ! empty( $this->filters ) && ! empty( $this->order ) );
|
520 |
+
}
|
521 |
+
|
522 |
+
/**
|
523 |
+
* Get current error message
|
524 |
+
*
|
525 |
+
* @return string
|
526 |
+
*
|
527 |
+
* @since 1.5.2
|
528 |
+
*/
|
529 |
+
public function error_message() {
|
530 |
+
return $this->error_message;
|
531 |
+
}
|
532 |
+
|
533 |
+
/**
|
534 |
+
* Get Globally registered Addons, avoid overhead for checking registered addons many times
|
535 |
+
*
|
536 |
+
* @return array|Forminator_Addon_Abstract[]
|
537 |
+
*/
|
538 |
+
public function get_registered_addons() {
|
539 |
+
if ( empty( self::$registered_addons ) ) {
|
540 |
+
self::$registered_addons = array();
|
541 |
+
|
542 |
+
$registered_addons = forminator_get_registered_addons();
|
543 |
+
$method = 'get_addon_' . static::$module_slug . '_hooks';
|
544 |
+
$class_name = 'Forminator_Addon_' . forminator_get_prefix( static::$module_slug, 'c', true ) . '_Hooks_Abstract';
|
545 |
+
foreach ( $registered_addons as $registered_addon ) {
|
546 |
+
try {
|
547 |
+
$hooks = $registered_addon->{$method}( $this->form_id );
|
548 |
+
if ( $hooks instanceof $class_name ) {
|
549 |
+
self::$registered_addons[] = $registered_addon;
|
550 |
+
}
|
551 |
+
} catch ( Exception $e ) {
|
552 |
+
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to ' . $method, $e->getMessage() );
|
553 |
+
}
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
return self::$registered_addons;
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* Process request
|
562 |
+
*
|
563 |
+
* @since 1.0
|
564 |
+
*/
|
565 |
+
public function process_request() {
|
566 |
+
|
567 |
+
if ( isset( $_GET['err_msg'] ) ) {
|
568 |
+
$this->error_message = wp_kses_post( $_GET['err_msg'] );
|
569 |
+
}
|
570 |
+
|
571 |
+
// it should be before nonce check cus we use filter on Submissions page without nonce :facepalm:.
|
572 |
+
if ( isset( $_REQUEST['field'] ) ) {
|
573 |
+
$this->visible_fields = $_REQUEST['field']; // wpcs XSRF ok, via GET
|
574 |
+
$this->checked_fields = count( $this->visible_fields );
|
575 |
+
$this->fields_is_filtered = true;
|
576 |
+
}
|
577 |
+
|
578 |
+
/**
|
579 |
+
* Start modifying data
|
580 |
+
*/
|
581 |
+
if ( ! isset( $_REQUEST['forminatorEntryNonce'] ) ) {
|
582 |
+
return;
|
583 |
+
}
|
584 |
+
|
585 |
+
$nonce = $_REQUEST['forminatorEntryNonce']; // WPCS: CSRF OK
|
586 |
+
if ( ! wp_verify_nonce( $nonce, 'forminator' . forminator_get_prefix( static::$module_slug, '', true ) . 'Entries' ) ) {
|
587 |
+
return;
|
588 |
+
}
|
589 |
+
|
590 |
+
if ( isset( $_REQUEST['entries-action'] ) || isset( $_REQUEST['entries-action-bottom'] ) ) {
|
591 |
+
$action = '';
|
592 |
+
if ( ! empty( $_REQUEST['entries-action'] ) ) {
|
593 |
+
$action = sanitize_text_field( $_REQUEST['entries-action'] );
|
594 |
+
} elseif ( isset( $_REQUEST['entries-action-bottom'] ) ) {
|
595 |
+
$action = sanitize_text_field( $_REQUEST['entries-action-bottom'] );
|
596 |
+
}
|
597 |
+
|
598 |
+
switch ( $action ) {
|
599 |
+
case 'delete-all' :
|
600 |
+
$this->delete_all_action();
|
601 |
+
break;
|
602 |
+
default:
|
603 |
+
break;
|
604 |
+
}
|
605 |
+
}
|
606 |
+
|
607 |
+
if ( isset( $_POST['forminator_action'] ) ) {
|
608 |
+
switch ( $_POST['forminator_action'] ) {
|
609 |
+
case 'delete':
|
610 |
+
if ( isset( $_POST['id'] ) ) {
|
611 |
+
$id = $_POST['id'];
|
612 |
+
|
613 |
+
$this->delete_action( $id );
|
614 |
+
$this->maybe_redirect_to_referer();
|
615 |
+
exit;
|
616 |
+
}
|
617 |
+
break;
|
618 |
+
default:
|
619 |
+
break;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
}
|
623 |
+
|
624 |
+
/**
|
625 |
+
* Action delete
|
626 |
+
*
|
627 |
+
* @param int $id ID.
|
628 |
+
*/
|
629 |
+
public function delete_action( $id ) {
|
630 |
+
Forminator_Form_Entry_Model::delete_by_entrys( $this->model->id, $id );
|
631 |
+
}
|
632 |
+
|
633 |
+
/**
|
634 |
+
* This view is unused from 1.5.4 on, using "forminator-entries" instead.
|
635 |
+
*/
|
636 |
+
protected function maybe_redirect() {
|
637 |
+
if ( 'forminator-' . forminator_get_prefix( static::$module_slug, 'c' ) . '-view' === $this->page_slug ) {
|
638 |
+
$form_type = forminator_get_prefix( static::$module_slug, 'post_type' );
|
639 |
+
$url = '?page=forminator-entries&form_type=' . $form_type;
|
640 |
+
if ( isset( $_REQUEST['form_id'] ) ) { // WPCS: CSRF OK
|
641 |
+
$url .= '&form_id=' . intval( $_REQUEST['form_id'] ); // WPCS: CSRF OK
|
642 |
+
}
|
643 |
+
if ( wp_safe_redirect( $url ) ) {
|
644 |
+
exit;
|
645 |
+
}
|
646 |
+
}
|
647 |
+
}
|
648 |
+
}
|
admin/classes/class-admin-ajax.php
CHANGED
@@ -52,9 +52,9 @@ class Forminator_Admin_AJAX {
|
|
52 |
add_action( 'wp_ajax_forminator_load_uninstall_settings_popup', array( $this, 'load_uninstall_form' ) );
|
53 |
add_action( 'wp_ajax_forminator_save_uninstall_settings_popup', array( $this, 'save_uninstall_form' ) );
|
54 |
|
55 |
-
add_action( 'wp_ajax_forminator_load_preview_cforms_popup', array( $this, '
|
56 |
-
add_action( 'wp_ajax_forminator_load_preview_polls_popup', array( $this, '
|
57 |
-
add_action( 'wp_ajax_forminator_load_preview_quizzes_popup', array( $this, '
|
58 |
|
59 |
// Handle exports popup
|
60 |
add_action( 'wp_ajax_forminator_load_exports_popup', array( $this, 'load_exports' ) );
|
@@ -66,9 +66,9 @@ class Forminator_Admin_AJAX {
|
|
66 |
add_action( 'wp_ajax_forminator_load_privacy_settings_popup', array( $this, 'load_privacy_settings' ) );
|
67 |
add_action( 'wp_ajax_forminator_save_privacy_settings_popup', array( $this, 'save_privacy_settings' ) );
|
68 |
|
69 |
-
add_action( 'wp_ajax_forminator_load_export_custom_form_popup', array( $this, '
|
70 |
-
add_action( 'wp_ajax_forminator_load_import_custom_form_popup', array( $this, '
|
71 |
-
add_action( 'wp_ajax_forminator_save_import_custom_form_popup', array( $this, '
|
72 |
|
73 |
add_action( "wp_ajax_forminator_load_import_custom_form_cf7_popup", array( $this, "load_import_custom_form_cf7" ) );
|
74 |
add_action( "wp_ajax_forminator_save_import_custom_form_cf7_popup", array( $this, "save_import_custom_form_cf7" ) );
|
@@ -79,15 +79,15 @@ class Forminator_Admin_AJAX {
|
|
79 |
add_action( "wp_ajax_forminator_load_import_custom_form_gravity_popup", array( $this, "load_import_custom_form_gravity" ) );
|
80 |
add_action( "wp_ajax_forminator_save_import_custom_form_gravity_popup", array( $this, "save_import_custom_form_gravity" ) );
|
81 |
|
82 |
-
add_action(
|
83 |
-
add_action(
|
84 |
-
add_action(
|
85 |
|
86 |
add_action( 'wp_ajax_forminator_delete_poll_submissions', array( $this, 'delete_poll_submissions' ) );
|
87 |
|
88 |
-
add_action( 'wp_ajax_forminator_load_export_quiz_popup', array( $this, '
|
89 |
-
add_action( 'wp_ajax_forminator_load_import_quiz_popup', array( $this, '
|
90 |
-
add_action( 'wp_ajax_forminator_save_import_quiz_popup', array( $this, '
|
91 |
|
92 |
add_action( 'wp_ajax_forminator_save_accessibility_settings_popup', array( $this, 'save_accessibility_settings' ) );
|
93 |
|
@@ -121,7 +121,7 @@ class Forminator_Admin_AJAX {
|
|
121 |
*/
|
122 |
public function save_quiz() {
|
123 |
if ( ! forminator_is_user_allowed() ) {
|
124 |
-
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.',
|
125 |
}
|
126 |
|
127 |
forminator_validate_ajax( 'forminator_save_quiz' );
|
@@ -136,10 +136,7 @@ class Forminator_Admin_AJAX {
|
|
136 |
|
137 |
$questions = array();
|
138 |
$results = array();
|
139 |
-
$
|
140 |
-
$msg_count = false;
|
141 |
-
$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;
|
142 |
-
$id = intval( $id );
|
143 |
$title = isset( $submitted_data['quiz_title'] ) ? sanitize_text_field( $submitted_data['quiz_title'] ) : sanitize_text_field( $submitted_data['formName'] );
|
144 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
145 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
@@ -147,18 +144,18 @@ class Forminator_Admin_AJAX {
|
|
147 |
$notifications = array();
|
148 |
|
149 |
if ( is_null( $id ) || $id <= 0 ) {
|
150 |
-
$form_model = new
|
151 |
$action = 'create';
|
152 |
|
153 |
if ( empty( $status ) ) {
|
154 |
-
$status =
|
155 |
}
|
156 |
} else {
|
157 |
-
$form_model =
|
158 |
$action = 'update';
|
159 |
|
160 |
if ( ! is_object( $form_model ) ) {
|
161 |
-
wp_send_json_error( __( "Quiz model doesn't exist",
|
162 |
}
|
163 |
|
164 |
if ( empty( $status ) ) {
|
@@ -211,28 +208,7 @@ class Forminator_Admin_AJAX {
|
|
211 |
// Handle quiz questions
|
212 |
$form_model->questions = $questions;
|
213 |
|
214 |
-
|
215 |
-
$msg_count = $quiz_data['settings']['msg_count']; //Backup, we allow html here
|
216 |
-
}
|
217 |
-
|
218 |
-
if ( isset( $quiz_data['settings'] ) ) {
|
219 |
-
// Sanitize settings
|
220 |
-
$settings = forminator_sanitize_field( $quiz_data['settings'] );
|
221 |
-
}
|
222 |
-
|
223 |
-
// Sanitize admin email message
|
224 |
-
if ( isset( $quiz_data['settings']['admin-email-editor'] ) ) {
|
225 |
-
$settings['admin-email-editor'] = $quiz_data['settings']['admin-email-editor'];
|
226 |
-
}
|
227 |
-
|
228 |
-
// Sanitize quiz description
|
229 |
-
if ( isset( $quiz_data['settings']['quiz_description'] ) ) {
|
230 |
-
$settings['quiz_description'] = $quiz_data['settings']['quiz_description'];
|
231 |
-
}
|
232 |
-
|
233 |
-
if ( isset( $quiz_data['settings']['social-share-message'] ) ) {
|
234 |
-
$settings['social-share-message'] = forminator_sanitize_textarea( $quiz_data['settings']['social-share-message'] );
|
235 |
-
}
|
236 |
|
237 |
if ( isset( $quiz_data['notifications'] ) ) {
|
238 |
$notifications = forminator_sanitize_field( $quiz_data['notifications'] );
|
@@ -247,11 +223,6 @@ class Forminator_Admin_AJAX {
|
|
247 |
}
|
248 |
}
|
249 |
|
250 |
-
// Update with backuped version
|
251 |
-
if ( $msg_count ) {
|
252 |
-
$settings['msg_count'] = $msg_count;
|
253 |
-
}
|
254 |
-
|
255 |
// version
|
256 |
$settings['version'] = $version;
|
257 |
|
@@ -282,6 +253,7 @@ class Forminator_Admin_AJAX {
|
|
282 |
*/
|
283 |
do_action( 'forminator_quiz_action_' . $action, $id, $type, $status, $questions, $results );
|
284 |
|
|
|
285 |
|
286 |
wp_send_json_success( $id );
|
287 |
}
|
@@ -294,7 +266,7 @@ class Forminator_Admin_AJAX {
|
|
294 |
*/
|
295 |
public function save_poll_form() {
|
296 |
if ( ! forminator_is_user_allowed() ) {
|
297 |
-
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.',
|
298 |
}
|
299 |
|
300 |
forminator_validate_ajax( 'forminator_save_poll' );
|
@@ -307,26 +279,24 @@ class Forminator_Admin_AJAX {
|
|
307 |
}
|
308 |
|
309 |
$answers = array();
|
310 |
-
$
|
311 |
-
$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;
|
312 |
-
$id = intval( $id );
|
313 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
314 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
315 |
$action = false;
|
316 |
|
317 |
if ( is_null( $id ) || $id <= 0 ) {
|
318 |
-
$form_model = new
|
319 |
$action = 'create';
|
320 |
|
321 |
if ( empty( $status ) ) {
|
322 |
-
$status =
|
323 |
}
|
324 |
} else {
|
325 |
-
$form_model =
|
326 |
$action = 'update';
|
327 |
|
328 |
if ( ! is_object( $form_model ) ) {
|
329 |
-
wp_send_json_error( __( "Poll model doesn't exist",
|
330 |
}
|
331 |
|
332 |
if ( empty( $status ) ) {
|
@@ -345,15 +315,7 @@ class Forminator_Admin_AJAX {
|
|
345 |
$answers = wp_slash( $answers );
|
346 |
}
|
347 |
|
348 |
-
|
349 |
-
// Sanitize settings
|
350 |
-
$settings = forminator_sanitize_field( $poll_data['settings'] );
|
351 |
-
}
|
352 |
-
|
353 |
-
// Sanitize admin email message
|
354 |
-
if ( isset( $poll_data['settings']['admin-email-editor'] ) ) {
|
355 |
-
$settings['admin-email-editor'] = $poll_data['settings']['admin-email-editor'];
|
356 |
-
}
|
357 |
|
358 |
// version
|
359 |
$settings['version'] = $version;
|
@@ -405,7 +367,9 @@ class Forminator_Admin_AJAX {
|
|
405 |
}
|
406 |
}
|
407 |
|
408 |
-
|
|
|
|
|
409 |
|
410 |
wp_send_json_success( $id );
|
411 |
}
|
@@ -417,7 +381,7 @@ class Forminator_Admin_AJAX {
|
|
417 |
*/
|
418 |
public function save_builder() {
|
419 |
if ( ! forminator_is_user_allowed() ) {
|
420 |
-
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.',
|
421 |
}
|
422 |
|
423 |
forminator_validate_ajax( 'forminator_save_builder_fields' );
|
@@ -427,26 +391,25 @@ class Forminator_Admin_AJAX {
|
|
427 |
$form_data = json_decode( stripslashes( $form_data ), true );
|
428 |
$fields = array();
|
429 |
$notifications = array();
|
430 |
-
$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] :
|
431 |
-
$id = intval( $id );
|
432 |
$title = sanitize_text_field( $submitted_data['formName'] );
|
433 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
434 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
435 |
$action = false;
|
436 |
|
437 |
if ( is_null( $id ) || $id <= 0 ) {
|
438 |
-
$form_model = new
|
439 |
$action = 'create';
|
440 |
|
441 |
if ( empty( $status ) ) {
|
442 |
-
$status =
|
443 |
}
|
444 |
} else {
|
445 |
-
$form_model =
|
446 |
$action = 'update';
|
447 |
|
448 |
if ( ! is_object( $form_model ) ) {
|
449 |
-
wp_send_json_error( __( "Form model doesn't exist",
|
450 |
}
|
451 |
|
452 |
if ( empty( $status ) ) {
|
@@ -476,14 +439,7 @@ class Forminator_Admin_AJAX {
|
|
476 |
}
|
477 |
}
|
478 |
|
479 |
-
|
480 |
-
$settings = forminator_sanitize_field( $form_data['settings'] );
|
481 |
-
$settings = apply_filters( 'forminator_builder_data_settings_before_saving', $settings, $form_data['settings'] );
|
482 |
-
|
483 |
-
// Sanitize custom css
|
484 |
-
if ( isset( $form_data['settings']['custom_css'] ) ) {
|
485 |
-
$settings['custom_css'] = sanitize_textarea_field( $form_data['settings']['custom_css'] );
|
486 |
-
}
|
487 |
|
488 |
if ( isset( $form_data['notifications'] ) ) {
|
489 |
$notifications = forminator_sanitize_field( $form_data['notifications'] );
|
@@ -556,14 +512,53 @@ class Forminator_Admin_AJAX {
|
|
556 |
|
557 |
forminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );
|
558 |
|
559 |
-
|
560 |
-
wp_cache_delete( 'forminator_form_total_entries', 'forminator_form_total_entries' );
|
561 |
-
wp_cache_delete( 'forminator_form_total_entries_publish', 'forminator_form_total_entries_publish' );
|
562 |
-
wp_cache_delete( 'forminator_form_total_entries_draft', 'forminator_form_total_entries_draft' );
|
563 |
|
564 |
wp_send_json_success( $id );
|
565 |
}
|
566 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
/**
|
568 |
* Save custom form settings
|
569 |
*
|
@@ -586,17 +581,17 @@ class Forminator_Admin_AJAX {
|
|
586 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
587 |
|
588 |
if ( is_null( $id ) || $id <= 0 ) {
|
589 |
-
$form_model = new
|
590 |
|
591 |
if ( empty( $status ) ) {
|
592 |
-
$status =
|
593 |
}
|
594 |
|
595 |
} else {
|
596 |
-
$form_model =
|
597 |
|
598 |
if ( ! is_object( $form_model ) ) {
|
599 |
-
wp_send_json_error( __( "Form model doesn't exist",
|
600 |
}
|
601 |
if ( empty( $status ) ) {
|
602 |
$status = $form_model->status;
|
@@ -829,7 +824,7 @@ class Forminator_Admin_AJAX {
|
|
829 |
|
830 |
} else {
|
831 |
$html .= '<div class="sui-notice">';
|
832 |
-
$html .= '<p>' . esc_html__( 'You have to first save your credentials to load the reCAPTCHA . ',
|
833 |
$html .= '</div>';
|
834 |
}
|
835 |
|
@@ -868,7 +863,7 @@ class Forminator_Admin_AJAX {
|
|
868 |
|
869 |
} else {
|
870 |
|
871 |
-
wp_send_json_error( __( 'Limit per page can not be less than one.',
|
872 |
|
873 |
}
|
874 |
|
@@ -921,91 +916,42 @@ class Forminator_Admin_AJAX {
|
|
921 |
}
|
922 |
|
923 |
/**
|
924 |
-
* Preview
|
925 |
*
|
926 |
* @since 1.0
|
927 |
*/
|
928 |
-
public function
|
929 |
-
|
930 |
-
forminator_validate_ajax( 'forminator_popup_preview_cforms' );
|
931 |
-
|
932 |
-
$preview_data = false;
|
933 |
-
$form_id = false;
|
934 |
-
|
935 |
-
if ( isset( $_POST['id'] ) ) {
|
936 |
-
$form_id = intval( $_POST['id'] );
|
937 |
-
}
|
938 |
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
$
|
947 |
}
|
948 |
|
949 |
-
$html = forminator_form_preview( $form_id, true, $preview_data );
|
950 |
-
|
951 |
-
wp_send_json_success( $html );
|
952 |
-
}
|
953 |
-
|
954 |
-
/**
|
955 |
-
* Preview polls
|
956 |
-
*
|
957 |
-
* @since 1.0
|
958 |
-
*/
|
959 |
-
public function preview_polls() {
|
960 |
// Validate nonce
|
961 |
-
forminator_validate_ajax( '
|
962 |
|
963 |
$preview_data = false;
|
964 |
// force -1 for preview
|
965 |
$form_id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : -1;// phpcs:ignore -- by forminator_validate_ajax
|
966 |
|
967 |
-
if ( isset( $_POST['id'] ) ) {
|
968 |
-
$form_id = intval( $_POST['id'] );
|
969 |
-
}
|
970 |
-
|
971 |
// Check if preview data set
|
972 |
-
|
973 |
-
|
974 |
-
$data = $_POST['data'];
|
975 |
|
976 |
if ( ! is_array( $data ) ) {
|
977 |
$data = json_decode( stripslashes( $data ), true );
|
978 |
}
|
979 |
-
$
|
980 |
-
|
981 |
-
|
982 |
-
$html = forminator_poll_preview( $form_id, true, $preview_data );
|
983 |
-
|
984 |
-
wp_send_json_success( $html );
|
985 |
-
}
|
986 |
-
|
987 |
-
/**
|
988 |
-
* Preview quizzes
|
989 |
-
*
|
990 |
-
* @since 1.0
|
991 |
-
*/
|
992 |
-
public function preview_quizzes() {
|
993 |
-
// Validate nonce
|
994 |
-
forminator_validate_ajax( 'forminator_popup_preview_quizzes' );
|
995 |
-
|
996 |
-
// force -1 for preview
|
997 |
-
$form_id = - 1;
|
998 |
-
|
999 |
-
if ( isset( $_POST['id'] ) ) {
|
1000 |
-
$form_id = intval( $_POST['id'] );
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
// Check if preview data set
|
1004 |
-
if ( isset( $_POST['data'] ) && ! empty( $_POST['data'] ) ) {
|
1005 |
-
$preview_data = forminator_data_to_model_quiz( $_POST['data'] );
|
1006 |
}
|
1007 |
|
1008 |
-
$html =
|
1009 |
|
1010 |
wp_send_json_success( $html );
|
1011 |
}
|
@@ -1028,7 +974,7 @@ class Forminator_Admin_AJAX {
|
|
1028 |
$html = forminator_template( 'settings/popup/exports-content', $args );
|
1029 |
wp_send_json_success( $html );
|
1030 |
} else {
|
1031 |
-
wp_send_json_error( __( 'Not valid module ID provided.',
|
1032 |
}
|
1033 |
}
|
1034 |
|
@@ -1044,15 +990,15 @@ class Forminator_Admin_AJAX {
|
|
1044 |
$form_id = isset( $_POST['id'] ) && $_POST['id'] >= 0 ? intval( $_POST['id'] ) : false;
|
1045 |
|
1046 |
if ( ! $form_id ) {
|
1047 |
-
wp_send_json_error( __( 'No ID was provided.',
|
1048 |
}
|
1049 |
|
1050 |
$was_cleared = delete_export_logs( $form_id );
|
1051 |
|
1052 |
if ( $was_cleared ) {
|
1053 |
-
wp_send_json_success( __( 'Exports cleared.',
|
1054 |
} else {
|
1055 |
-
wp_send_json_error( __( "Exports couldn't be cleared.",
|
1056 |
}
|
1057 |
}
|
1058 |
|
@@ -1203,39 +1149,39 @@ class Forminator_Admin_AJAX {
|
|
1203 |
// Account Erasure Requests
|
1204 |
|
1205 |
// Submissions Retention
|
1206 |
-
$cform_retain_forever = filter_var( $post_data['
|
1207 |
update_option( 'retain_submission_forever', $cform_retain_forever );
|
1208 |
if ( $cform_retain_forever ) {
|
1209 |
-
$post_data['
|
1210 |
}
|
1211 |
-
if ( isset( $post_data['
|
1212 |
-
$post_data['
|
1213 |
-
$post_data['
|
1214 |
-
$submissions_retention_number
|
1215 |
if ( $submissions_retention_number < 0 ) {
|
1216 |
$submissions_retention_number = 0;
|
1217 |
}
|
1218 |
update_option( 'forminator_retain_submissions_interval_number', $submissions_retention_number );
|
1219 |
}
|
1220 |
-
update_option( 'forminator_retain_submissions_interval_unit', $post_data['
|
1221 |
// Submissions Retention
|
1222 |
|
1223 |
// IP Retention
|
1224 |
-
$cform_retain_ip_forever = filter_var( $post_data['
|
1225 |
update_option( 'retain_ip_forever', $cform_retain_ip_forever );
|
1226 |
if ( $cform_retain_ip_forever ) {
|
1227 |
-
$post_data['
|
1228 |
}
|
1229 |
-
if ( isset( $post_data['
|
1230 |
-
$post_data['
|
1231 |
-
$post_data['
|
1232 |
-
$cform_ip_retention_number
|
1233 |
if ( $cform_ip_retention_number < 0 ) {
|
1234 |
$cform_ip_retention_number = 0;
|
1235 |
}
|
1236 |
update_option( 'forminator_retain_ip_interval_number', $cform_ip_retention_number );
|
1237 |
}
|
1238 |
-
update_option( 'forminator_retain_ip_interval_unit', $post_data['
|
1239 |
// IP Retention
|
1240 |
|
1241 |
/**
|
@@ -1245,37 +1191,37 @@ class Forminator_Admin_AJAX {
|
|
1245 |
$poll_retain_submissions_forever = filter_var( $post_data['poll_retain_submission_forever'], FILTER_VALIDATE_BOOLEAN );
|
1246 |
update_option( 'poll_retain_submission_forever', $poll_retain_submissions_forever );
|
1247 |
if ( $poll_retain_submissions_forever ) {
|
1248 |
-
$post_data['
|
1249 |
}
|
1250 |
// Polls
|
1251 |
-
if ( isset( $post_data['
|
1252 |
-
$post_data['
|
1253 |
-
$post_data['
|
1254 |
-
$poll_submissions_retention_number
|
1255 |
if ( $poll_submissions_retention_number < 0 ) {
|
1256 |
$poll_submissions_retention_number = 0;
|
1257 |
}
|
1258 |
update_option( 'forminator_retain_poll_submissions_interval_number', $poll_submissions_retention_number );
|
1259 |
}
|
1260 |
-
update_option( 'forminator_retain_poll_submissions_interval_unit', $post_data['
|
1261 |
// Submissions Retention
|
1262 |
|
1263 |
// IP Retention
|
1264 |
-
$poll_retain_ip_forever = filter_var( $post_data['
|
1265 |
update_option( 'retain_poll_forever', $poll_retain_ip_forever );
|
1266 |
if ( $poll_retain_ip_forever ) {
|
1267 |
-
$post_data['
|
1268 |
}
|
1269 |
-
if ( isset( $post_data['
|
1270 |
-
$post_data['
|
1271 |
-
$post_data['
|
1272 |
-
$votes_retention_number
|
1273 |
if ( $votes_retention_number < 0 ) {
|
1274 |
$votes_retention_number = 0;
|
1275 |
}
|
1276 |
update_option( 'forminator_retain_votes_interval_number', $votes_retention_number );
|
1277 |
}
|
1278 |
-
update_option( 'forminator_retain_votes_interval_unit', $post_data['
|
1279 |
// IP Retention
|
1280 |
|
1281 |
/**
|
@@ -1285,40 +1231,23 @@ class Forminator_Admin_AJAX {
|
|
1285 |
$quiz_retain_submissions_forever = filter_var( $post_data['quiz_retain_submission_forever'], FILTER_VALIDATE_BOOLEAN );
|
1286 |
update_option( 'quiz_retain_submission_forever', $quiz_retain_submissions_forever );
|
1287 |
if ( $quiz_retain_submissions_forever ) {
|
1288 |
-
$post_data['
|
1289 |
}
|
1290 |
-
if ( isset( $post_data['
|
1291 |
-
$post_data['
|
1292 |
-
$post_data['
|
1293 |
-
$quiz_submissions_retention_number
|
1294 |
if ( $quiz_submissions_retention_number < 0 ) {
|
1295 |
$quiz_submissions_retention_number = 0;
|
1296 |
}
|
1297 |
update_option( 'forminator_retain_quiz_submissions_interval_number', $quiz_submissions_retention_number );
|
1298 |
}
|
1299 |
-
update_option( 'forminator_retain_quiz_submissions_interval_unit', $post_data['
|
1300 |
// Submissions Retention
|
1301 |
|
1302 |
wp_send_json_success();
|
1303 |
}
|
1304 |
|
1305 |
-
/**
|
1306 |
-
* Load Export Custom Form Popup
|
1307 |
-
*
|
1308 |
-
* @since 1.5
|
1309 |
-
*/
|
1310 |
-
public function load_export_custom_form() {
|
1311 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1312 |
-
wp_send_json_success( '' );
|
1313 |
-
}
|
1314 |
-
// Validate nonce
|
1315 |
-
forminator_validate_ajax( 'forminator_popup_export_cform' );
|
1316 |
-
|
1317 |
-
$html = forminator_template( 'custom-form/popup/export' );
|
1318 |
-
|
1319 |
-
wp_send_json_success( $html );
|
1320 |
-
}
|
1321 |
-
|
1322 |
/**
|
1323 |
* AJAX Reset tracking data
|
1324 |
*/
|
@@ -1328,29 +1257,12 @@ class Forminator_Admin_AJAX {
|
|
1328 |
|
1329 |
$id = filter_input( INPUT_POST, 'id', FILTER_VALIDATE_INT );
|
1330 |
if ( ! $id ) {
|
1331 |
-
wp_send_json_error( __( 'Required id parameter is not set.',
|
1332 |
}
|
1333 |
|
1334 |
Forminator_Admin_Module_Edit_Page::reset_module_views( $id );
|
1335 |
|
1336 |
-
wp_send_json_success( __( 'Tracking Data has been reset successfully.',
|
1337 |
-
}
|
1338 |
-
|
1339 |
-
/**
|
1340 |
-
* Load Import Custom Form Popup
|
1341 |
-
*
|
1342 |
-
* @since 1.5
|
1343 |
-
*/
|
1344 |
-
public function load_import_custom_form() {
|
1345 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1346 |
-
wp_send_json_success( '' );
|
1347 |
-
}
|
1348 |
-
// Validate nonce
|
1349 |
-
forminator_validate_ajax( 'forminator_popup_import_cform' );
|
1350 |
-
|
1351 |
-
$html = forminator_template( 'custom-form/popup/import' );
|
1352 |
-
|
1353 |
-
wp_send_json_success( $html );
|
1354 |
}
|
1355 |
|
1356 |
/**
|
@@ -1358,47 +1270,51 @@ class Forminator_Admin_AJAX {
|
|
1358 |
*
|
1359 |
* @since 1.5
|
1360 |
*/
|
1361 |
-
public function
|
1362 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1363 |
-
wp_send_json_error( __( 'Import Export Feature disabled.',
|
|
|
|
|
|
|
|
|
|
|
1364 |
}
|
1365 |
// Validate nonce
|
1366 |
-
forminator_validate_ajax( '
|
1367 |
|
1368 |
$post_data = $this->get_post_data();
|
1369 |
-
$importable = isset( $post_data['importable'] ) ? $post_data['importable'] : '';// wpcs: CSRF ok
|
1370 |
-
$importable = trim( $importable );
|
1371 |
-
$importable = wp_unslash( $importable );
|
1372 |
|
1373 |
$import_data = json_decode( $importable, true );
|
1374 |
|
1375 |
//hook custom data here
|
1376 |
-
$import_data = apply_filters( '
|
1377 |
|
1378 |
try {
|
1379 |
if ( empty( $importable ) ) {
|
1380 |
-
throw new Exception( __( 'Import text can not be empty.',
|
1381 |
}
|
1382 |
|
1383 |
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
1384 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.',
|
1385 |
}
|
1386 |
|
1387 |
-
if ( ! isset( $import_data['type'] ) ||
|
1388 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.',
|
1389 |
}
|
1390 |
|
1391 |
-
$
|
|
|
1392 |
|
1393 |
if ( is_wp_error( $model ) ) {
|
1394 |
throw new Exception( $model->get_error_message() );
|
1395 |
}
|
1396 |
|
1397 |
-
if ( ! $model instanceof
|
1398 |
-
throw new Exception( __( 'Failed to import
|
1399 |
}
|
1400 |
|
1401 |
-
$return_url = admin_url( 'admin.php?page=forminator-
|
1402 |
|
1403 |
wp_send_json_success(
|
1404 |
array(
|
@@ -1470,7 +1386,7 @@ class Forminator_Admin_AJAX {
|
|
1470 |
global $wpdb, $wpcf7_shortcode_manager;
|
1471 |
|
1472 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled( 'cf7' ) ) {
|
1473 |
-
wp_send_json_error( __( 'Import Export Feature disabled.',
|
1474 |
}
|
1475 |
// Validate nonce
|
1476 |
forminator_validate_ajax( "forminator_save_import_custom_form_cf7" );
|
@@ -1502,11 +1418,11 @@ class Forminator_Admin_AJAX {
|
|
1502 |
wp_send_json_success( $imported );
|
1503 |
}
|
1504 |
} else {
|
1505 |
-
wp_send_json_error( __( 'Can\'t find form to import',
|
1506 |
}
|
1507 |
endif;
|
1508 |
|
1509 |
-
wp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active',
|
1510 |
|
1511 |
}
|
1512 |
|
@@ -1536,7 +1452,7 @@ class Forminator_Admin_AJAX {
|
|
1536 |
public function save_import_custom_form_ninja() {
|
1537 |
|
1538 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('ninjaforms') ) {
|
1539 |
-
wp_send_json_error( __( 'Import Export Feature disabled.',
|
1540 |
}
|
1541 |
// Validate nonce
|
1542 |
forminator_validate_ajax( "forminator_save_import_custom_form_ninja" );
|
@@ -1576,7 +1492,7 @@ class Forminator_Admin_AJAX {
|
|
1576 |
}
|
1577 |
endif;
|
1578 |
|
1579 |
-
wp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active',
|
1580 |
}
|
1581 |
|
1582 |
/**
|
@@ -1604,7 +1520,7 @@ class Forminator_Admin_AJAX {
|
|
1604 |
public function save_import_custom_form_gravity() {
|
1605 |
|
1606 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('gravityforms') ) {
|
1607 |
-
wp_send_json_error( __( 'Import Export Feature disabled.',
|
1608 |
}
|
1609 |
// Validate nonce
|
1610 |
forminator_validate_ajax( "forminator_save_import_custom_form_gravity" );
|
@@ -1647,186 +1563,50 @@ class Forminator_Admin_AJAX {
|
|
1647 |
}
|
1648 |
|
1649 |
/**
|
1650 |
-
* Load Export
|
1651 |
*
|
1652 |
* @since 1.5
|
1653 |
*/
|
1654 |
-
public function
|
1655 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1656 |
wp_send_json_success( '' );
|
1657 |
}
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
wp_send_json_success( $html );
|
1664 |
-
}
|
1665 |
-
|
1666 |
-
/**
|
1667 |
-
* Load Import Poll Popup
|
1668 |
-
*
|
1669 |
-
* @since 1.5
|
1670 |
-
*/
|
1671 |
-
public function load_import_poll() {
|
1672 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1673 |
-
wp_send_json_success( '' );
|
1674 |
}
|
1675 |
// Validate nonce
|
1676 |
-
forminator_validate_ajax( '
|
1677 |
|
1678 |
-
$html = forminator_template( '
|
1679 |
|
1680 |
wp_send_json_success( $html );
|
1681 |
}
|
1682 |
|
1683 |
/**
|
1684 |
-
*
|
1685 |
-
*
|
1686 |
-
* @since 1.5
|
1687 |
-
*/
|
1688 |
-
public function save_import_poll() {
|
1689 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1690 |
-
wp_send_json_error( __( 'Import Export Feature disabled.', Forminator::DOMAIN ) );
|
1691 |
-
}
|
1692 |
-
// Validate nonce
|
1693 |
-
forminator_validate_ajax( 'forminator_save_import_poll' );
|
1694 |
-
|
1695 |
-
$post_data = $this->get_post_data();
|
1696 |
-
$importable = isset( $post_data['importable'] ) ? $post_data['importable'] : '';// wpcs: CSRF ok
|
1697 |
-
$importable = trim( $importable );
|
1698 |
-
$importable = wp_unslash( $importable );
|
1699 |
-
|
1700 |
-
try {
|
1701 |
-
if ( empty( $importable ) ) {
|
1702 |
-
throw new Exception( __( 'Import text can not be empty.', Forminator::DOMAIN ) );
|
1703 |
-
}
|
1704 |
-
|
1705 |
-
$import_data = json_decode( $importable, true );
|
1706 |
-
|
1707 |
-
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
1708 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', Forminator::DOMAIN ) );
|
1709 |
-
}
|
1710 |
-
|
1711 |
-
if ( ! isset( $import_data['type'] ) || 'poll' !== $import_data['type'] ) {
|
1712 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', Forminator::DOMAIN ) );
|
1713 |
-
}
|
1714 |
-
|
1715 |
-
$model = Forminator_Poll_Form_Model::create_from_import_data( $import_data, 'Forminator_Poll_Form_Model' );
|
1716 |
-
|
1717 |
-
if ( is_wp_error( $model ) ) {
|
1718 |
-
throw new Exception( $model->get_error_message() );
|
1719 |
-
}
|
1720 |
-
|
1721 |
-
if ( ! $model instanceof Forminator_Poll_Form_Model ) {
|
1722 |
-
throw new Exception( __( 'Failed to import poll, please make sure import text is valid, and try again.', Forminator::DOMAIN ) );
|
1723 |
-
}
|
1724 |
-
|
1725 |
-
$return_url = admin_url( 'admin.php?page=forminator-poll' );
|
1726 |
-
|
1727 |
-
wp_send_json_success(
|
1728 |
-
array(
|
1729 |
-
'id' => $model->id,
|
1730 |
-
'url' => $return_url,
|
1731 |
-
)
|
1732 |
-
);
|
1733 |
-
|
1734 |
-
} catch ( Exception $e ) {
|
1735 |
-
wp_send_json_error( $e->getMessage() );
|
1736 |
-
}
|
1737 |
-
}
|
1738 |
-
|
1739 |
-
/**
|
1740 |
-
* Load Export Quiz Popup
|
1741 |
*
|
1742 |
* @since 1.5
|
1743 |
*/
|
1744 |
-
public function
|
1745 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1746 |
wp_send_json_success( '' );
|
1747 |
}
|
1748 |
-
// Validate nonce
|
1749 |
-
forminator_validate_ajax( 'forminator_popup_export_quiz' );
|
1750 |
-
|
1751 |
-
$html = forminator_template( 'quiz/popup/export' );
|
1752 |
-
|
1753 |
-
wp_send_json_success( $html );
|
1754 |
-
}
|
1755 |
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
*/
|
1761 |
-
public function load_import_quiz() {
|
1762 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1763 |
-
wp_send_json_success( '' );
|
1764 |
}
|
1765 |
// Validate nonce
|
1766 |
-
forminator_validate_ajax( '
|
1767 |
|
1768 |
-
$html = forminator_template( '
|
1769 |
|
1770 |
wp_send_json_success( $html );
|
1771 |
}
|
1772 |
|
1773 |
-
/**
|
1774 |
-
* Execute Import Quiz
|
1775 |
-
*
|
1776 |
-
* @since 1.5
|
1777 |
-
*/
|
1778 |
-
public function save_import_quiz() {
|
1779 |
-
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1780 |
-
wp_send_json_error( __( 'Import Export Feature disabled.', Forminator::DOMAIN ) );
|
1781 |
-
}
|
1782 |
-
// Validate nonce
|
1783 |
-
forminator_validate_ajax( 'forminator_save_import_quiz' );
|
1784 |
-
|
1785 |
-
$post_data = $this->get_post_data();
|
1786 |
-
$importable = isset( $post_data['importable'] ) ? $post_data['importable'] : '';// wpcs: CSRF ok
|
1787 |
-
$importable = trim( $importable );
|
1788 |
-
$importable = wp_unslash( $importable );
|
1789 |
-
|
1790 |
-
try {
|
1791 |
-
if ( empty( $importable ) ) {
|
1792 |
-
throw new Exception( __( 'Import text can not be empty.', Forminator::DOMAIN ) );
|
1793 |
-
}
|
1794 |
-
|
1795 |
-
$import_data = json_decode( $importable, true );
|
1796 |
-
|
1797 |
-
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
1798 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', Forminator::DOMAIN ) );
|
1799 |
-
}
|
1800 |
-
|
1801 |
-
if ( ! isset( $import_data['type'] ) || 'quiz' !== $import_data['type'] ) {
|
1802 |
-
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', Forminator::DOMAIN ) );
|
1803 |
-
}
|
1804 |
-
|
1805 |
-
/** @var Forminator_Quiz_Form_Model|WP_Error $model */
|
1806 |
-
$model = Forminator_Quiz_Form_Model::create_from_import_data( $import_data, 'Forminator_Quiz_Form_Model' );
|
1807 |
-
|
1808 |
-
if ( is_wp_error( $model ) ) {
|
1809 |
-
throw new Exception( $model->get_error_message() );
|
1810 |
-
}
|
1811 |
-
|
1812 |
-
if ( ! $model instanceof Forminator_Quiz_Form_Model ) {
|
1813 |
-
throw new Exception( __( 'Failed to import quiz, please make sure import text is valid, and try again.', Forminator::DOMAIN ) );
|
1814 |
-
}
|
1815 |
-
|
1816 |
-
$return_url = admin_url( 'admin.php?page=forminator-quiz' );
|
1817 |
-
|
1818 |
-
wp_send_json_success(
|
1819 |
-
array(
|
1820 |
-
'id' => $model->id,
|
1821 |
-
'url' => $return_url,
|
1822 |
-
)
|
1823 |
-
);
|
1824 |
-
|
1825 |
-
} catch ( Exception $e ) {
|
1826 |
-
wp_send_json_error( $e->getMessage() );
|
1827 |
-
}
|
1828 |
-
}
|
1829 |
-
|
1830 |
/**
|
1831 |
* Save pagination data
|
1832 |
*
|
@@ -1840,7 +1620,7 @@ class Forminator_Admin_AJAX {
|
|
1840 |
$pagination_listing = intval( sanitize_text_field( $_POST['pagination_listings'] ) );
|
1841 |
|
1842 |
if ( 1 > $pagination || 1 > $pagination_listing ) {
|
1843 |
-
wp_send_json_error( __( 'Limit per page can not be less than one.',
|
1844 |
}
|
1845 |
|
1846 |
update_option( 'forminator_pagination_entries', $pagination );
|
@@ -1918,7 +1698,7 @@ class Forminator_Admin_AJAX {
|
|
1918 |
|
1919 |
|
1920 |
if ( 1 > $pagination || 1 > $pagination_listing ) {
|
1921 |
-
wp_send_json_error( __( 'Limit per page can not be less than one.',
|
1922 |
}
|
1923 |
|
1924 |
update_option( 'forminator_pagination_entries', $pagination );
|
@@ -1952,10 +1732,10 @@ class Forminator_Admin_AJAX {
|
|
1952 |
$calculator->set_is_throwable( true );
|
1953 |
$calculator->parse();
|
1954 |
|
1955 |
-
wp_send_json_success( __( 'Calculation formula validated successfully.',
|
1956 |
|
1957 |
} catch ( Forminator_Calculator_Exception $e ) {
|
1958 |
-
wp_send_json_error( __( 'Invalid calculation formula. Please check again.',
|
1959 |
}
|
1960 |
}
|
1961 |
|
@@ -1973,7 +1753,7 @@ class Forminator_Admin_AJAX {
|
|
1973 |
}
|
1974 |
$data['notification'] = array(
|
1975 |
'type' => 'success',
|
1976 |
-
'text' => __( 'Stripe account disconnected successfully.',
|
1977 |
'duration' => '4000',
|
1978 |
);
|
1979 |
$file = forminator_plugin_dir() . 'admin/views/settings/payments/section-stripe.php';
|
@@ -2000,7 +1780,7 @@ class Forminator_Admin_AJAX {
|
|
2000 |
}
|
2001 |
$data['notification'] = array(
|
2002 |
'type' => 'success',
|
2003 |
-
'text' => __( 'PayPal account disconnected successfully.',
|
2004 |
'duration' => '4000',
|
2005 |
);
|
2006 |
$file = forminator_plugin_dir() . 'admin/views/settings/payments/section-paypal.php';
|
@@ -2126,7 +1906,7 @@ class Forminator_Admin_AJAX {
|
|
2126 |
|
2127 |
$data['notification'] = array(
|
2128 |
'type' => 'success',
|
2129 |
-
'text' => __( 'Stripe account connected successfully. You can now add the Stripe field to your forms and start collecting payments.',
|
2130 |
'duration' => '4000',
|
2131 |
);
|
2132 |
|
@@ -2172,7 +1952,7 @@ class Forminator_Admin_AJAX {
|
|
2172 |
|
2173 |
$data['buttons']['connect']['markup'] = '<div class="sui-actions-right">' .
|
2174 |
'<button class="sui-button forminator-stripe-connect" type="button" data-nonce="' . wp_create_nonce( 'forminator_stripe_settings_modal' ) . '">' .
|
2175 |
-
'<span class="sui-loading-text">' . esc_html__( 'Connect',
|
2176 |
'<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>' .
|
2177 |
'</button>' .
|
2178 |
'</div>';
|
@@ -2252,7 +2032,7 @@ class Forminator_Admin_AJAX {
|
|
2252 |
|
2253 |
$data['notification'] = array(
|
2254 |
'type' => 'success',
|
2255 |
-
'text' => __( 'PayPal account connected successfully. You can now add the PayPal field to your forms and start collecting payments.',
|
2256 |
'duration' => '4000',
|
2257 |
);
|
2258 |
|
@@ -2298,7 +2078,7 @@ class Forminator_Admin_AJAX {
|
|
2298 |
|
2299 |
$data['buttons']['connect']['markup'] = '<div class="sui-actions-right">' .
|
2300 |
'<button class="sui-button forminator-paypal-connect" type="button" data-nonce="' . wp_create_nonce( 'forminator_paypal_settings_modal' ) . '">' .
|
2301 |
-
'<span class="sui-loading-text">' . esc_html__( 'Connect',
|
2302 |
'<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>' .
|
2303 |
'</button>' .
|
2304 |
'</div>';
|
@@ -2450,14 +2230,14 @@ class Forminator_Admin_AJAX {
|
|
2450 |
$data['html'] = $html;
|
2451 |
$data['notification'] = array(
|
2452 |
'type' => 'success',
|
2453 |
-
'text' => __( 'All the submissions deleted successfully.',
|
2454 |
'duration' => '4000',
|
2455 |
);
|
2456 |
wp_send_json_success( $data );
|
2457 |
} else {
|
2458 |
$data['notification'] = array(
|
2459 |
'type' => 'error',
|
2460 |
-
'text' => __( 'Submission delete failed.',
|
2461 |
'duration' => '4000',
|
2462 |
);
|
2463 |
wp_send_json_error( $data );
|
52 |
add_action( 'wp_ajax_forminator_load_uninstall_settings_popup', array( $this, 'load_uninstall_form' ) );
|
53 |
add_action( 'wp_ajax_forminator_save_uninstall_settings_popup', array( $this, 'save_uninstall_form' ) );
|
54 |
|
55 |
+
add_action( 'wp_ajax_forminator_load_preview_cforms_popup', array( $this, 'preview_module' ) );
|
56 |
+
add_action( 'wp_ajax_forminator_load_preview_polls_popup', array( $this, 'preview_module' ) );
|
57 |
+
add_action( 'wp_ajax_forminator_load_preview_quizzes_popup', array( $this, 'preview_module' ) );
|
58 |
|
59 |
// Handle exports popup
|
60 |
add_action( 'wp_ajax_forminator_load_exports_popup', array( $this, 'load_exports' ) );
|
66 |
add_action( 'wp_ajax_forminator_load_privacy_settings_popup', array( $this, 'load_privacy_settings' ) );
|
67 |
add_action( 'wp_ajax_forminator_save_privacy_settings_popup', array( $this, 'save_privacy_settings' ) );
|
68 |
|
69 |
+
add_action( 'wp_ajax_forminator_load_export_custom_form_popup', array( $this, 'load_export' ) );
|
70 |
+
add_action( 'wp_ajax_forminator_load_import_custom_form_popup', array( $this, 'load_import' ) );
|
71 |
+
add_action( 'wp_ajax_forminator_save_import_custom_form_popup', array( $this, 'save_import' ) );
|
72 |
|
73 |
add_action( "wp_ajax_forminator_load_import_custom_form_cf7_popup", array( $this, "load_import_custom_form_cf7" ) );
|
74 |
add_action( "wp_ajax_forminator_save_import_custom_form_cf7_popup", array( $this, "save_import_custom_form_cf7" ) );
|
79 |
add_action( "wp_ajax_forminator_load_import_custom_form_gravity_popup", array( $this, "load_import_custom_form_gravity" ) );
|
80 |
add_action( "wp_ajax_forminator_save_import_custom_form_gravity_popup", array( $this, "save_import_custom_form_gravity" ) );
|
81 |
|
82 |
+
add_action( 'wp_ajax_forminator_load_export_poll_popup', array( $this, 'load_export' ) );
|
83 |
+
add_action( 'wp_ajax_forminator_load_import_poll_popup', array( $this, 'load_import' ) );
|
84 |
+
add_action( 'wp_ajax_forminator_save_import_poll_popup', array( $this, 'save_import' ) );
|
85 |
|
86 |
add_action( 'wp_ajax_forminator_delete_poll_submissions', array( $this, 'delete_poll_submissions' ) );
|
87 |
|
88 |
+
add_action( 'wp_ajax_forminator_load_export_quiz_popup', array( $this, 'load_export' ) );
|
89 |
+
add_action( 'wp_ajax_forminator_load_import_quiz_popup', array( $this, 'load_import' ) );
|
90 |
+
add_action( 'wp_ajax_forminator_save_import_quiz_popup', array( $this, 'save_import' ) );
|
91 |
|
92 |
add_action( 'wp_ajax_forminator_save_accessibility_settings_popup', array( $this, 'save_accessibility_settings' ) );
|
93 |
|
121 |
*/
|
122 |
public function save_quiz() {
|
123 |
if ( ! forminator_is_user_allowed() ) {
|
124 |
+
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.', 'forminator' ) );
|
125 |
}
|
126 |
|
127 |
forminator_validate_ajax( 'forminator_save_quiz' );
|
136 |
|
137 |
$questions = array();
|
138 |
$results = array();
|
139 |
+
$id = isset( $submitted_data['form_id'] ) ? intval( $submitted_data['form_id'] ) : 0;
|
|
|
|
|
|
|
140 |
$title = isset( $submitted_data['quiz_title'] ) ? sanitize_text_field( $submitted_data['quiz_title'] ) : sanitize_text_field( $submitted_data['formName'] );
|
141 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
142 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
144 |
$notifications = array();
|
145 |
|
146 |
if ( is_null( $id ) || $id <= 0 ) {
|
147 |
+
$form_model = new Forminator_Quiz_Model();
|
148 |
$action = 'create';
|
149 |
|
150 |
if ( empty( $status ) ) {
|
151 |
+
$status = Forminator_Poll_Model::STATUS_PUBLISH;
|
152 |
}
|
153 |
} else {
|
154 |
+
$form_model = Forminator_Quiz_Model::model()->load( $id );
|
155 |
$action = 'update';
|
156 |
|
157 |
if ( ! is_object( $form_model ) ) {
|
158 |
+
wp_send_json_error( __( "Quiz model doesn't exist", 'forminator' ) );
|
159 |
}
|
160 |
|
161 |
if ( empty( $status ) ) {
|
208 |
// Handle quiz questions
|
209 |
$form_model->questions = $questions;
|
210 |
|
211 |
+
$settings = self::validate_settings( $quiz_data );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
if ( isset( $quiz_data['notifications'] ) ) {
|
214 |
$notifications = forminator_sanitize_field( $quiz_data['notifications'] );
|
223 |
}
|
224 |
}
|
225 |
|
|
|
|
|
|
|
|
|
|
|
226 |
// version
|
227 |
$settings['version'] = $version;
|
228 |
|
253 |
*/
|
254 |
do_action( 'forminator_quiz_action_' . $action, $id, $type, $status, $questions, $results );
|
255 |
|
256 |
+
Forminator_Render_Form::regenerate_css_file( $id );
|
257 |
|
258 |
wp_send_json_success( $id );
|
259 |
}
|
266 |
*/
|
267 |
public function save_poll_form() {
|
268 |
if ( ! forminator_is_user_allowed() ) {
|
269 |
+
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.', 'forminator' ) );
|
270 |
}
|
271 |
|
272 |
forminator_validate_ajax( 'forminator_save_poll' );
|
279 |
}
|
280 |
|
281 |
$answers = array();
|
282 |
+
$id = isset( $submitted_data['form_id'] ) ? intval( $submitted_data['form_id'] ) : 0;
|
|
|
|
|
283 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
284 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
285 |
$action = false;
|
286 |
|
287 |
if ( is_null( $id ) || $id <= 0 ) {
|
288 |
+
$form_model = new Forminator_Poll_Model();
|
289 |
$action = 'create';
|
290 |
|
291 |
if ( empty( $status ) ) {
|
292 |
+
$status = Forminator_Poll_Model::STATUS_PUBLISH;
|
293 |
}
|
294 |
} else {
|
295 |
+
$form_model = Forminator_Poll_Model::model()->load( $id );
|
296 |
$action = 'update';
|
297 |
|
298 |
if ( ! is_object( $form_model ) ) {
|
299 |
+
wp_send_json_error( __( "Poll model doesn't exist", 'forminator' ) );
|
300 |
}
|
301 |
|
302 |
if ( empty( $status ) ) {
|
315 |
$answers = wp_slash( $answers );
|
316 |
}
|
317 |
|
318 |
+
$settings = self::validate_settings( $poll_data );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
319 |
|
320 |
// version
|
321 |
$settings['version'] = $version;
|
367 |
}
|
368 |
}
|
369 |
|
370 |
+
forminator_update_poll_submissions_retention( $id, $retention_number, $retention_unit );
|
371 |
+
|
372 |
+
Forminator_Render_Form::regenerate_css_file( $id );
|
373 |
|
374 |
wp_send_json_success( $id );
|
375 |
}
|
381 |
*/
|
382 |
public function save_builder() {
|
383 |
if ( ! forminator_is_user_allowed() ) {
|
384 |
+
wp_send_json_error( __( 'Invalid request, you are not allowed to do that action.', 'forminator' ) );
|
385 |
}
|
386 |
|
387 |
forminator_validate_ajax( 'forminator_save_builder_fields' );
|
391 |
$form_data = json_decode( stripslashes( $form_data ), true );
|
392 |
$fields = array();
|
393 |
$notifications = array();
|
394 |
+
$id = isset( $submitted_data['form_id'] ) ? intval( $submitted_data['form_id'] ) : 0;
|
|
|
395 |
$title = sanitize_text_field( $submitted_data['formName'] );
|
396 |
$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';
|
397 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
398 |
$action = false;
|
399 |
|
400 |
if ( is_null( $id ) || $id <= 0 ) {
|
401 |
+
$form_model = new Forminator_Form_Model();
|
402 |
$action = 'create';
|
403 |
|
404 |
if ( empty( $status ) ) {
|
405 |
+
$status = Forminator_Form_Model::STATUS_PUBLISH;
|
406 |
}
|
407 |
} else {
|
408 |
+
$form_model = Forminator_Form_Model::model()->load( $id );
|
409 |
$action = 'update';
|
410 |
|
411 |
if ( ! is_object( $form_model ) ) {
|
412 |
+
wp_send_json_error( __( "Form model doesn't exist", 'forminator' ) );
|
413 |
}
|
414 |
|
415 |
if ( empty( $status ) ) {
|
439 |
}
|
440 |
}
|
441 |
|
442 |
+
$settings = self::validate_settings( $form_data );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
|
444 |
if ( isset( $form_data['notifications'] ) ) {
|
445 |
$notifications = forminator_sanitize_field( $form_data['notifications'] );
|
512 |
|
513 |
forminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );
|
514 |
|
515 |
+
Forminator_Render_Form::regenerate_css_file( $id );
|
|
|
|
|
|
|
516 |
|
517 |
wp_send_json_success( $id );
|
518 |
}
|
519 |
|
520 |
+
/**
|
521 |
+
* Prepare settings
|
522 |
+
*
|
523 |
+
* @param array $sent_data Sent settings.
|
524 |
+
* @return array
|
525 |
+
*/
|
526 |
+
private static function validate_settings( $sent_data ) {
|
527 |
+
$settings = array();
|
528 |
+
if ( isset( $sent_data['settings'] ) ) {
|
529 |
+
// Sanitize settings.
|
530 |
+
$settings = forminator_sanitize_field( $sent_data['settings'] );
|
531 |
+
|
532 |
+
// Sanitize custom css.
|
533 |
+
if ( isset( $sent_data['settings']['custom_css'] ) ) {
|
534 |
+
$settings['custom_css'] = sanitize_textarea_field( $sent_data['settings']['custom_css'] );
|
535 |
+
}
|
536 |
+
|
537 |
+
// Sanitize admin email message.
|
538 |
+
if ( isset( $sent_data['settings']['admin-email-editor'] ) ) {
|
539 |
+
$settings['admin-email-editor'] = $sent_data['settings']['admin-email-editor'];
|
540 |
+
}
|
541 |
+
|
542 |
+
// Sanitize quiz description.
|
543 |
+
if ( isset( $sent_data['settings']['quiz_description'] ) ) {
|
544 |
+
$settings['quiz_description'] = $sent_data['settings']['quiz_description'];
|
545 |
+
}
|
546 |
+
|
547 |
+
if ( isset( $sent_data['settings']['social-share-message'] ) ) {
|
548 |
+
$settings['social-share-message'] = forminator_sanitize_textarea( $sent_data['settings']['social-share-message'] );
|
549 |
+
}
|
550 |
+
|
551 |
+
if ( isset( $sent_data['settings']['msg_count'] ) ) {
|
552 |
+
// Backup, we allow html here.
|
553 |
+
$settings['msg_count'] = $sent_data['settings']['msg_count'];
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
$settings = apply_filters( 'forminator_builder_data_settings_before_saving', $settings, $sent_data['settings'] );
|
558 |
+
|
559 |
+
return $settings;
|
560 |
+
}
|
561 |
+
|
562 |
/**
|
563 |
* Save custom form settings
|
564 |
*
|
581 |
$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';
|
582 |
|
583 |
if ( is_null( $id ) || $id <= 0 ) {
|
584 |
+
$form_model = new Forminator_Form_Model();
|
585 |
|
586 |
if ( empty( $status ) ) {
|
587 |
+
$status = Forminator_Form_Model::STATUS_PUBLISH;
|
588 |
}
|
589 |
|
590 |
} else {
|
591 |
+
$form_model = Forminator_Form_Model::model()->load( $id );
|
592 |
|
593 |
if ( ! is_object( $form_model ) ) {
|
594 |
+
wp_send_json_error( __( "Form model doesn't exist", 'forminator' ) );
|
595 |
}
|
596 |
if ( empty( $status ) ) {
|
597 |
$status = $form_model->status;
|
824 |
|
825 |
} else {
|
826 |
$html .= '<div class="sui-notice">';
|
827 |
+
$html .= '<p>' . esc_html__( 'You have to first save your credentials to load the reCAPTCHA . ', 'forminator' ) . '</p>';
|
828 |
$html .= '</div>';
|
829 |
}
|
830 |
|
863 |
|
864 |
} else {
|
865 |
|
866 |
+
wp_send_json_error( __( 'Limit per page can not be less than one.', 'forminator' ) );
|
867 |
|
868 |
}
|
869 |
|
916 |
}
|
917 |
|
918 |
/**
|
919 |
+
* Preview module
|
920 |
*
|
921 |
* @since 1.0
|
922 |
*/
|
923 |
+
public function preview_module() {
|
924 |
+
$current_action = current_action();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
925 |
|
926 |
+
$current_action = current_action();
|
927 |
+
$slug = str_replace( array( 'wp_ajax_forminator_load_preview_', '_popup' ), '', $current_action );
|
928 |
+
if ( 'cforms' === $slug ) {
|
929 |
+
$slug = 'form';
|
930 |
+
} elseif ( 'polls' === $slug ) {
|
931 |
+
$slug = 'poll';
|
932 |
+
} elseif ( 'quizzes' === $slug ) {
|
933 |
+
$slug = 'quiz';
|
934 |
}
|
935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
936 |
// Validate nonce
|
937 |
+
forminator_validate_ajax( 'forminator_popup_preview_' . $slug );
|
938 |
|
939 |
$preview_data = false;
|
940 |
// force -1 for preview
|
941 |
$form_id = isset( $_POST['id'] ) ? intval( $_POST['id'] ) : -1;// phpcs:ignore -- by forminator_validate_ajax
|
942 |
|
|
|
|
|
|
|
|
|
943 |
// Check if preview data set
|
944 |
+
if ( ! empty( $_POST['data'] ) ) {
|
945 |
+
$data = $_POST['data']; // WPCS: CSRF ok by forminator_validate_ajax.
|
|
|
946 |
|
947 |
if ( ! is_array( $data ) ) {
|
948 |
$data = json_decode( stripslashes( $data ), true );
|
949 |
}
|
950 |
+
$function = 'forminator_data_to_model_' . $slug;
|
951 |
+
$preview_data = $function( $data );// phpcs:ignore -- by forminator_validate_ajax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
952 |
}
|
953 |
|
954 |
+
$html = forminator_preview( $form_id, $slug, true, $preview_data );
|
955 |
|
956 |
wp_send_json_success( $html );
|
957 |
}
|
974 |
$html = forminator_template( 'settings/popup/exports-content', $args );
|
975 |
wp_send_json_success( $html );
|
976 |
} else {
|
977 |
+
wp_send_json_error( __( 'Not valid module ID provided.', 'forminator' ) );
|
978 |
}
|
979 |
}
|
980 |
|
990 |
$form_id = isset( $_POST['id'] ) && $_POST['id'] >= 0 ? intval( $_POST['id'] ) : false;
|
991 |
|
992 |
if ( ! $form_id ) {
|
993 |
+
wp_send_json_error( __( 'No ID was provided.', 'forminator' ) );
|
994 |
}
|
995 |
|
996 |
$was_cleared = delete_export_logs( $form_id );
|
997 |
|
998 |
if ( $was_cleared ) {
|
999 |
+
wp_send_json_success( __( 'Exports cleared.', 'forminator' ) );
|
1000 |
} else {
|
1001 |
+
wp_send_json_error( __( "Exports couldn't be cleared.", 'forminator' ) );
|
1002 |
}
|
1003 |
}
|
1004 |
|
1149 |
// Account Erasure Requests
|
1150 |
|
1151 |
// Submissions Retention
|
1152 |
+
$cform_retain_forever = filter_var( $post_data['form_retain_submission_forever'], FILTER_VALIDATE_BOOLEAN );
|
1153 |
update_option( 'retain_submission_forever', $cform_retain_forever );
|
1154 |
if ( $cform_retain_forever ) {
|
1155 |
+
$post_data['form_retain_submission_number'] = 0;
|
1156 |
}
|
1157 |
+
if ( isset( $post_data['form_retain_submission_number'] ) ) {
|
1158 |
+
$post_data['form_retain_submission_number'] = sanitize_text_field( $post_data['form_retain_submission_number'] );
|
1159 |
+
$post_data['form_retain_submission_unit'] = sanitize_text_field( $post_data['form_retain_submission_unit'] );
|
1160 |
+
$submissions_retention_number = intval( $post_data['form_retain_submission_number'] );
|
1161 |
if ( $submissions_retention_number < 0 ) {
|
1162 |
$submissions_retention_number = 0;
|
1163 |
}
|
1164 |
update_option( 'forminator_retain_submissions_interval_number', $submissions_retention_number );
|
1165 |
}
|
1166 |
+
update_option( 'forminator_retain_submissions_interval_unit', $post_data['form_retain_submission_unit'] );
|
1167 |
// Submissions Retention
|
1168 |
|
1169 |
// IP Retention
|
1170 |
+
$cform_retain_ip_forever = filter_var( $post_data['form_retain_ip_forever'], FILTER_VALIDATE_BOOLEAN );
|
1171 |
update_option( 'retain_ip_forever', $cform_retain_ip_forever );
|
1172 |
if ( $cform_retain_ip_forever ) {
|
1173 |
+
$post_data['form_retain_ip_number'] = 0;
|
1174 |
}
|
1175 |
+
if ( isset( $post_data['form_retain_ip_number'] ) ) {
|
1176 |
+
$post_data['form_retain_ip_number'] = sanitize_text_field( $post_data['form_retain_ip_number'] );
|
1177 |
+
$post_data['form_retain_ip_unit'] = sanitize_text_field( $post_data['form_retain_ip_unit'] );
|
1178 |
+
$cform_ip_retention_number = intval( $post_data['form_retain_ip_number'] );
|
1179 |
if ( $cform_ip_retention_number < 0 ) {
|
1180 |
$cform_ip_retention_number = 0;
|
1181 |
}
|
1182 |
update_option( 'forminator_retain_ip_interval_number', $cform_ip_retention_number );
|
1183 |
}
|
1184 |
+
update_option( 'forminator_retain_ip_interval_unit', $post_data['form_retain_ip_unit'] );
|
1185 |
// IP Retention
|
1186 |
|
1187 |
/**
|
1191 |
$poll_retain_submissions_forever = filter_var( $post_data['poll_retain_submission_forever'], FILTER_VALIDATE_BOOLEAN );
|
1192 |
update_option( 'poll_retain_submission_forever', $poll_retain_submissions_forever );
|
1193 |
if ( $poll_retain_submissions_forever ) {
|
1194 |
+
$post_data['poll_retain_submission_number'] = 0;
|
1195 |
}
|
1196 |
// Polls
|
1197 |
+
if ( isset( $post_data['poll_retain_submission_number'] ) ) {
|
1198 |
+
$post_data['poll_retain_submission_number'] = sanitize_text_field( $post_data['poll_retain_submission_number'] );
|
1199 |
+
$post_data['poll_retain_submission_unit'] = sanitize_text_field( $post_data['poll_retain_submission_unit'] );
|
1200 |
+
$poll_submissions_retention_number = intval( $post_data['poll_retain_submission_number'] );
|
1201 |
if ( $poll_submissions_retention_number < 0 ) {
|
1202 |
$poll_submissions_retention_number = 0;
|
1203 |
}
|
1204 |
update_option( 'forminator_retain_poll_submissions_interval_number', $poll_submissions_retention_number );
|
1205 |
}
|
1206 |
+
update_option( 'forminator_retain_poll_submissions_interval_unit', $post_data['poll_retain_submission_unit'] );
|
1207 |
// Submissions Retention
|
1208 |
|
1209 |
// IP Retention
|
1210 |
+
$poll_retain_ip_forever = filter_var( $post_data['poll_retain_ip_forever'], FILTER_VALIDATE_BOOLEAN );
|
1211 |
update_option( 'retain_poll_forever', $poll_retain_ip_forever );
|
1212 |
if ( $poll_retain_ip_forever ) {
|
1213 |
+
$post_data['poll_retain_ip_number'] = 0;
|
1214 |
}
|
1215 |
+
if ( isset( $post_data['poll_retain_ip_number'] ) ) {
|
1216 |
+
$post_data['poll_retain_ip_number'] = sanitize_text_field( $post_data['poll_retain_ip_number'] );
|
1217 |
+
$post_data['poll_retain_ip_unit'] = sanitize_text_field( $post_data['poll_retain_ip_unit'] );
|
1218 |
+
$votes_retention_number = intval( $post_data['poll_retain_ip_number'] );
|
1219 |
if ( $votes_retention_number < 0 ) {
|
1220 |
$votes_retention_number = 0;
|
1221 |
}
|
1222 |
update_option( 'forminator_retain_votes_interval_number', $votes_retention_number );
|
1223 |
}
|
1224 |
+
update_option( 'forminator_retain_votes_interval_unit', $post_data['poll_retain_ip_unit'] );
|
1225 |
// IP Retention
|
1226 |
|
1227 |
/**
|
1231 |
$quiz_retain_submissions_forever = filter_var( $post_data['quiz_retain_submission_forever'], FILTER_VALIDATE_BOOLEAN );
|
1232 |
update_option( 'quiz_retain_submission_forever', $quiz_retain_submissions_forever );
|
1233 |
if ( $quiz_retain_submissions_forever ) {
|
1234 |
+
$post_data['quiz_retain_submission_number'] = 0;
|
1235 |
}
|
1236 |
+
if ( isset( $post_data['quiz_retain_submission_number'] ) ) {
|
1237 |
+
$post_data['quiz_retain_submission_number'] = sanitize_text_field( $post_data['quiz_retain_submission_number'] );
|
1238 |
+
$post_data['quiz_retain_submission_unit'] = sanitize_text_field( $post_data['quiz_retain_submission_unit'] );
|
1239 |
+
$quiz_submissions_retention_number = intval( $post_data['quiz_retain_submission_number'] );
|
1240 |
if ( $quiz_submissions_retention_number < 0 ) {
|
1241 |
$quiz_submissions_retention_number = 0;
|
1242 |
}
|
1243 |
update_option( 'forminator_retain_quiz_submissions_interval_number', $quiz_submissions_retention_number );
|
1244 |
}
|
1245 |
+
update_option( 'forminator_retain_quiz_submissions_interval_unit', $post_data['quiz_retain_submission_unit'] );
|
1246 |
// Submissions Retention
|
1247 |
|
1248 |
wp_send_json_success();
|
1249 |
}
|
1250 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1251 |
/**
|
1252 |
* AJAX Reset tracking data
|
1253 |
*/
|
1257 |
|
1258 |
$id = filter_input( INPUT_POST, 'id', FILTER_VALIDATE_INT );
|
1259 |
if ( ! $id ) {
|
1260 |
+
wp_send_json_error( __( 'Required id parameter is not set.', 'forminator' ) );
|
1261 |
}
|
1262 |
|
1263 |
Forminator_Admin_Module_Edit_Page::reset_module_views( $id );
|
1264 |
|
1265 |
+
wp_send_json_success( __( 'Tracking Data has been reset successfully.', 'forminator' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1266 |
}
|
1267 |
|
1268 |
/**
|
1270 |
*
|
1271 |
* @since 1.5
|
1272 |
*/
|
1273 |
+
public function save_import() {
|
1274 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1275 |
+
wp_send_json_error( __( 'Import Export Feature disabled.', 'forminator' ) );
|
1276 |
+
}
|
1277 |
+
$current_action = current_action();
|
1278 |
+
$slug = str_replace( array( 'wp_ajax_forminator_save_import_', '_popup' ), '', $current_action );
|
1279 |
+
if ( 'custom_form' === $slug ) {
|
1280 |
+
$slug = 'form';
|
1281 |
}
|
1282 |
// Validate nonce
|
1283 |
+
forminator_validate_ajax( 'forminator_save_import_' . $slug );
|
1284 |
|
1285 |
$post_data = $this->get_post_data();
|
1286 |
+
$importable = isset( $post_data['importable'] ) ? wp_unslash( trim( $post_data['importable'] ) ) : '';// wpcs: CSRF ok
|
|
|
|
|
1287 |
|
1288 |
$import_data = json_decode( $importable, true );
|
1289 |
|
1290 |
//hook custom data here
|
1291 |
+
$import_data = apply_filters( 'forminator_' . $slug . '_import_data', $import_data );
|
1292 |
|
1293 |
try {
|
1294 |
if ( empty( $importable ) ) {
|
1295 |
+
throw new Exception( __( 'Import text can not be empty.', 'forminator' ) );
|
1296 |
}
|
1297 |
|
1298 |
if ( empty( $import_data ) || ! is_array( $import_data ) ) {
|
1299 |
+
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', 'forminator' ) );
|
1300 |
}
|
1301 |
|
1302 |
+
if ( ! isset( $import_data['type'] ) || $slug !== $import_data['type'] ) {
|
1303 |
+
throw new Exception( __( 'Oops, looks like we found an issue. Import text can not include whitespace or special characters.', 'forminator' ) );
|
1304 |
}
|
1305 |
|
1306 |
+
$class = 'Forminator_' . forminator_get_prefix( $slug, '', true ) . '_Model';
|
1307 |
+
$model = $class::create_from_import_data( $import_data );
|
1308 |
|
1309 |
if ( is_wp_error( $model ) ) {
|
1310 |
throw new Exception( $model->get_error_message() );
|
1311 |
}
|
1312 |
|
1313 |
+
if ( ! $model instanceof Forminator_Base_Form_Model ) {
|
1314 |
+
throw new Exception( __( 'Failed to import module, please make sure import text is valid, and try again.', 'forminator' ) );
|
1315 |
}
|
1316 |
|
1317 |
+
$return_url = admin_url( 'admin.php?page=forminator-' . forminator_get_prefix( $slug, 'c' ) );
|
1318 |
|
1319 |
wp_send_json_success(
|
1320 |
array(
|
1386 |
global $wpdb, $wpcf7_shortcode_manager;
|
1387 |
|
1388 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled( 'cf7' ) ) {
|
1389 |
+
wp_send_json_error( __( 'Import Export Feature disabled.', 'forminator' ) );
|
1390 |
}
|
1391 |
// Validate nonce
|
1392 |
forminator_validate_ajax( "forminator_save_import_custom_form_cf7" );
|
1418 |
wp_send_json_success( $imported );
|
1419 |
}
|
1420 |
} else {
|
1421 |
+
wp_send_json_error( __( 'Can\'t find form to import', 'forminator' ) );
|
1422 |
}
|
1423 |
endif;
|
1424 |
|
1425 |
+
wp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active', 'forminator' ) );
|
1426 |
|
1427 |
}
|
1428 |
|
1452 |
public function save_import_custom_form_ninja() {
|
1453 |
|
1454 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('ninjaforms') ) {
|
1455 |
+
wp_send_json_error( __( 'Import Export Feature disabled.', 'forminator' ) );
|
1456 |
}
|
1457 |
// Validate nonce
|
1458 |
forminator_validate_ajax( "forminator_save_import_custom_form_ninja" );
|
1492 |
}
|
1493 |
endif;
|
1494 |
|
1495 |
+
wp_send_json_error( __( 'Could not import the forms. Check if the selected form plugin is active', 'forminator' ) );
|
1496 |
}
|
1497 |
|
1498 |
/**
|
1520 |
public function save_import_custom_form_gravity() {
|
1521 |
|
1522 |
if ( ! Forminator::is_import_export_feature_enabled() || ! forminator_is_import_plugin_enabled('gravityforms') ) {
|
1523 |
+
wp_send_json_error( __( 'Import Export Feature disabled.', 'forminator' ) );
|
1524 |
}
|
1525 |
// Validate nonce
|
1526 |
forminator_validate_ajax( "forminator_save_import_custom_form_gravity" );
|
1563 |
}
|
1564 |
|
1565 |
/**
|
1566 |
+
* Load Export Module Popup
|
1567 |
*
|
1568 |
* @since 1.5
|
1569 |
*/
|
1570 |
+
public function load_export() {
|
1571 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1572 |
wp_send_json_success( '' );
|
1573 |
}
|
1574 |
+
$current_action = current_action();
|
1575 |
+
$slug = str_replace( array( 'wp_ajax_forminator_load_export_', '_popup' ), '', $current_action );
|
1576 |
+
if ( 'custom_form' === $slug ) {
|
1577 |
+
$slug = 'form';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1578 |
}
|
1579 |
// Validate nonce
|
1580 |
+
forminator_validate_ajax( 'forminator_popup_export_' . $slug );
|
1581 |
|
1582 |
+
$html = forminator_template( 'common/popup/export', array( 'slug' => $slug ) );
|
1583 |
|
1584 |
wp_send_json_success( $html );
|
1585 |
}
|
1586 |
|
1587 |
/**
|
1588 |
+
* Load Import Popup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1589 |
*
|
1590 |
* @since 1.5
|
1591 |
*/
|
1592 |
+
public function load_import() {
|
1593 |
if ( ! Forminator::is_import_export_feature_enabled() ) {
|
1594 |
wp_send_json_success( '' );
|
1595 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1596 |
|
1597 |
+
$current_action = current_action();
|
1598 |
+
$slug = str_replace( array( 'wp_ajax_forminator_load_import_', '_popup' ), '', $current_action );
|
1599 |
+
if ( 'custom_form' === $slug ) {
|
1600 |
+
$slug = 'form';
|
|
|
|
|
|
|
|
|
1601 |
}
|
1602 |
// Validate nonce
|
1603 |
+
forminator_validate_ajax( 'forminator_popup_import_' . forminator_get_prefix( $slug, 'c' ) );
|
1604 |
|
1605 |
+
$html = forminator_template( 'common/popup/import', array( 'slug' => $slug ) );
|
1606 |
|
1607 |
wp_send_json_success( $html );
|
1608 |
}
|
1609 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1610 |
/**
|
1611 |
* Save pagination data
|
1612 |
*
|
1620 |
$pagination_listing = intval( sanitize_text_field( $_POST['pagination_listings'] ) );
|
1621 |
|
1622 |
if ( 1 > $pagination || 1 > $pagination_listing ) {
|
1623 |
+
wp_send_json_error( __( 'Limit per page can not be less than one.', 'forminator' ) );
|
1624 |
}
|
1625 |
|
1626 |
update_option( 'forminator_pagination_entries', $pagination );
|
1698 |
|
1699 |
|
1700 |
if ( 1 > $pagination || 1 > $pagination_listing ) {
|
1701 |
+
wp_send_json_error( __( 'Limit per page can not be less than one.', 'forminator' ) );
|
1702 |
}
|
1703 |
|
1704 |
update_option( 'forminator_pagination_entries', $pagination );
|
1732 |
$calculator->set_is_throwable( true );
|
1733 |
$calculator->parse();
|
1734 |
|
1735 |
+
wp_send_json_success( __( 'Calculation formula validated successfully.', 'forminator' ) );
|
1736 |
|
1737 |
} catch ( Forminator_Calculator_Exception $e ) {
|
1738 |
+
wp_send_json_error( __( 'Invalid calculation formula. Please check again.', 'forminator' ) );
|
1739 |
}
|
1740 |
}
|
1741 |
|
1753 |
}
|
1754 |
$data['notification'] = array(
|
1755 |
'type' => 'success',
|
1756 |
+
'text' => __( 'Stripe account disconnected successfully.', 'forminator' ),
|
1757 |
'duration' => '4000',
|
1758 |
);
|
1759 |
$file = forminator_plugin_dir() . 'admin/views/settings/payments/section-stripe.php';
|
1780 |
}
|
1781 |
$data['notification'] = array(
|
1782 |
'type' => 'success',
|
1783 |
+
'text' => __( 'PayPal account disconnected successfully.', 'forminator' ),
|
1784 |
'duration' => '4000',
|
1785 |
);
|
1786 |
$file = forminator_plugin_dir() . 'admin/views/settings/payments/section-paypal.php';
|
1906 |
|
1907 |
$data['notification'] = array(
|
1908 |
'type' => 'success',
|
1909 |
+
'text' => __( 'Stripe account connected successfully. You can now add the Stripe field to your forms and start collecting payments.', 'forminator' ),
|
1910 |
'duration' => '4000',
|
1911 |
);
|
1912 |
|
1952 |
|
1953 |
$data['buttons']['connect']['markup'] = '<div class="sui-actions-right">' .
|
1954 |
'<button class="sui-button forminator-stripe-connect" type="button" data-nonce="' . wp_create_nonce( 'forminator_stripe_settings_modal' ) . '">' .
|
1955 |
+
'<span class="sui-loading-text">' . esc_html__( 'Connect', 'forminator' ) . '</span>' .
|
1956 |
'<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>' .
|
1957 |
'</button>' .
|
1958 |
'</div>';
|
2032 |
|
2033 |
$data['notification'] = array(
|
2034 |
'type' => 'success',
|
2035 |
+
'text' => __( 'PayPal account connected successfully. You can now add the PayPal field to your forms and start collecting payments.', 'forminator' ),
|
2036 |
'duration' => '4000',
|
2037 |
);
|
2038 |
|
2078 |
|
2079 |
$data['buttons']['connect']['markup'] = '<div class="sui-actions-right">' .
|
2080 |
'<button class="sui-button forminator-paypal-connect" type="button" data-nonce="' . wp_create_nonce( 'forminator_paypal_settings_modal' ) . '">' .
|
2081 |
+
'<span class="sui-loading-text">' . esc_html__( 'Connect', 'forminator' ) . '</span>' .
|
2082 |
'<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>' .
|
2083 |
'</button>' .
|
2084 |
'</div>';
|
2230 |
$data['html'] = $html;
|
2231 |
$data['notification'] = array(
|
2232 |
'type' => 'success',
|
2233 |
+
'text' => __( 'All the submissions deleted successfully.', 'forminator' ),
|
2234 |
'duration' => '4000',
|
2235 |
);
|
2236 |
wp_send_json_success( $data );
|
2237 |
} else {
|
2238 |
$data['notification'] = array(
|
2239 |
'type' => 'error',
|
2240 |
+
'text' => __( 'Submission delete failed.', 'forminator' ),
|
2241 |
'duration' => '4000',
|
2242 |
);
|
2243 |
wp_send_json_error( $data );
|
admin/classes/class-admin-data.php
CHANGED
@@ -85,6 +85,7 @@ class Forminator_Admin_Data {
|
|
85 |
public function admin_js_defaults() {
|
86 |
// Generate addon nonce
|
87 |
Forminator_Addon_Admin_Ajax::get_instance()->generate_nonce();
|
|
|
88 |
|
89 |
return array(
|
90 |
'ajaxUrl' => forminator_ajax_url(),
|
@@ -109,12 +110,13 @@ class Forminator_Admin_Data {
|
|
109 |
'searchNonce' => wp_create_nonce( 'forminator_search_emails' ),
|
110 |
'gFontNonce' => wp_create_nonce( 'forminator_load_google_fonts' ),
|
111 |
'dismissNonce' => wp_create_nonce( 'forminator_dismiss_notification' ),
|
112 |
-
'formProcessNonce' => wp_create_nonce( '
|
113 |
-
'formExportNonce' => wp_create_nonce( '
|
114 |
-
'pollProcessNonce' => wp_create_nonce( '
|
115 |
'pollExportNonce' => wp_create_nonce( 'forminator_popup_export_poll' ),
|
116 |
-
'quizProcessNonce' => wp_create_nonce( '
|
117 |
'quizExportNonce' => wp_create_nonce( 'forminator_popup_export_quiz' ),
|
|
|
118 |
'addons_enabled' => Forminator::is_addons_feature_enabled(),
|
119 |
'pluginUrl' => forminator_plugin_url(),
|
120 |
'imagesUrl' => forminator_plugin_url() . '/assets/images',
|
85 |
public function admin_js_defaults() {
|
86 |
// Generate addon nonce
|
87 |
Forminator_Addon_Admin_Ajax::get_instance()->generate_nonce();
|
88 |
+
$id = filter_input( INPUT_GET, 'id', FILTER_VALIDATE_INT );
|
89 |
|
90 |
return array(
|
91 |
'ajaxUrl' => forminator_ajax_url(),
|
110 |
'searchNonce' => wp_create_nonce( 'forminator_search_emails' ),
|
111 |
'gFontNonce' => wp_create_nonce( 'forminator_load_google_fonts' ),
|
112 |
'dismissNonce' => wp_create_nonce( 'forminator_dismiss_notification' ),
|
113 |
+
'formProcessNonce' => wp_create_nonce( 'forminator_form_request' ),
|
114 |
+
'formExportNonce' => wp_create_nonce( 'forminator_popup_export_form' ),
|
115 |
+
'pollProcessNonce' => wp_create_nonce( 'forminator_poll_request' ),
|
116 |
'pollExportNonce' => wp_create_nonce( 'forminator_popup_export_poll' ),
|
117 |
+
'quizProcessNonce' => wp_create_nonce( 'forminator_quiz_request' ),
|
118 |
'quizExportNonce' => wp_create_nonce( 'forminator_popup_export_quiz' ),
|
119 |
+
'cloneNonce' => wp_create_nonce( 'forminator-nonce-clone-' . $id ),
|
120 |
'addons_enabled' => Forminator::is_addons_feature_enabled(),
|
121 |
'pluginUrl' => forminator_plugin_url(),
|
122 |
'imagesUrl' => forminator_plugin_url() . '/assets/images',
|
admin/classes/class-admin-l10n.php
CHANGED
@@ -39,318 +39,316 @@ class Forminator_Admin_L10n {
|
|
39 |
public function admin_l10n() {
|
40 |
$properties = array(
|
41 |
"popup" => array(
|
42 |
-
"form_name_label" => __( "Name your form",
|
43 |
-
"form_name_placeholder" => __( "E.g. Contact Form",
|
44 |
-
"name" => __( "Name",
|
45 |
-
"fields" => __( "Fields",
|
46 |
-
"date" => __( "Date",
|
47 |
-
"clear_all" => __( "Clear All",
|
48 |
-
"your_exports" => __( "Your exports",
|
49 |
-
"edit_login_form" => __( "Edit Login or Register form",
|
50 |
-
"edit_scheduled_export" => __( "Edit Scheduled Export",
|
51 |
-
"frequency" => __( "Frequency",
|
52 |
-
"daily" => __( "Daily",
|
53 |
-
"weekly" => __( "Weekly",
|
54 |
-
"monthly" => __( "Monthly",
|
55 |
-
"week_day" => __( "Day of the week",
|
56 |
-
"monday" => __( "Monday",
|
57 |
-
"tuesday" => __( "Tuesday",
|
58 |
-
"wednesday" => __( "Wednesday",
|
59 |
-
"thursday" => __( "Thursday",
|
60 |
-
"friday" => __( "Friday",
|
61 |
-
"saturday" => __( "Saturday",
|
62 |
-
"sunday" => __( "Sunday",
|
63 |
-
"day_time" => __( "Time of the day",
|
64 |
-
"email_to" => __( "Email export data to",
|
65 |
-
"email_placeholder" => __( "E.g. john@doe.com",
|
66 |
-
"schedule_help" => __( "Leave blank if you don't want to receive exports via email.",
|
67 |
-
"congratulations" => __( "Congratulations!",
|
68 |
-
"is_ready" => __( "is ready!",
|
69 |
-
"new_form_desc" => __( "Add it to any post / page by clicking Forminator button, or set it up as a Widget.",
|
70 |
-
"paypal_settings" => __( "Edit PayPal credentials",
|
71 |
-
"preview_cforms" => __( "Preview Custom Form",
|
72 |
-
"preview_polls" => __( "Preview Poll",
|
73 |
-
"preview_quizzes" => __( "Preview Quiz",
|
74 |
-
"captcha_settings" => __( "Edit reCAPTCHA credentials",
|
75 |
-
"currency_settings" => __( "Edit default currency",
|
76 |
-
"pagination_entries" => __( "Submissions | Pagination Settings",
|
77 |
-
"pagination_listings" => __( "Listings | Pagination Settings",
|
78 |
-
"email_settings" => __( "Email Settings",
|
79 |
-
"uninstall_settings" => __( "Uninstall Settings",
|
80 |
-
"privacy_settings" => __( "Privacy Settings",
|
81 |
-
"validate_form_name" => __( "Form name cannot be empty! Please pick a name for your form.",
|
82 |
-
"close" => __( "Close",
|
83 |
-
"close_label" => __( "Close this dialog window",
|
84 |
-
'records' => __( "Records",
|
85 |
-
"delete" => __( "Delete",
|
86 |
-
"confirm" => __( "Confirm",
|
87 |
-
"are_you_sure" => __( "Are you sure?",
|
88 |
-
"cannot_be_reverted" => __( "Have in mind this action cannot be reverted.",
|
89 |
-
"are_you_sure_form" => __( "Are you sure you wish to permanently delete this form?",
|
90 |
-
"are_you_sure_poll" => __( "Are you sure you wish to permanently delete this poll?",
|
91 |
-
"are_you_sure_quiz" => __( "Are you sure you wish to permanently delete this quiz?",
|
92 |
-
"delete_form" => __( "Delete Form",
|
93 |
-
"delete_poll" => __( "Delete Poll",
|
94 |
-
"delete_quiz" => __( "Delete Quiz",
|
95 |
-
"confirm_action" => __( "Please confirm that you want to do this action.",
|
96 |
-
"confirm_title" => __( "Confirm Action",
|
97 |
-
"confirm_field_delete" => __( "Please confirm that you want to delete this field",
|
98 |
-
"cancel" => __( "Cancel",
|
99 |
-
"save_alert" => __( "The changes you made may be lost if you navigate away from this page.",
|
100 |
-
"save_changes" => __( "Save Changes",
|
101 |
-
"save" => __( "Save",
|
102 |
-
"export_cform" => __( "Export Form",
|
103 |
-
"export_poll" => __( "Export Poll",
|
104 |
-
"export_quiz" => __( "Export Quiz",
|
105 |
-
"import_cform" => __( "Import Form",
|
106 |
-
"import_cform_cf7" => __( "Import",
|
107 |
-
"import_cform_ninja" => __( "Import Ninja Forms",
|
108 |
-
"import_cform_gravity" => __( "Import Gravity Forms",
|
109 |
-
"import_poll" => __( "Import Poll",
|
110 |
-
"import_quiz" => __( "Import Quiz",
|
111 |
-
'enable_scheduled_export' => __( 'Enable scheduled exports',
|
112 |
-
'scheduled_export_if_new' => __( 'Send email only if there are new submissions',
|
113 |
-
"download_csv" => __( 'Download CSV',
|
114 |
-
"scheduled_exports" => __( 'Scheduled Exports',
|
115 |
-
"manual_exports" => __( 'Manual Exports',
|
116 |
-
"manual_description" => __( 'Download the submissions list in .csv format.',
|
117 |
-
"scheduled_description" => __( 'Enable scheduled exports to get the submissions list in your email.',
|
118 |
-
"disable" => __( 'Disable',
|
119 |
-
"enable" => __( 'Enable',
|
120 |
-
"enter_name" => __( 'Enter a name',
|
121 |
-
"new_form_desc2" => __( 'Name your new form, then let\'s start building!',
|
122 |
-
"new_poll_desc2" => __( 'Name your new poll, then let\'s start building!',
|
123 |
"new_quiz_desc2" => __( 'Choose whether you want to collect participants details (e.g. name, email, etc.) on your quiz.'),
|
124 |
-
"learn_more" => __( 'Learn more',
|
125 |
-
"input_label" => __( 'Input Label',
|
126 |
-
"form_name_validation" => __( 'Form name cannot be empty.',
|
127 |
-
"poll_name_validation" => __( 'Poll name cannot be empty.',
|
128 |
-
"quiz_name_validation" => __( 'Quiz name cannot be empty.',
|
129 |
-
"new_form_placeholder" => __( 'E.g. Blank Form',
|
130 |
-
"new_poll_placeholder" => __( 'E.g. Blank Poll',
|
131 |
-
"new_quiz_placeholder" => __( 'E.g. My Awesome Quiz',
|
132 |
-
"create" => __( 'Create',
|
133 |
-
'reset' => __( 'RESET',
|
134 |
-
"disconnect" => __( 'Disconnect',
|
135 |
-
"apply_submission_filter" => __( 'Apply Submission Filters',
|
136 |
-
'registration_notice' => __( "This template allows you to create your own registration form and insert it on a custom page. This doesn't modify the default registration form.",
|
137 |
-
'login_notice' => __( "This template allows you to create your own login form and insert it on a custom page. This doesn't modify the default login form.",
|
138 |
-
'approve_user' => __( 'Approve',
|
139 |
-
'registration_name' => __( 'User Registration',
|
140 |
-
'login_name' => __( 'User Login',
|
141 |
),
|
142 |
'quiz' => array(
|
143 |
-
'choose_quiz_title' => __( 'Create Quiz',
|
144 |
-
'choose_quiz_description' => __( "Let's start by giving your quiz a name and choosing the appropriate quiz type based on your goal.",
|
145 |
-
'quiz_name' => __( "Quiz Name",
|
146 |
-
'quiz_type' => __( "Quiz Type",
|
147 |
-
'collect_leads' => __( "Collect Leads",
|
148 |
-
'knowledge_label' => __( 'Knowledge Quiz',
|
149 |
-
'knowledge_description' => __( 'Test the knowledge of your visitors on a subject and final score is calculated based on number of right answers. E.g. Test your music knowledge.',
|
150 |
-
'nowrong_label' => __( 'Personality Quiz',
|
151 |
-
'nowrong_description' => __( "Show different outcomes depending on the visitor's answers. There are no wrong answers. E.g. Which superhero are you?",
|
152 |
-
'continue_button' => __( 'Continue',
|
153 |
-
'quiz_leads_toggle' => __( 'Collect leads on your quiz',
|
154 |
-
'create_quiz' => __( 'Create Quiz',
|
155 |
'quiz_leads_desc' => __( 'We will automatically create a default lead generation form for you. The lead generation form uses the Forms module, and some of the settings are shared between this quiz and the leads form.')
|
156 |
),
|
157 |
'form' => array(
|
158 |
-
'form_template_title' => __( 'Choose a template',
|
159 |
'form_template_description' => __( 'Customize one of our pre-made form templates, or start from scratch.' ),
|
160 |
-
'continue_button' => __( 'Continue',
|
161 |
),
|
162 |
'sidebar' => array(
|
163 |
-
'label' => __( 'Label',
|
164 |
-
'value' => __( 'Value',
|
165 |
-
'add_option' => __( 'Add Option',
|
166 |
-
'delete' => __( 'Delete',
|
167 |
-
'pick_field' => __( 'Pick a field',
|
168 |
-
'field_will_be' => __( 'This field will be',
|
169 |
-
'if' => __( 'if',
|
170 |
-
'shown' => __( 'Shown',
|
171 |
-
'hidden' => __( 'Hidden',
|
172 |
),
|
173 |
'colors' => array(
|
174 |
-
'poll_shadow' => __( 'Poll shadow',
|
175 |
-
'title' => __( 'Title text',
|
176 |
-
'question' => __( 'Question text',
|
177 |
-
'answer' => __( 'Answer text',
|
178 |
-
'input_background' => __( 'Input field bg',
|
179 |
-
'input_border' => __( 'Input field border',
|
180 |
-
'input_placeholder' => __( 'Input field placeholder',
|
181 |
-
'input_text' => __( 'Input field text',
|
182 |
-
'btn_background' => __( 'Button background',
|
183 |
-
'btn_text' => __( 'Button text',
|
184 |
-
'link_res' => __( 'Results link',
|
185 |
),
|
186 |
'options' => array(
|
187 |
-
'browse' => __( 'Browse',
|
188 |
-
'clear' => __( 'Clear',
|
189 |
-
'no_results' => __( "You don't have any results yet.",
|
190 |
-
'select_result' => __( 'Select result',
|
191 |
-
'no_answers' => __( "You don't have any answer yet.",
|
192 |
-
'placeholder_image' => __( 'Click browse to add image...',
|
193 |
-
'placeholder_image_alt' => __( 'Click on browse to add an image',
|
194 |
-
'placeholder_answer' => __( 'Add an answer here',
|
195 |
-
'multiqs_empty' => __( "You don't have any questions yet.",
|
196 |
-
'add_question' => __( 'Add Question',
|
197 |
-
'add_new_question' => __( 'Add New Question',
|
198 |
-
'question_title' => __( 'Question title',
|
199 |
-
'question_title_error' => __( 'Question title cannot be empty! Please, add some content to your question.',
|
200 |
-
'answers' => __( 'Answers',
|
201 |
-
'add_answer' => __( 'Add Answer',
|
202 |
-
'add_new_answer' => __( 'Add New Answer',
|
203 |
-
'add_result' => __( 'Add Result',
|
204 |
-
'delete_result' => __( 'Delete Result',
|
205 |
-
'title' => __( 'Title',
|
206 |
-
'image' => __( 'Image (optional)',
|
207 |
-
'description' => __( 'Description',
|
208 |
-
'trash_answer' => __( 'Delete this answer',
|
209 |
-
'correct' => __( 'Correct answer',
|
210 |
-
'no_options' => __( "You don't have any options yet.",
|
211 |
-
'delete' => __( 'Delete',
|
212 |
-
'restricted_dates' => __( 'Restricted dates:',
|
213 |
-
'add' => __( 'Add',
|
214 |
-
'custom_date' => __( 'Pick custom date(s) to restrict:',
|
215 |
-
'form_data' => __( 'Form Data',
|
216 |
-
'required_form_fields' => __( 'Required Fields',
|
217 |
-
'optional_form_fields' => __( 'Optional Fields',
|
218 |
-
'all_fields' => __( 'All Submitted Fields',
|
219 |
-
'form_name' => __( 'Form Name',
|
220 |
-
'misc_data' => __( 'Misc Data',
|
221 |
-
'form_based_data' => __( 'Add form data',
|
222 |
-
'been_saved' => __( 'has been saved.',
|
223 |
-
'been_published' => __( 'has been published.',
|
224 |
'error_saving' => __( 'Error! Form cannot be saved.' ),
|
225 |
-
'default_value' => __( 'Default Value',
|
226 |
'admin_email' => get_option( 'admin_email' ),
|
227 |
-
'delete_question' => __( 'Delete this question',
|
228 |
-
'remove_image' => __( 'Remove image',
|
229 |
-
'answer_settings' => __( 'Show extra settings',
|
230 |
-
'add_new_result' => __( 'Add New Result',
|
231 |
-
'multiorder_validation' => __( 'You need to add at least one result for this quiz so you can re-order the results priority.',
|
232 |
-
'user_ip_address' => __( 'User IP Address',
|
233 |
-
'date' => __( 'Date',
|
234 |
-
'embed_id' => __( 'Embed Post/Page ID',
|
235 |
-
'embed_title' => __( 'Embed Post/Page Title',
|
236 |
-
'embed_url' => __( 'Embed URL',
|
237 |
-
'user_agent' => __( 'HTTP User Agent',
|
238 |
-
'refer_url' => __( 'HTTP Refer URL',
|
239 |
-
'display_name' => __( 'User Display Name',
|
240 |
-
'user_email' => __( 'User Email',
|
241 |
-
'user_login' => __( 'User Login',
|
242 |
-
'shortcode_copied' => __( 'Shortcode has been copied successfully.',
|
243 |
-
'uri_copied' => __( 'URI has been copied successfully.',
|
244 |
),
|
245 |
"commons" => array(
|
246 |
-
"color" => __( "Color",
|
247 |
-
"colors" => __( "Colors",
|
248 |
-
"border_color" => __( "Border color",
|
249 |
-
"border_color_hover" => __( "Border color (hover)",
|
250 |
-
"border_color_active" => __( "Border color (active)",
|
251 |
-
"border_color_correct" => __( "Border color (correct)",
|
252 |
-
"border_color_incorrect" => __( "Border color (incorrect)",
|
253 |
-
"border_width" => __( "Border width",
|
254 |
-
"border_style" => __( "Border style",
|
255 |
-
"background" => __( "Background",
|
256 |
-
"background_hover" => __( "Background (hover)",
|
257 |
-
"background_active" => __( "Background (active)",
|
258 |
-
"background_correct" => __( "Background (correct)",
|
259 |
-
"background_incorrect" => __( "Background (incorrect)",
|
260 |
-
"font_color" => __( "Font color",
|
261 |
-
"font_color_hover" => __( "Font color (hover)",
|
262 |
-
"font_color_active" => __( "Font color (active)",
|
263 |
-
"font_color_correct" => __( "Font color (correct)",
|
264 |
-
"font_color_incorrect" => __( "Font color (incorrect)",
|
265 |
-
"font_background" => __( "Font background",
|
266 |
-
"font_background" => __( "Font background (hover)",
|
267 |
-
"font_background_active" => __( "Font background (active)",
|
268 |
-
"font_family" => __( "Font family",
|
269 |
-
"font_family_custom" => __( "Custom font family",
|
270 |
-
"font_family_placeholder" => __( "E.g. 'Arial', sans-serif",
|
271 |
-
"font_family_custom_description" => __( "Here you can type the font family you want to use, as you would in CSS.",
|
272 |
-
"icon_size" => __( "Icon size",
|
273 |
-
"enable" => __( "Enable",
|
274 |
-
"dropdown" => __( "Dropdown",
|
275 |
-
"appearance" => __( "Appearance",
|
276 |
-
"expand" => __( "Expand",
|
277 |
-
"placeholder" => __( "Placeholder",
|
278 |
-
"preview" => __( "Preview",
|
279 |
-
"icon_color" => __( "Icon color",
|
280 |
-
"icon_color_hover" => __( "Icon color (hover)",
|
281 |
-
"icon_color_active" => __( "Icon color (active)",
|
282 |
-
"icon_color_correct" => __( "Icon color (correct)",
|
283 |
-
"icon_color_incorrect" => __( "Icon color (incorrect)",
|
284 |
-
"box_shadow" => __( "Box shadow",
|
285 |
-
"enable_settings" => __( "Enable settings",
|
286 |
-
"font_size" => __( "Font size",
|
287 |
-
"font_weight" => __( "Font weight",
|
288 |
-
"text_align" => __( "Text align",
|
289 |
-
"regular" => __( "Regular",
|
290 |
-
"medium" => __( "Medium",
|
291 |
-
"large" => __( "Large",
|
292 |
-
"light" => __( "Light",
|
293 |
-
"normal" => __( "Normal",
|
294 |
-
"bold" => __( "Bold",
|
295 |
-
"typography" => __( "Typography",
|
296 |
-
"padding_top" => __( "Top padding",
|
297 |
-
"padding_right" => __( "Right padding",
|
298 |
-
"padding_bottom" => __( "Bottom padding",
|
299 |
-
"padding_left" => __( "Left padding",
|
300 |
-
"border_radius" => __( "Border radius",
|
301 |
-
"date_placeholder" => __( "20 April 2018",
|
302 |
-
"left" => __( "Left",
|
303 |
-
"center" => __( "Center",
|
304 |
-
"right" => __( "Right",
|
305 |
-
"none" => __( "None",
|
306 |
-
"solid" => __( "Solid",
|
307 |
-
"dashed" => __( "Dashed",
|
308 |
-
"dotted" => __( "Dotted",
|
309 |
-
"delete_option" => __( "Delete option",
|
310 |
-
"label" => __( "Label",
|
311 |
-
"value" => __( "Value",
|
312 |
-
"reorder_option" => __( "Re-order this option",
|
313 |
-
"forminator_ui" => __( "Forminator UI",
|
314 |
-
"
|
315 |
-
"
|
316 |
-
"
|
317 |
-
"
|
318 |
-
"
|
319 |
-
"
|
320 |
-
"
|
321 |
-
"
|
322 |
-
"approve_user_successfull" => __( "User approved succesfully.", Forminator::DOMAIN ),
|
323 |
-
"approve_user_unsuccessfull" => __( "Error! User was not approved.", Forminator::DOMAIN )
|
324 |
),
|
325 |
'social' => array(
|
326 |
-
'facebook' => __( 'Facebook',
|
327 |
-
'twitter' => __( 'Twitter',
|
328 |
-
'google_plus' => __( 'Google+',
|
329 |
-
'linkedin' => __( 'LinkedIn',
|
330 |
),
|
331 |
'calendar' => array(
|
332 |
'day_names_min' => array(
|
333 |
-
esc_html__( 'Su',
|
334 |
-
esc_html__( 'Mo',
|
335 |
-
esc_html__( 'Tu',
|
336 |
-
esc_html__( 'We',
|
337 |
-
esc_html__( 'Th',
|
338 |
-
esc_html__( 'Fr',
|
339 |
-
esc_html__( 'Sa',
|
340 |
),
|
341 |
'month_names' => array(
|
342 |
-
esc_html__( 'January',
|
343 |
-
esc_html__( 'February',
|
344 |
-
esc_html__( 'March',
|
345 |
-
esc_html__( 'April',
|
346 |
-
esc_html__( 'May',
|
347 |
-
esc_html__( 'June',
|
348 |
-
esc_html__( 'July',
|
349 |
-
esc_html__( 'August',
|
350 |
-
esc_html__( 'September',
|
351 |
-
esc_html__( 'October',
|
352 |
-
esc_html__( 'November',
|
353 |
-
esc_html__( 'December',
|
354 |
),
|
355 |
'day_names_min' => self::get_short_days_names(),
|
356 |
'month_names' => self::get_months_names(),
|
@@ -366,8 +364,8 @@ class Forminator_Admin_L10n {
|
|
366 |
'hour' => forminator_get_exporter_info( 'hour', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
367 |
'email' => forminator_get_exporter_info( 'email', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
368 |
'if_new' => forminator_get_exporter_info( 'if_new', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
369 |
-
'noResults' => esc_html__( 'No Result Found',
|
370 |
-
'searching' => esc_html__( 'Searching',
|
371 |
),
|
372 |
'exporter_logs' => forminator_get_export_logs( forminator_get_form_id_helper() ),
|
373 |
);
|
@@ -404,16 +402,16 @@ class Forminator_Admin_L10n {
|
|
404 |
*/
|
405 |
private static function get_notices_list() {
|
406 |
$list = array(
|
407 |
-
'settings_reset' => __( 'Data and settings have been reset successfully!',
|
408 |
-
'form_deleted' => __( 'Form successfully deleted.',
|
409 |
-
'poll_deleted' => __( 'Poll successfully deleted.',
|
410 |
-
'quiz_deleted' => __( 'Quiz successfully deleted.',
|
411 |
-
'form_duplicated' => __( 'Form successfully duplicated.',
|
412 |
-
'poll_duplicated' => __( 'Poll successfully duplicated.',
|
413 |
-
'quiz_duplicated' => __( 'Quiz successfully duplicated.',
|
414 |
-
'form_reset' => __( 'Form tracking data successfully reset.',
|
415 |
-
'poll_reset' => __( 'Poll tracking data successfully reset.',
|
416 |
-
'quiz_reset' => __( 'Quiz tracking data successfully reset.',
|
417 |
);
|
418 |
|
419 |
return $list;
|
@@ -427,13 +425,13 @@ class Forminator_Admin_L10n {
|
|
427 |
*/
|
428 |
public static function get_short_days_names() {
|
429 |
return array(
|
430 |
-
esc_html__( 'Su',
|
431 |
-
esc_html__( 'Mo',
|
432 |
-
esc_html__( 'Tu',
|
433 |
-
esc_html__( 'We',
|
434 |
-
esc_html__( 'Th',
|
435 |
-
esc_html__( 'Fr',
|
436 |
-
esc_html__( 'Sa',
|
437 |
);
|
438 |
}
|
439 |
|
@@ -445,18 +443,18 @@ class Forminator_Admin_L10n {
|
|
445 |
*/
|
446 |
public static function get_months_names() {
|
447 |
return array(
|
448 |
-
esc_html__( 'January',
|
449 |
-
esc_html__( 'February',
|
450 |
-
esc_html__( 'March',
|
451 |
-
esc_html__( 'April',
|
452 |
-
esc_html__( 'May',
|
453 |
-
esc_html__( 'June',
|
454 |
-
esc_html__( 'July',
|
455 |
-
esc_html__( 'August',
|
456 |
-
esc_html__( 'September',
|
457 |
-
esc_html__( 'October',
|
458 |
-
esc_html__( 'November',
|
459 |
-
esc_html__( 'December',
|
460 |
);
|
461 |
|
462 |
}
|
39 |
public function admin_l10n() {
|
40 |
$properties = array(
|
41 |
"popup" => array(
|
42 |
+
"form_name_label" => __( "Name your form", 'forminator' ),
|
43 |
+
"form_name_placeholder" => __( "E.g. Contact Form", 'forminator' ),
|
44 |
+
"name" => __( "Name", 'forminator' ),
|
45 |
+
"fields" => __( "Fields", 'forminator' ),
|
46 |
+
"date" => __( "Date", 'forminator' ),
|
47 |
+
"clear_all" => __( "Clear All", 'forminator' ),
|
48 |
+
"your_exports" => __( "Your exports", 'forminator' ),
|
49 |
+
"edit_login_form" => __( "Edit Login or Register form", 'forminator' ),
|
50 |
+
"edit_scheduled_export" => __( "Edit Scheduled Export", 'forminator' ),
|
51 |
+
"frequency" => __( "Frequency", 'forminator' ),
|
52 |
+
"daily" => __( "Daily", 'forminator' ),
|
53 |
+
"weekly" => __( "Weekly", 'forminator' ),
|
54 |
+
"monthly" => __( "Monthly", 'forminator' ),
|
55 |
+
"week_day" => __( "Day of the week", 'forminator' ),
|
56 |
+
"monday" => __( "Monday", 'forminator' ),
|
57 |
+
"tuesday" => __( "Tuesday", 'forminator' ),
|
58 |
+
"wednesday" => __( "Wednesday", 'forminator' ),
|
59 |
+
"thursday" => __( "Thursday", 'forminator' ),
|
60 |
+
"friday" => __( "Friday", 'forminator' ),
|
61 |
+
"saturday" => __( "Saturday", 'forminator' ),
|
62 |
+
"sunday" => __( "Sunday", 'forminator' ),
|
63 |
+
"day_time" => __( "Time of the day", 'forminator' ),
|
64 |
+
"email_to" => __( "Email export data to", 'forminator' ),
|
65 |
+
"email_placeholder" => __( "E.g. john@doe.com", 'forminator' ),
|
66 |
+
"schedule_help" => __( "Leave blank if you don't want to receive exports via email.", 'forminator' ),
|
67 |
+
"congratulations" => __( "Congratulations!", 'forminator' ),
|
68 |
+
"is_ready" => __( "is ready!", 'forminator' ),
|
69 |
+
"new_form_desc" => __( "Add it to any post / page by clicking Forminator button, or set it up as a Widget.", 'forminator' ),
|
70 |
+
"paypal_settings" => __( "Edit PayPal credentials", 'forminator' ),
|
71 |
+
"preview_cforms" => __( "Preview Custom Form", 'forminator' ),
|
72 |
+
"preview_polls" => __( "Preview Poll", 'forminator' ),
|
73 |
+
"preview_quizzes" => __( "Preview Quiz", 'forminator' ),
|
74 |
+
"captcha_settings" => __( "Edit reCAPTCHA credentials", 'forminator' ),
|
75 |
+
"currency_settings" => __( "Edit default currency", 'forminator' ),
|
76 |
+
"pagination_entries" => __( "Submissions | Pagination Settings", 'forminator' ),
|
77 |
+
"pagination_listings" => __( "Listings | Pagination Settings", 'forminator' ),
|
78 |
+
"email_settings" => __( "Email Settings", 'forminator' ),
|
79 |
+
"uninstall_settings" => __( "Uninstall Settings", 'forminator' ),
|
80 |
+
"privacy_settings" => __( "Privacy Settings", 'forminator' ),
|
81 |
+
"validate_form_name" => __( "Form name cannot be empty! Please pick a name for your form.", 'forminator' ),
|
82 |
+
"close" => __( "Close", 'forminator' ),
|
83 |
+
"close_label" => __( "Close this dialog window", 'forminator' ),
|
84 |
+
'records' => __( "Records", 'forminator' ),
|
85 |
+
"delete" => __( "Delete", 'forminator' ),
|
86 |
+
"confirm" => __( "Confirm", 'forminator' ),
|
87 |
+
"are_you_sure" => __( "Are you sure?", 'forminator' ),
|
88 |
+
"cannot_be_reverted" => __( "Have in mind this action cannot be reverted.", 'forminator' ),
|
89 |
+
"are_you_sure_form" => __( "Are you sure you wish to permanently delete this form?", 'forminator' ),
|
90 |
+
"are_you_sure_poll" => __( "Are you sure you wish to permanently delete this poll?", 'forminator' ),
|
91 |
+
"are_you_sure_quiz" => __( "Are you sure you wish to permanently delete this quiz?", 'forminator' ),
|
92 |
+
"delete_form" => __( "Delete Form", 'forminator' ),
|
93 |
+
"delete_poll" => __( "Delete Poll", 'forminator' ),
|
94 |
+
"delete_quiz" => __( "Delete Quiz", 'forminator' ),
|
95 |
+
"confirm_action" => __( "Please confirm that you want to do this action.", 'forminator' ),
|
96 |
+
"confirm_title" => __( "Confirm Action", 'forminator' ),
|
97 |
+
"confirm_field_delete" => __( "Please confirm that you want to delete this field", 'forminator' ),
|
98 |
+
"cancel" => __( "Cancel", 'forminator' ),
|
99 |
+
"save_alert" => __( "The changes you made may be lost if you navigate away from this page.", 'forminator' ),
|
100 |
+
"save_changes" => __( "Save Changes", 'forminator' ),
|
101 |
+
"save" => __( "Save", 'forminator' ),
|
102 |
+
"export_cform" => __( "Export Form", 'forminator' ),
|
103 |
+
"export_poll" => __( "Export Poll", 'forminator' ),
|
104 |
+
"export_quiz" => __( "Export Quiz", 'forminator' ),
|
105 |
+
"import_cform" => __( "Import Form", 'forminator' ),
|
106 |
+
"import_cform_cf7" => __( "Import", 'forminator' ),
|
107 |
+
"import_cform_ninja" => __( "Import Ninja Forms", 'forminator' ),
|
108 |
+
"import_cform_gravity" => __( "Import Gravity Forms", 'forminator' ),
|
109 |
+
"import_poll" => __( "Import Poll", 'forminator' ),
|
110 |
+
"import_quiz" => __( "Import Quiz", 'forminator' ),
|
111 |
+
'enable_scheduled_export' => __( 'Enable scheduled exports', 'forminator' ),
|
112 |
+
'scheduled_export_if_new' => __( 'Send email only if there are new submissions', 'forminator' ),
|
113 |
+
"download_csv" => __( 'Download CSV', 'forminator' ),
|
114 |
+
"scheduled_exports" => __( 'Scheduled Exports', 'forminator' ),
|
115 |
+
"manual_exports" => __( 'Manual Exports', 'forminator' ),
|
116 |
+
"manual_description" => __( 'Download the submissions list in .csv format.', 'forminator' ),
|
117 |
+
"scheduled_description" => __( 'Enable scheduled exports to get the submissions list in your email.', 'forminator' ),
|
118 |
+
"disable" => __( 'Disable', 'forminator' ),
|
119 |
+
"enable" => __( 'Enable', 'forminator' ),
|
120 |
+
"enter_name" => __( 'Enter a name', 'forminator' ),
|
121 |
+
"new_form_desc2" => __( 'Name your new form, then let\'s start building!', 'forminator' ),
|
122 |
+
"new_poll_desc2" => __( 'Name your new poll, then let\'s start building!', 'forminator' ),
|
123 |
"new_quiz_desc2" => __( 'Choose whether you want to collect participants details (e.g. name, email, etc.) on your quiz.'),
|
124 |
+
"learn_more" => __( 'Learn more', 'forminator' ),
|
125 |
+
"input_label" => __( 'Input Label', 'forminator' ),
|
126 |
+
"form_name_validation" => __( 'Form name cannot be empty.', 'forminator' ),
|
127 |
+
"poll_name_validation" => __( 'Poll name cannot be empty.', 'forminator' ),
|
128 |
+
"quiz_name_validation" => __( 'Quiz name cannot be empty.', 'forminator' ),
|
129 |
+
"new_form_placeholder" => __( 'E.g. Blank Form', 'forminator' ),
|
130 |
+
"new_poll_placeholder" => __( 'E.g. Blank Poll', 'forminator' ),
|
131 |
+
"new_quiz_placeholder" => __( 'E.g. My Awesome Quiz', 'forminator' ),
|
132 |
+
"create" => __( 'Create', 'forminator' ),
|
133 |
+
'reset' => __( 'RESET', 'forminator' ),
|
134 |
+
"disconnect" => __( 'Disconnect', 'forminator' ),
|
135 |
+
"apply_submission_filter" => __( 'Apply Submission Filters', 'forminator' ),
|
136 |
+
'registration_notice' => __( "This template allows you to create your own registration form and insert it on a custom page. This doesn't modify the default registration form.", 'forminator' ),
|
137 |
+
'login_notice' => __( "This template allows you to create your own login form and insert it on a custom page. This doesn't modify the default login form.", 'forminator' ),
|
138 |
+
'approve_user' => __( 'Approve', 'forminator' ),
|
139 |
+
'registration_name' => __( 'User Registration', 'forminator' ),
|
140 |
+
'login_name' => __( 'User Login', 'forminator' ),
|
141 |
),
|
142 |
'quiz' => array(
|
143 |
+
'choose_quiz_title' => __( 'Create Quiz', 'forminator' ),
|
144 |
+
'choose_quiz_description' => __( "Let's start by giving your quiz a name and choosing the appropriate quiz type based on your goal.", 'forminator' ),
|
145 |
+
'quiz_name' => __( "Quiz Name", 'forminator' ),
|
146 |
+
'quiz_type' => __( "Quiz Type", 'forminator' ),
|
147 |
+
'collect_leads' => __( "Collect Leads", 'forminator' ),
|
148 |
+
'knowledge_label' => __( 'Knowledge Quiz', 'forminator' ),
|
149 |
+
'knowledge_description' => __( 'Test the knowledge of your visitors on a subject and final score is calculated based on number of right answers. E.g. Test your music knowledge.', 'forminator' ),
|
150 |
+
'nowrong_label' => __( 'Personality Quiz', 'forminator' ),
|
151 |
+
'nowrong_description' => __( "Show different outcomes depending on the visitor's answers. There are no wrong answers. E.g. Which superhero are you?", 'forminator' ),
|
152 |
+
'continue_button' => __( 'Continue', 'forminator' ),
|
153 |
+
'quiz_leads_toggle' => __( 'Collect leads on your quiz', 'forminator' ),
|
154 |
+
'create_quiz' => __( 'Create Quiz', 'forminator' ),
|
155 |
'quiz_leads_desc' => __( 'We will automatically create a default lead generation form for you. The lead generation form uses the Forms module, and some of the settings are shared between this quiz and the leads form.')
|
156 |
),
|
157 |
'form' => array(
|
158 |
+
'form_template_title' => __( 'Choose a template', 'forminator' ),
|
159 |
'form_template_description' => __( 'Customize one of our pre-made form templates, or start from scratch.' ),
|
160 |
+
'continue_button' => __( 'Continue', 'forminator' ),
|
161 |
),
|
162 |
'sidebar' => array(
|
163 |
+
'label' => __( 'Label', 'forminator' ),
|
164 |
+
'value' => __( 'Value', 'forminator' ),
|
165 |
+
'add_option' => __( 'Add Option', 'forminator' ),
|
166 |
+
'delete' => __( 'Delete', 'forminator' ),
|
167 |
+
'pick_field' => __( 'Pick a field', 'forminator' ),
|
168 |
+
'field_will_be' => __( 'This field will be', 'forminator' ),
|
169 |
+
'if' => __( 'if', 'forminator' ),
|
170 |
+
'shown' => __( 'Shown', 'forminator' ),
|
171 |
+
'hidden' => __( 'Hidden', 'forminator' ),
|
172 |
),
|
173 |
'colors' => array(
|
174 |
+
'poll_shadow' => __( 'Poll shadow', 'forminator' ),
|
175 |
+
'title' => __( 'Title text', 'forminator' ),
|
176 |
+
'question' => __( 'Question text', 'forminator' ),
|
177 |
+
'answer' => __( 'Answer text', 'forminator' ),
|
178 |
+
'input_background' => __( 'Input field bg', 'forminator' ),
|
179 |
+
'input_border' => __( 'Input field border', 'forminator' ),
|
180 |
+
'input_placeholder' => __( 'Input field placeholder', 'forminator' ),
|
181 |
+
'input_text' => __( 'Input field text', 'forminator' ),
|
182 |
+
'btn_background' => __( 'Button background', 'forminator' ),
|
183 |
+
'btn_text' => __( 'Button text', 'forminator' ),
|
184 |
+
'link_res' => __( 'Results link', 'forminator' ),
|
185 |
),
|
186 |
'options' => array(
|
187 |
+
'browse' => __( 'Browse', 'forminator' ),
|
188 |
+
'clear' => __( 'Clear', 'forminator' ),
|
189 |
+
'no_results' => __( "You don't have any results yet.", 'forminator' ),
|
190 |
+
'select_result' => __( 'Select result', 'forminator' ),
|
191 |
+
'no_answers' => __( "You don't have any answer yet.", 'forminator' ),
|
192 |
+
'placeholder_image' => __( 'Click browse to add image...', 'forminator' ),
|
193 |
+
'placeholder_image_alt' => __( 'Click on browse to add an image', 'forminator' ),
|
194 |
+
'placeholder_answer' => __( 'Add an answer here', 'forminator' ),
|
195 |
+
'multiqs_empty' => __( "You don't have any questions yet.", 'forminator' ),
|
196 |
+
'add_question' => __( 'Add Question', 'forminator' ),
|
197 |
+
'add_new_question' => __( 'Add New Question', 'forminator' ),
|
198 |
+
'question_title' => __( 'Question title', 'forminator' ),
|
199 |
+
'question_title_error' => __( 'Question title cannot be empty! Please, add some content to your question.', 'forminator' ),
|
200 |
+
'answers' => __( 'Answers', 'forminator' ),
|
201 |
+
'add_answer' => __( 'Add Answer', 'forminator' ),
|
202 |
+
'add_new_answer' => __( 'Add New Answer', 'forminator' ),
|
203 |
+
'add_result' => __( 'Add Result', 'forminator' ),
|
204 |
+
'delete_result' => __( 'Delete Result', 'forminator' ),
|
205 |
+
'title' => __( 'Title', 'forminator' ),
|
206 |
+
'image' => __( 'Image (optional)', 'forminator' ),
|
207 |
+
'description' => __( 'Description', 'forminator' ),
|
208 |
+
'trash_answer' => __( 'Delete this answer', 'forminator' ),
|
209 |
+
'correct' => __( 'Correct answer', 'forminator' ),
|
210 |
+
'no_options' => __( "You don't have any options yet.", 'forminator' ),
|
211 |
+
'delete' => __( 'Delete', 'forminator' ),
|
212 |
+
'restricted_dates' => __( 'Restricted dates:', 'forminator' ),
|
213 |
+
'add' => __( 'Add', 'forminator' ),
|
214 |
+
'custom_date' => __( 'Pick custom date(s) to restrict:', 'forminator' ),
|
215 |
+
'form_data' => __( 'Form Data', 'forminator' ),
|
216 |
+
'required_form_fields' => __( 'Required Fields', 'forminator' ),
|
217 |
+
'optional_form_fields' => __( 'Optional Fields', 'forminator' ),
|
218 |
+
'all_fields' => __( 'All Submitted Fields', 'forminator' ),
|
219 |
+
'form_name' => __( 'Form Name', 'forminator' ),
|
220 |
+
'misc_data' => __( 'Misc Data', 'forminator' ),
|
221 |
+
'form_based_data' => __( 'Add form data', 'forminator' ),
|
222 |
+
'been_saved' => __( 'has been saved.', 'forminator' ),
|
223 |
+
'been_published' => __( 'has been published.', 'forminator' ),
|
224 |
'error_saving' => __( 'Error! Form cannot be saved.' ),
|
225 |
+
'default_value' => __( 'Default Value', 'forminator' ),
|
226 |
'admin_email' => get_option( 'admin_email' ),
|
227 |
+
'delete_question' => __( 'Delete this question', 'forminator' ),
|
228 |
+
'remove_image' => __( 'Remove image', 'forminator' ),
|
229 |
+
'answer_settings' => __( 'Show extra settings', 'forminator' ),
|
230 |
+
'add_new_result' => __( 'Add New Result', 'forminator' ),
|
231 |
+
'multiorder_validation' => __( 'You need to add at least one result for this quiz so you can re-order the results priority.', 'forminator' ),
|
232 |
+
'user_ip_address' => __( 'User IP Address', 'forminator' ),
|
233 |
+
'date' => __( 'Date', 'forminator' ),
|
234 |
+
'embed_id' => __( 'Embed Post/Page ID', 'forminator' ),
|
235 |
+
'embed_title' => __( 'Embed Post/Page Title', 'forminator' ),
|
236 |
+
'embed_url' => __( 'Embed URL', 'forminator' ),
|
237 |
+
'user_agent' => __( 'HTTP User Agent', 'forminator' ),
|
238 |
+
'refer_url' => __( 'HTTP Refer URL', 'forminator' ),
|
239 |
+
'display_name' => __( 'User Display Name', 'forminator' ),
|
240 |
+
'user_email' => __( 'User Email', 'forminator' ),
|
241 |
+
'user_login' => __( 'User Login', 'forminator' ),
|
242 |
+
'shortcode_copied' => __( 'Shortcode has been copied successfully.', 'forminator' ),
|
243 |
+
'uri_copied' => __( 'URI has been copied successfully.', 'forminator' ),
|
244 |
),
|
245 |
"commons" => array(
|
246 |
+
"color" => __( "Color", 'forminator' ),
|
247 |
+
"colors" => __( "Colors", 'forminator' ),
|
248 |
+
"border_color" => __( "Border color", 'forminator' ),
|
249 |
+
"border_color_hover" => __( "Border color (hover)", 'forminator' ),
|
250 |
+
"border_color_active" => __( "Border color (active)", 'forminator' ),
|
251 |
+
"border_color_correct" => __( "Border color (correct)", 'forminator' ),
|
252 |
+
"border_color_incorrect" => __( "Border color (incorrect)", 'forminator' ),
|
253 |
+
"border_width" => __( "Border width", 'forminator' ),
|
254 |
+
"border_style" => __( "Border style", 'forminator' ),
|
255 |
+
"background" => __( "Background", 'forminator' ),
|
256 |
+
"background_hover" => __( "Background (hover)", 'forminator' ),
|
257 |
+
"background_active" => __( "Background (active)", 'forminator' ),
|
258 |
+
"background_correct" => __( "Background (correct)", 'forminator' ),
|
259 |
+
"background_incorrect" => __( "Background (incorrect)", 'forminator' ),
|
260 |
+
"font_color" => __( "Font color", 'forminator' ),
|
261 |
+
"font_color_hover" => __( "Font color (hover)", 'forminator' ),
|
262 |
+
"font_color_active" => __( "Font color (active)", 'forminator' ),
|
263 |
+
"font_color_correct" => __( "Font color (correct)", 'forminator' ),
|
264 |
+
"font_color_incorrect" => __( "Font color (incorrect)", 'forminator' ),
|
265 |
+
"font_background" => __( "Font background", 'forminator' ),
|
266 |
+
"font_background" => __( "Font background (hover)", 'forminator' ),
|
267 |
+
"font_background_active" => __( "Font background (active)", 'forminator' ),
|
268 |
+
"font_family" => __( "Font family", 'forminator' ),
|
269 |
+
"font_family_custom" => __( "Custom font family", 'forminator' ),
|
270 |
+
"font_family_placeholder" => __( "E.g. 'Arial', sans-serif", 'forminator' ),
|
271 |
+
"font_family_custom_description" => __( "Here you can type the font family you want to use, as you would in CSS.", 'forminator' ),
|
272 |
+
"icon_size" => __( "Icon size", 'forminator' ),
|
273 |
+
"enable" => __( "Enable", 'forminator' ),
|
274 |
+
"dropdown" => __( "Dropdown", 'forminator' ),
|
275 |
+
"appearance" => __( "Appearance", 'forminator' ),
|
276 |
+
"expand" => __( "Expand", 'forminator' ),
|
277 |
+
"placeholder" => __( "Placeholder", 'forminator' ),
|
278 |
+
"preview" => __( "Preview", 'forminator' ),
|
279 |
+
"icon_color" => __( "Icon color", 'forminator' ),
|
280 |
+
"icon_color_hover" => __( "Icon color (hover)", 'forminator' ),
|
281 |
+
"icon_color_active" => __( "Icon color (active)", 'forminator' ),
|
282 |
+
"icon_color_correct" => __( "Icon color (correct)", 'forminator' ),
|
283 |
+
"icon_color_incorrect" => __( "Icon color (incorrect)", 'forminator' ),
|
284 |
+
"box_shadow" => __( "Box shadow", 'forminator' ),
|
285 |
+
"enable_settings" => __( "Enable settings", 'forminator' ),
|
286 |
+
"font_size" => __( "Font size", 'forminator' ),
|
287 |
+
"font_weight" => __( "Font weight", 'forminator' ),
|
288 |
+
"text_align" => __( "Text align", 'forminator' ),
|
289 |
+
"regular" => __( "Regular", 'forminator' ),
|
290 |
+
"medium" => __( "Medium", 'forminator' ),
|
291 |
+
"large" => __( "Large", 'forminator' ),
|
292 |
+
"light" => __( "Light", 'forminator' ),
|
293 |
+
"normal" => __( "Normal", 'forminator' ),
|
294 |
+
"bold" => __( "Bold", 'forminator' ),
|
295 |
+
"typography" => __( "Typography", 'forminator' ),
|
296 |
+
"padding_top" => __( "Top padding", 'forminator' ),
|
297 |
+
"padding_right" => __( "Right padding", 'forminator' ),
|
298 |
+
"padding_bottom" => __( "Bottom padding", 'forminator' ),
|
299 |
+
"padding_left" => __( "Left padding", 'forminator' ),
|
300 |
+
"border_radius" => __( "Border radius", 'forminator' ),
|
301 |
+
"date_placeholder" => __( "20 April 2018", 'forminator' ),
|
302 |
+
"left" => __( "Left", 'forminator' ),
|
303 |
+
"center" => __( "Center", 'forminator' ),
|
304 |
+
"right" => __( "Right", 'forminator' ),
|
305 |
+
"none" => __( "None", 'forminator' ),
|
306 |
+
"solid" => __( "Solid", 'forminator' ),
|
307 |
+
"dashed" => __( "Dashed", 'forminator' ),
|
308 |
+
"dotted" => __( "Dotted", 'forminator' ),
|
309 |
+
"delete_option" => __( "Delete option", 'forminator' ),
|
310 |
+
"label" => __( "Label", 'forminator' ),
|
311 |
+
"value" => __( "Value", 'forminator' ),
|
312 |
+
"reorder_option" => __( "Re-order this option", 'forminator' ),
|
313 |
+
"forminator_ui" => __( "Forminator UI", 'forminator' ),
|
314 |
+
"forminator_bold" => __( "Forminator Bold", 'forminator' ),
|
315 |
+
"forminator_flat" => __( "Forminator Flat", 'forminator' ),
|
316 |
+
"material_design" => __( "Material Design", 'forminator' ),
|
317 |
+
"no_file_chosen" => __( "No file chosen", 'forminator' ),
|
318 |
+
"update_successfully" => __( "saved succesfully!", 'forminator' ),
|
319 |
+
"update_unsuccessfull" => __( "Error! Settings were not saved.", 'forminator' ),
|
320 |
+
"approve_user_successfull" => __( "User approved succesfully.", 'forminator' ),
|
321 |
+
"approve_user_unsuccessfull" => __( "Error! User was not approved.", 'forminator' )
|
|
|
|
|
322 |
),
|
323 |
'social' => array(
|
324 |
+
'facebook' => __( 'Facebook', 'forminator' ),
|
325 |
+
'twitter' => __( 'Twitter', 'forminator' ),
|
326 |
+
'google_plus' => __( 'Google+', 'forminator' ),
|
327 |
+
'linkedin' => __( 'LinkedIn', 'forminator' ),
|
328 |
),
|
329 |
'calendar' => array(
|
330 |
'day_names_min' => array(
|
331 |
+
esc_html__( 'Su', 'forminator' ),
|
332 |
+
esc_html__( 'Mo', 'forminator' ),
|
333 |
+
esc_html__( 'Tu', 'forminator' ),
|
334 |
+
esc_html__( 'We', 'forminator' ),
|
335 |
+
esc_html__( 'Th', 'forminator' ),
|
336 |
+
esc_html__( 'Fr', 'forminator' ),
|
337 |
+
esc_html__( 'Sa', 'forminator' ),
|
338 |
),
|
339 |
'month_names' => array(
|
340 |
+
esc_html__( 'January', 'forminator' ),
|
341 |
+
esc_html__( 'February', 'forminator' ),
|
342 |
+
esc_html__( 'March', 'forminator' ),
|
343 |
+
esc_html__( 'April', 'forminator' ),
|
344 |
+
esc_html__( 'May', 'forminator' ),
|
345 |
+
esc_html__( 'June', 'forminator' ),
|
346 |
+
esc_html__( 'July', 'forminator' ),
|
347 |
+
esc_html__( 'August', 'forminator' ),
|
348 |
+
esc_html__( 'September', 'forminator' ),
|
349 |
+
esc_html__( 'October', 'forminator' ),
|
350 |
+
esc_html__( 'November', 'forminator' ),
|
351 |
+
esc_html__( 'December', 'forminator' ),
|
352 |
),
|
353 |
'day_names_min' => self::get_short_days_names(),
|
354 |
'month_names' => self::get_months_names(),
|
364 |
'hour' => forminator_get_exporter_info( 'hour', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
365 |
'email' => forminator_get_exporter_info( 'email', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
366 |
'if_new' => forminator_get_exporter_info( 'if_new', forminator_get_form_id_helper() . forminator_get_form_type_helper() ),
|
367 |
+
'noResults' => esc_html__( 'No Result Found', 'forminator' ),
|
368 |
+
'searching' => esc_html__( 'Searching', 'forminator' ),
|
369 |
),
|
370 |
'exporter_logs' => forminator_get_export_logs( forminator_get_form_id_helper() ),
|
371 |
);
|
402 |
*/
|
403 |
private static function get_notices_list() {
|
404 |
$list = array(
|
405 |
+
'settings_reset' => __( 'Data and settings have been reset successfully!', 'forminator' ),
|
406 |
+
'form_deleted' => __( 'Form successfully deleted.', 'forminator' ),
|
407 |
+
'poll_deleted' => __( 'Poll successfully deleted.', 'forminator' ),
|
408 |
+
'quiz_deleted' => __( 'Quiz successfully deleted.', 'forminator' ),
|
409 |
+
'form_duplicated' => __( 'Form successfully duplicated.', 'forminator' ),
|
410 |
+
'poll_duplicated' => __( 'Poll successfully duplicated.', 'forminator' ),
|
411 |
+
'quiz_duplicated' => __( 'Quiz successfully duplicated.', 'forminator' ),
|
412 |
+
'form_reset' => __( 'Form tracking data successfully reset.', 'forminator' ),
|
413 |
+
'poll_reset' => __( 'Poll tracking data successfully reset.', 'forminator' ),
|
414 |
+
'quiz_reset' => __( 'Quiz tracking data successfully reset.', 'forminator' ),
|
415 |
);
|
416 |
|
417 |
return $list;
|
425 |
*/
|
426 |
public static function get_short_days_names() {
|
427 |
return array(
|
428 |
+
esc_html__( 'Su', 'forminator' ),
|
429 |
+
esc_html__( 'Mo', 'forminator' ),
|
430 |
+
esc_html__( 'Tu', 'forminator' ),
|
431 |
+
esc_html__( 'We', 'forminator' ),
|
432 |
+
esc_html__( 'Th', 'forminator' ),
|
433 |
+
esc_html__( 'Fr', 'forminator' ),
|
434 |
+
esc_html__( 'Sa', 'forminator' ),
|
435 |
);
|
436 |
}
|
437 |
|
443 |
*/
|
444 |
public static function get_months_names() {
|
445 |
return array(
|
446 |
+
esc_html__( 'January', 'forminator' ),
|
447 |
+
esc_html__( 'February', 'forminator' ),
|
448 |
+
esc_html__( 'March', 'forminator' ),
|
449 |
+
esc_html__( 'April', 'forminator' ),
|
450 |
+
esc_html__( 'May', 'forminator' ),
|
451 |
+
esc_html__( 'June', 'forminator' ),
|
452 |
+
esc_html__( 'July', 'forminator' ),
|
453 |
+
esc_html__( 'August', 'forminator' ),
|
454 |
+
esc_html__( 'September', 'forminator' ),
|
455 |
+
esc_html__( 'October', 'forminator' ),
|
456 |
+
esc_html__( 'November', 'forminator' ),
|
457 |
+
esc_html__( 'December', 'forminator' ),
|
458 |
);
|
459 |
|
460 |
}
|
admin/classes/class-admin.php
CHANGED
@@ -27,11 +27,8 @@ class Forminator_Admin {
|
|
27 |
add_action( 'admin_notices', array( $this, 'show_rating_notice' ) );
|
28 |
add_action( 'admin_notices', array( $this, 'show_pro_available_notice' ) );
|
29 |
add_action( 'admin_notices', array( $this, 'show_cf7_importer_notice' ) );
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
// Uncomment in 1.14.11
|
34 |
-
//add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_for_notices' ) );
|
35 |
|
36 |
// Add plugin action links
|
37 |
add_filter( 'plugin_action_links_' . FORMINATOR_PLUGIN_BASENAME, array( $this, 'add_plugin_action_links' ) );
|
@@ -213,13 +210,13 @@ class Forminator_Admin {
|
|
213 |
* @since 1.0
|
214 |
*/
|
215 |
public function add_dashboard_page() {
|
216 |
-
$title = __( 'Forminator',
|
217 |
if ( FORMINATOR_PRO ) {
|
218 |
-
$title = __( 'Forminator Pro',
|
219 |
}
|
220 |
|
221 |
$this->pages['forminator'] = new Forminator_Dashboard_Page( 'forminator', 'dashboard', $title, $title, false, false );
|
222 |
-
$this->pages['forminator-dashboard'] = new Forminator_Dashboard_Page( 'forminator', 'dashboard', __( 'Forminator Dashboard',
|
223 |
}
|
224 |
|
225 |
/**
|
@@ -240,8 +237,8 @@ class Forminator_Admin {
|
|
240 |
$this->pages['forminator-integrations'] = new Forminator_Integrations_Page(
|
241 |
'forminator-integrations',
|
242 |
'integrations',
|
243 |
-
__( 'Integrations',
|
244 |
-
__( 'Integrations',
|
245 |
'forminator'
|
246 |
);
|
247 |
|
@@ -272,7 +269,7 @@ class Forminator_Admin {
|
|
272 |
* @since 1.0
|
273 |
*/
|
274 |
public function init_settings_page() {
|
275 |
-
$this->pages['forminator-settings'] = new Forminator_Settings_Page( 'forminator-settings', 'settings', __( 'Global Settings',
|
276 |
}
|
277 |
|
278 |
/**
|
@@ -292,9 +289,9 @@ class Forminator_Admin {
|
|
292 |
public function init_entries_page() {
|
293 |
$this->pages['forminator-entries'] = new Forminator_Entries_Page(
|
294 |
'forminator-entries',
|
295 |
-
'entries',
|
296 |
-
__( 'Forminator Submissions',
|
297 |
-
__( 'Submissions',
|
298 |
'forminator'
|
299 |
);
|
300 |
}
|
@@ -314,7 +311,7 @@ class Forminator_Admin {
|
|
314 |
* @since 1.0
|
315 |
*/
|
316 |
public function init_upgrade_page() {
|
317 |
-
$this->pages['forminator-upgrade'] = new Forminator_Upgrade_Page( 'forminator-upgrade', 'upgrade', __( 'Upgrade to Forminator Pro',
|
318 |
}
|
319 |
|
320 |
/**
|
@@ -325,7 +322,7 @@ class Forminator_Admin {
|
|
325 |
* @return bool
|
326 |
*/
|
327 |
public function has_stripe_forms() {
|
328 |
-
$forms =
|
329 |
|
330 |
if ( count( $forms ) > 0 ) {
|
331 |
return true;
|
@@ -342,7 +339,7 @@ class Forminator_Admin {
|
|
342 |
* @return bool
|
343 |
*/
|
344 |
public function has_old_stripe_forms() {
|
345 |
-
$forms =
|
346 |
|
347 |
if ( count( $forms ) > 0 ) {
|
348 |
return true;
|
@@ -379,11 +376,11 @@ class Forminator_Admin {
|
|
379 |
$link = '<a type="button" href="' . esc_url( $url ) . '" target="_self" class="button button-primary">' . esc_html__( 'Upgrade' ) . '</a>';
|
380 |
|
381 |
$username = forminator_get_current_username();
|
382 |
-
$name = ! empty( $username ) ? $username : __( 'Hey',
|
383 |
|
384 |
$message = '<p>';
|
385 |
/* translators: user's name */
|
386 |
-
$message .= sprintf( esc_html__( '%s, it appears you have an active WPMU DEV membership but haven\'t upgraded Forminator to the pro version. You won\'t lose any settings upgrading, go for it!',
|
387 |
$message .= '</p>';
|
388 |
$message .= '<p>' . $link . '</p>';
|
389 |
|
@@ -437,15 +434,15 @@ class Forminator_Admin {
|
|
437 |
<div class="forminator-notice-cf7 forminator-notice notice notice-info"
|
438 |
data-prop="forminator_cf7_notice_dismissed"
|
439 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
440 |
-
<p style="color: #1A2432; font-size: 14px; font-weight: bold;"><?php echo esc_html__( 'Forminator - Import your Contact Form 7 forms automatically',
|
441 |
|
442 |
-
<p style="color: #72777C; line-height: 22px;"><?php echo esc_html__( 'We noticed that Contact Form 7 is active on your website. You can use our built-in Contact Form 7 importer to import your existing forms and the relevant plugin settings from Contact Form 7 to Forminator. The importer supports the most widely used add-ons as well.',
|
443 |
|
444 |
<p>
|
445 |
<a href="<?php echo esc_url( menu_page_url( 'forminator-settings', false ) . '§ion=import' ); ?>"
|
446 |
-
class="button button-primary"><?php esc_html_e( 'Import Contact Form 7 Forms',
|
447 |
<a href="#" class="dismiss-notice"
|
448 |
-
style="margin-left: 10px; text-decoration: none; color: #555; font-weight: 500;"><?php esc_html_e( 'Dismiss',
|
449 |
</p>
|
450 |
|
451 |
</div>
|
@@ -510,11 +507,11 @@ class Forminator_Admin {
|
|
510 |
|
511 |
<div class="forminator-notice notice notice-warning" data-prop="forminator_stripe_notice_dismissed" data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
512 |
|
513 |
-
<p style="color: #72777C; line-height: 22px;"><?php echo sprintf( __( 'To make Forminator\'s Stripe field <a href="%s" target="_blank">SCA Compliant</a>, we have replaced the Stripe Checkout modal with Stripe Elements which adds an inline field to collect your customer\'s credit or debit card details. Your existing forms with Stripe field are automatically updated, but we recommend checking them to ensure everything works fine.',
|
514 |
|
515 |
<p>
|
516 |
-
<a href="<?php echo esc_url( menu_page_url( 'forminator', false ) . '&show_stripe_dialog=true' ); ?>" class="button button-primary"><?php esc_html_e( 'Learn more',
|
517 |
-
<a href="#" class="dismiss-notice" style="margin-left: 10px; text-decoration: none; color: #555; font-weight: 500;"><?php esc_html_e( 'Dismiss',
|
518 |
</p>
|
519 |
|
520 |
</div>
|
@@ -569,14 +566,14 @@ class Forminator_Admin {
|
|
569 |
|
570 |
<div id="forminator-free-publish-notice" class="forminator-rating-notice notice notice-info fui-wordpress-notice" data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
571 |
|
572 |
-
<p style="color: #72777C; line-height: 22px;"><?php printf( __( 'Awesome! You\'ve published more than %d modules with Forminator. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.',
|
573 |
|
574 |
<p>
|
575 |
-
<a type="button" href="#" target="_blank" class="button button-primary button-large" data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator',
|
576 |
|
577 |
-
<button type="button" class="button button-large" style="margin-left: 11px;" data-prop="<?php echo 10 > $published_modules ? 'forminator_publish_rating_later' : 'forminator_publish_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later',
|
578 |
|
579 |
-
<a href="#" class="dismiss" style="margin-left: 11px; color: #555; line-height: 16px; font-weight: 500; text-decoration: none;" data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks',
|
580 |
</p>
|
581 |
|
582 |
</div>
|
@@ -592,15 +589,15 @@ class Forminator_Admin {
|
|
592 |
class="forminator-rating-notice notice notice-info fui-wordpress-notice"
|
593 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
594 |
|
595 |
-
<p style="color: #72777C; line-height: 22px;"><?php esc_html_e( 'Excellent! You\'ve been using Forminator for a while now. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.',
|
596 |
|
597 |
<p>
|
598 |
<a type="button" href="#" target="_blank" class="button button-primary button-large"
|
599 |
-
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator',
|
600 |
|
601 |
<a href="#" class="dismiss"
|
602 |
style="margin-left: 11px; color: #555; line-height: 16px; font-weight: 500; text-decoration: none;"
|
603 |
-
data-prop="forminator_days_rating_later_dismiss"><?php esc_html_e( 'Maybe later',
|
604 |
</p>
|
605 |
|
606 |
</div>
|
@@ -650,19 +647,19 @@ class Forminator_Admin {
|
|
650 |
public function add_plugin_action_links( $links ) {
|
651 |
// Settings link.
|
652 |
if ( forminator_get_admin_cap() ) {
|
653 |
-
$action_links['dashboard'] = '<a href="' . admin_url( 'admin.php?page=forminator-settings' ) . '" aria-label="' . esc_attr( __( 'Go to Forminator Settings',
|
654 |
}
|
655 |
// Documentation link.
|
656 |
-
$action_links['docs'] = '<a href="' . forminator_get_link( 'docs', 'forminator_pluginlist_docs' ) . '" aria-label="' . esc_attr( __( 'Docs',
|
657 |
|
658 |
// WPMUDEV membership status.
|
659 |
$membership = forminator_membership_status();
|
660 |
|
661 |
// Upgrade or Renew links.
|
662 |
if ( ! FORMINATOR_PRO || 'upgrade' === $membership ) {
|
663 |
-
$action_links['upgrade'] = '<a href="' . forminator_get_link( 'plugin', 'forminator_pluginlist_upgrade' ) . '" aria-label="' . esc_attr( __( 'Upgrade to Forminator Pro',
|
664 |
} elseif ( 'expired' === $membership || 'free' === $membership ) {
|
665 |
-
$action_links['renew'] = '<a href="' . forminator_get_link( 'plugin', 'forminator_pluginlist_renew' ) . '" aria-label="' . esc_attr( __( 'Upgrade 35% OFF Sale',
|
666 |
}
|
667 |
|
668 |
return array_merge( $action_links, $links );
|
@@ -718,8 +715,8 @@ class Forminator_Admin {
|
|
718 |
$links[2] = str_replace( 'href=', 'target="_blank" href=', $links[2] );
|
719 |
}
|
720 |
}
|
721 |
-
$row_meta['rate'] = '<a href="' . esc_url( forminator_get_link( 'rate' ) ) . '" aria-label="' . esc_attr__( 'Rate Forminator',
|
722 |
-
$row_meta['support'] = '<a href="' . esc_url( forminator_get_link( 'support' ) ) . '" aria-label="' . esc_attr__( 'Support',
|
723 |
} else {
|
724 |
// Change 'Visit plugins' link to 'View details'.
|
725 |
if ( isset( $links[2] ) && false !== strpos( $links[2], 'project/forminator' ) ) {
|
@@ -729,9 +726,9 @@ class Forminator_Admin {
|
|
729 |
__( 'View details' )
|
730 |
);
|
731 |
}
|
732 |
-
$row_meta['support'] = '<a href="' . esc_url( forminator_get_link( 'support' ) ) . '" aria-label="' . esc_attr__( 'Premium Support',
|
733 |
}
|
734 |
-
$row_meta['roadmap'] = '<a href="' . esc_url( forminator_get_link( 'roadmap' ) ) . '" aria-label="' . esc_attr__( 'Roadmap',
|
735 |
|
736 |
return array_merge( $links, $row_meta );
|
737 |
}
|
27 |
add_action( 'admin_notices', array( $this, 'show_rating_notice' ) );
|
28 |
add_action( 'admin_notices', array( $this, 'show_pro_available_notice' ) );
|
29 |
add_action( 'admin_notices', array( $this, 'show_cf7_importer_notice' ) );
|
30 |
+
add_action( 'admin_notices', array( $this, 'show_prelaunch_subscriptions_notice' ) );
|
31 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts_for_notices' ) );
|
|
|
|
|
|
|
32 |
|
33 |
// Add plugin action links
|
34 |
add_filter( 'plugin_action_links_' . FORMINATOR_PLUGIN_BASENAME, array( $this, 'add_plugin_action_links' ) );
|
210 |
* @since 1.0
|
211 |
*/
|
212 |
public function add_dashboard_page() {
|
213 |
+
$title = __( 'Forminator', 'forminator' );
|
214 |
if ( FORMINATOR_PRO ) {
|
215 |
+
$title = __( 'Forminator Pro', 'forminator' );
|
216 |
}
|
217 |
|
218 |
$this->pages['forminator'] = new Forminator_Dashboard_Page( 'forminator', 'dashboard', $title, $title, false, false );
|
219 |
+
$this->pages['forminator-dashboard'] = new Forminator_Dashboard_Page( 'forminator', 'dashboard', __( 'Forminator Dashboard', 'forminator' ), __( 'Dashboard', 'forminator' ), 'forminator' );
|
220 |
}
|
221 |
|
222 |
/**
|
237 |
$this->pages['forminator-integrations'] = new Forminator_Integrations_Page(
|
238 |
'forminator-integrations',
|
239 |
'integrations',
|
240 |
+
__( 'Integrations', 'forminator' ),
|
241 |
+
__( 'Integrations', 'forminator' ),
|
242 |
'forminator'
|
243 |
);
|
244 |
|
269 |
* @since 1.0
|
270 |
*/
|
271 |
public function init_settings_page() {
|
272 |
+
$this->pages['forminator-settings'] = new Forminator_Settings_Page( 'forminator-settings', 'settings', __( 'Global Settings', 'forminator' ), __( 'Settings', 'forminator' ), 'forminator' );
|
273 |
}
|
274 |
|
275 |
/**
|
289 |
public function init_entries_page() {
|
290 |
$this->pages['forminator-entries'] = new Forminator_Entries_Page(
|
291 |
'forminator-entries',
|
292 |
+
'common/entries',
|
293 |
+
__( 'Forminator Submissions', 'forminator' ),
|
294 |
+
__( 'Submissions', 'forminator' ),
|
295 |
'forminator'
|
296 |
);
|
297 |
}
|
311 |
* @since 1.0
|
312 |
*/
|
313 |
public function init_upgrade_page() {
|
314 |
+
$this->pages['forminator-upgrade'] = new Forminator_Upgrade_Page( 'forminator-upgrade', 'upgrade', __( 'Upgrade to Forminator Pro', 'forminator' ), __( 'Forminator Pro', 'forminator' ), 'forminator' );
|
315 |
}
|
316 |
|
317 |
/**
|
322 |
* @return bool
|
323 |
*/
|
324 |
public function has_stripe_forms() {
|
325 |
+
$forms = Forminator_Form_Model::model()->get_models_by_field( 'stripe-1' );
|
326 |
|
327 |
if ( count( $forms ) > 0 ) {
|
328 |
return true;
|
339 |
* @return bool
|
340 |
*/
|
341 |
public function has_old_stripe_forms() {
|
342 |
+
$forms = Forminator_Form_Model::model()->get_models_by_field_and_version( 'stripe-1', '1.9-alpha.1' );
|
343 |
|
344 |
if ( count( $forms ) > 0 ) {
|
345 |
return true;
|
376 |
$link = '<a type="button" href="' . esc_url( $url ) . '" target="_self" class="button button-primary">' . esc_html__( 'Upgrade' ) . '</a>';
|
377 |
|
378 |
$username = forminator_get_current_username();
|
379 |
+
$name = ! empty( $username ) ? $username : __( 'Hey', 'forminator' );
|
380 |
|
381 |
$message = '<p>';
|
382 |
/* translators: user's name */
|
383 |
+
$message .= sprintf( esc_html__( '%s, it appears you have an active WPMU DEV membership but haven\'t upgraded Forminator to the pro version. You won\'t lose any settings upgrading, go for it!', 'forminator' ), $name );
|
384 |
$message .= '</p>';
|
385 |
$message .= '<p>' . $link . '</p>';
|
386 |
|
434 |
<div class="forminator-notice-cf7 forminator-notice notice notice-info"
|
435 |
data-prop="forminator_cf7_notice_dismissed"
|
436 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
437 |
+
<p style="color: #1A2432; font-size: 14px; font-weight: bold;"><?php echo esc_html__( 'Forminator - Import your Contact Form 7 forms automatically', 'forminator' ); ?></p>
|
438 |
|
439 |
+
<p style="color: #72777C; line-height: 22px;"><?php echo esc_html__( 'We noticed that Contact Form 7 is active on your website. You can use our built-in Contact Form 7 importer to import your existing forms and the relevant plugin settings from Contact Form 7 to Forminator. The importer supports the most widely used add-ons as well.', 'forminator' ); ?></p>
|
440 |
|
441 |
<p>
|
442 |
<a href="<?php echo esc_url( menu_page_url( 'forminator-settings', false ) . '§ion=import' ); ?>"
|
443 |
+
class="button button-primary"><?php esc_html_e( 'Import Contact Form 7 Forms', 'forminator' ); ?></a>
|
444 |
<a href="#" class="dismiss-notice"
|
445 |
+
style="margin-left: 10px; text-decoration: none; color: #555; font-weight: 500;"><?php esc_html_e( 'Dismiss', 'forminator' ); ?></a>
|
446 |
</p>
|
447 |
|
448 |
</div>
|
507 |
|
508 |
<div class="forminator-notice notice notice-warning" data-prop="forminator_stripe_notice_dismissed" data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
509 |
|
510 |
+
<p style="color: #72777C; line-height: 22px;"><?php echo sprintf( __( 'To make Forminator\'s Stripe field <a href="%s" target="_blank">SCA Compliant</a>, we have replaced the Stripe Checkout modal with Stripe Elements which adds an inline field to collect your customer\'s credit or debit card details. Your existing forms with Stripe field are automatically updated, but we recommend checking them to ensure everything works fine.', 'forminator' ), 'https://stripe.com/gb/guides/strong-customer-authentication' ); ?></p>
|
511 |
|
512 |
<p>
|
513 |
+
<a href="<?php echo esc_url( menu_page_url( 'forminator', false ) . '&show_stripe_dialog=true' ); ?>" class="button button-primary"><?php esc_html_e( 'Learn more', 'forminator' ); ?></a>
|
514 |
+
<a href="#" class="dismiss-notice" style="margin-left: 10px; text-decoration: none; color: #555; font-weight: 500;"><?php esc_html_e( 'Dismiss', 'forminator' ); ?></a>
|
515 |
</p>
|
516 |
|
517 |
</div>
|
566 |
|
567 |
<div id="forminator-free-publish-notice" class="forminator-rating-notice notice notice-info fui-wordpress-notice" data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
568 |
|
569 |
+
<p style="color: #72777C; line-height: 22px;"><?php printf( __( 'Awesome! You\'ve published more than %d modules with Forminator. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.', 'forminator' ), $milestone ); ?></p>
|
570 |
|
571 |
<p>
|
572 |
+
<a type="button" href="#" target="_blank" class="button button-primary button-large" data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator', 'forminator' ); ?></a>
|
573 |
|
574 |
+
<button type="button" class="button button-large" style="margin-left: 11px;" data-prop="<?php echo 10 > $published_modules ? 'forminator_publish_rating_later' : 'forminator_publish_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later', 'forminator' ); ?></button>
|
575 |
|
576 |
+
<a href="#" class="dismiss" style="margin-left: 11px; color: #555; line-height: 16px; font-weight: 500; text-decoration: none;" data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks', 'forminator' ); ?></a>
|
577 |
</p>
|
578 |
|
579 |
</div>
|
589 |
class="forminator-rating-notice notice notice-info fui-wordpress-notice"
|
590 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
591 |
|
592 |
+
<p style="color: #72777C; line-height: 22px;"><?php esc_html_e( 'Excellent! You\'ve been using Forminator for a while now. Hope you are enjoying it so far. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.', 'forminator' ); ?></p>
|
593 |
|
594 |
<p>
|
595 |
<a type="button" href="#" target="_blank" class="button button-primary button-large"
|
596 |
+
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator', 'forminator' ); ?></a>
|
597 |
|
598 |
<a href="#" class="dismiss"
|
599 |
style="margin-left: 11px; color: #555; line-height: 16px; font-weight: 500; text-decoration: none;"
|
600 |
+
data-prop="forminator_days_rating_later_dismiss"><?php esc_html_e( 'Maybe later', 'forminator' ); ?></a>
|
601 |
</p>
|
602 |
|
603 |
</div>
|
647 |
public function add_plugin_action_links( $links ) {
|
648 |
// Settings link.
|
649 |
if ( forminator_get_admin_cap() ) {
|
650 |
+
$action_links['dashboard'] = '<a href="' . admin_url( 'admin.php?page=forminator-settings' ) . '" aria-label="' . esc_attr( __( 'Go to Forminator Settings', 'forminator' ) ) . '">' . esc_html__( 'Settings', 'forminator' ) . '</a>';
|
651 |
}
|
652 |
// Documentation link.
|
653 |
+
$action_links['docs'] = '<a href="' . forminator_get_link( 'docs', 'forminator_pluginlist_docs' ) . '" aria-label="' . esc_attr( __( 'Docs', 'forminator' ) ) . '" target="_blank">' . esc_html__( 'Docs', 'forminator' ) . '</a>';
|
654 |
|
655 |
// WPMUDEV membership status.
|
656 |
$membership = forminator_membership_status();
|
657 |
|
658 |
// Upgrade or Renew links.
|
659 |
if ( ! FORMINATOR_PRO || 'upgrade' === $membership ) {
|
660 |
+
$action_links['upgrade'] = '<a href="' . forminator_get_link( 'plugin', 'forminator_pluginlist_upgrade' ) . '" aria-label="' . esc_attr( __( 'Upgrade to Forminator Pro', 'forminator' ) ) . '" style="color: #8D00B1;" target="_blank">' . esc_html__( 'Upgrade', 'forminator' ) . '</a>';
|
661 |
} elseif ( 'expired' === $membership || 'free' === $membership ) {
|
662 |
+
$action_links['renew'] = '<a href="' . forminator_get_link( 'plugin', 'forminator_pluginlist_renew' ) . '" aria-label="' . esc_attr( __( 'Upgrade 35% OFF Sale', 'forminator' ) ) . '" style="color: #8D00B1;" target="_blank">' . esc_html__( 'Upgrade 35% OFF Sale', 'forminator' ) . '</a>';
|
663 |
}
|
664 |
|
665 |
return array_merge( $action_links, $links );
|
715 |
$links[2] = str_replace( 'href=', 'target="_blank" href=', $links[2] );
|
716 |
}
|
717 |
}
|
718 |
+
$row_meta['rate'] = '<a href="' . esc_url( forminator_get_link( 'rate' ) ) . '" aria-label="' . esc_attr__( 'Rate Forminator', 'forminator' ) . '" target="_blank">' . esc_html__( 'Rate Forminator', 'forminator' ) . '</a>';
|
719 |
+
$row_meta['support'] = '<a href="' . esc_url( forminator_get_link( 'support' ) ) . '" aria-label="' . esc_attr__( 'Support', 'forminator' ) . '" target="_blank">' . esc_html__( 'Support', 'forminator' ) . '</a>';
|
720 |
} else {
|
721 |
// Change 'Visit plugins' link to 'View details'.
|
722 |
if ( isset( $links[2] ) && false !== strpos( $links[2], 'project/forminator' ) ) {
|
726 |
__( 'View details' )
|
727 |
);
|
728 |
}
|
729 |
+
$row_meta['support'] = '<a href="' . esc_url( forminator_get_link( 'support' ) ) . '" aria-label="' . esc_attr__( 'Premium Support', 'forminator' ) . '" target="_blank">' . esc_html__( 'Premium Support', 'forminator' ) . '</a>';
|
730 |
}
|
731 |
+
$row_meta['roadmap'] = '<a href="' . esc_url( forminator_get_link( 'roadmap' ) ) . '" aria-label="' . esc_attr__( 'Roadmap', 'forminator' ) . '" target="_blank">' . esc_html__( 'Roadmap', 'forminator' ) . '</a>';
|
732 |
|
733 |
return array_merge( $links, $row_meta );
|
734 |
}
|
admin/classes/thirdparty-importers/class-importer-cf7.php
CHANGED
@@ -91,7 +91,7 @@ class Forminator_Admin_Import_CF7 extends Forminator_Import_Mediator {
|
|
91 |
'enable-ajax' => 'true',
|
92 |
'autoclose' => 'true',
|
93 |
'submission-indicator' => 'show',
|
94 |
-
'indicator-label' => __( 'Submitting...',
|
95 |
'paginationData' => array(
|
96 |
'pagination-header-design' => 'show',
|
97 |
'pagination-header' => 'nav',
|
@@ -235,7 +235,7 @@ class Forminator_Admin_Import_CF7 extends Forminator_Import_Mediator {
|
|
235 |
if ( 'captcha' === $type ) {
|
236 |
$global['captchaV2'] = true;
|
237 |
$condition = array();
|
238 |
-
$field_name = esc_html__( 'reCaptcha',
|
239 |
} else {
|
240 |
$field_name = esc_html( $this->get_label_cf7( $field->name, $form_html ) );
|
241 |
}
|
91 |
'enable-ajax' => 'true',
|
92 |
'autoclose' => 'true',
|
93 |
'submission-indicator' => 'show',
|
94 |
+
'indicator-label' => __( 'Submitting...', 'forminator' ),
|
95 |
'paginationData' => array(
|
96 |
'pagination-header-design' => 'show',
|
97 |
'pagination-header' => 'nav',
|
235 |
if ( 'captcha' === $type ) {
|
236 |
$global['captchaV2'] = true;
|
237 |
$condition = array();
|
238 |
+
$field_name = esc_html__( 'reCaptcha', 'forminator' );
|
239 |
} else {
|
240 |
$field_name = esc_html( $this->get_label_cf7( $field->name, $form_html ) );
|
241 |
}
|
admin/locale.php
CHANGED
@@ -320,6 +320,8 @@ $forminator_admin_locale = array(
|
|
320 |
"Enter default value" => array( null, __("Enter default value", "forminator" ), ), // src/form/components/fields/currency.js:69
|
321 |
"Currency" => array( null, __("Currency", "forminator" ), ), // src/form/components/fields/currency.js:100
|
322 |
"Choose the currency to display on the field. If you are going to collect payments based on this field, it is recommended to keep this currency same as your charge currency to avoid any confusions." => array( null, __("Choose the currency to display on the field. If you are going to collect payments based on this field, it is recommended to keep this currency same as your charge currency to avoid any confusions.", "forminator" ), ), // src/form/components/fields/currency.js:108
|
|
|
|
|
323 |
"Limit" => array( null, __("Limit", "forminator" ), ), // src/form/components/fields/currency.js:176
|
324 |
"Restrict the value that your users can enter in this field within a custom range." => array( null, __("Restrict the value that your users can enter in this field within a custom range.", "forminator" ), ), // src/form/components/fields/currency.js:180
|
325 |
"Min" => array( null, __("Min", "forminator" ), ), // src/form/components/fields/currency.js:195
|
@@ -329,19 +331,6 @@ $forminator_admin_locale = array(
|
|
329 |
"E.g. Please enter a number greater than 0." => array( null, __("E.g. Please enter a number greater than 0.", "forminator" ), ), // src/form/components/fields/currency.js:233
|
330 |
"When number is greater than the max limit" => array( null, __("When number is greater than the max limit", "forminator" ), ), // src/form/components/fields/currency.js:239
|
331 |
"E.g. Please enter a number lower than 1000." => array( null, __("E.g. Please enter a number lower than 1000.", "forminator" ), ), // src/form/components/fields/currency.js:241
|
332 |
-
"Separators" => array( null, __("Separators", "forminator" ), ), // src/form/components/fields/currency.js:276
|
333 |
-
"1234567.89" => array( null, __("1234567.89", "forminator" ), ), // src/form/components/fields/currency.js:279
|
334 |
-
"1,234,567.89" => array( null, __("1,234,567.89", "forminator" ), ), // src/form/components/fields/currency.js:280
|
335 |
-
"1.234.567,89" => array( null, __("1.234.567,89", "forminator" ), ), // src/form/components/fields/currency.js:281
|
336 |
-
"1 234 567,89" => array( null, __("1 234 567,89", "forminator" ), ), // src/form/components/fields/currency.js:282
|
337 |
-
"Round To" => array( null, __("Round To", "forminator" ), ), // src/form/components/fields/currency.js:293
|
338 |
-
"0 decimals" => array( null, __("0 decimals", "forminator" ), ), // src/form/components/fields/currency.js:296
|
339 |
-
"1 decimals" => array( null, __("1 decimals", "forminator" ), ), // src/form/components/fields/currency.js:297
|
340 |
-
"2 decimals" => array( null, __("2 decimals", "forminator" ), ), // src/form/components/fields/currency.js:298
|
341 |
-
"3 decimals" => array( null, __("3 decimals", "forminator" ), ), // src/form/components/fields/currency.js:299
|
342 |
-
"4 decimals" => array( null, __("4 decimals", "forminator" ), ), // src/form/components/fields/currency.js:300
|
343 |
-
"Thousand Separator" => array( null, __("Thousand Separator", "forminator" ), ), // src/form/components/fields/currency.js:318
|
344 |
-
"Decimal Separator" => array( null, __("Decimal Separator", "forminator" ), ), // src/form/components/fields/currency.js:327
|
345 |
"Note: The query parameter's value passed in URL should match with the selected date format." => array( null, __("Note: The query parameter's value passed in URL should match with the selected date format.", "forminator" ), ), // src/form/components/fields/date.js:29
|
346 |
"Type" => array( null, __("Type", "forminator" ), ), // src/form/components/fields/date.js:42
|
347 |
"Date Format" => array( null, __("Date Format", "forminator" ), ), // src/form/components/fields/date.js:76
|
@@ -630,12 +619,12 @@ $forminator_admin_locale = array(
|
|
630 |
"Name your form" => array( null, __("Name your form", "forminator" ), ), // src/form/components/header/title.js:32
|
631 |
"Give your form a name" => array( null, __("Give your form a name", "forminator" ), ), // src/form/components/header/title.js:37
|
632 |
"Please, enter a valid name." => array( null, __("Please, enter a valid name.", "forminator" ), ), // src/form/components/header/title.js:60
|
633 |
-
"Fetching integration list…" => array( null, __("Fetching integration list…", "forminator" ), ), // src/form/components/integrations.js:
|
634 |
-
"You need to save this form before using integrations." => array( null, __("You need to save this form before using integrations.", "forminator" ), ), // src/form/components/integrations.js:
|
635 |
-
"TRY AGAIN" => array( null, __("TRY AGAIN", "forminator" ), ), // src/form/components/integrations.js:
|
636 |
-
"Integrations" => array( null, __("Integrations", "forminator" ), ), // src/form/components/integrations.js:
|
637 |
-
"Applications" => array( null, __("Applications", "forminator" ), ), // src/form/components/integrations.js:
|
638 |
-
"You can send this form's data to any of the connected third party apps. Connect to more apps on the {{link}}Integrations{{/link}} page." => array( null, __("You can send this form's data to any of the connected third party apps. Connect to more apps on the {{link}}Integrations{{/link}} page.", "forminator" ), ), // src/form/components/integrations.js:
|
639 |
"Login User" => array( null, __("Login User", "forminator" ), ), // src/form/components/login.js:31
|
640 |
"Additional Settings" => array( null, __("Additional Settings", "forminator" ), ), // src/form/components/login/additional-settings.js:20
|
641 |
"These settings will add some extra control on your login process." => array( null, __("These settings will add some extra control on your login process.", "forminator" ), ), // src/form/components/login/additional-settings.js:23
|
@@ -1092,7 +1081,7 @@ $forminator_admin_locale = array(
|
|
1092 |
"Edit Poll" => array( null, __("Edit Poll", "forminator" ), ), // src/poll/components/header.js:13
|
1093 |
"Name your poll" => array( null, __("Name your poll", "forminator" ), ), // src/poll/components/header/title.js:38
|
1094 |
"Give your poll a name" => array( null, __("Give your poll a name", "forminator" ), ), // src/poll/components/header/title.js:43
|
1095 |
-
"You need to save this poll before using integrations." => array( null, __("You need to save this poll before using integrations.", "forminator" ), ), // src/poll/components/integrations.js:
|
1096 |
"Poll answers can not be empty." => array( null, __("Poll answers can not be empty.", "forminator" ), ), // src/poll/components/meta.js:101
|
1097 |
"Please enter valid voting limit." => array( null, __("Please enter valid voting limit.", "forminator" ), ), // src/poll/components/meta.js:114
|
1098 |
"Deleting this answer" => array( null, __("Deleting this answer", "forminator" ), ), // src/poll/components/modals/delete.js:40
|
@@ -1177,7 +1166,7 @@ $forminator_admin_locale = array(
|
|
1177 |
"A quiz without questions is not going to be very useful… Add your questions above!" => array( null, __("A quiz without questions is not going to be very useful… Add your questions above!", "forminator" ), ), // src/quiz/global/components/builder/questions.js:108
|
1178 |
"Edit Quiz" => array( null, __("Edit Quiz", "forminator" ), ), // src/quiz/global/components/header.js:13
|
1179 |
"Give your quiz a name" => array( null, __("Give your quiz a name", "forminator" ), ), // src/quiz/global/components/header/title.js:43
|
1180 |
-
"You need to save this quiz before using integrations." => array( null, __("You need to save this quiz before using integrations.", "forminator" ), ), // src/quiz/global/components/integrations.js:
|
1181 |
"Intro" => array( null, __("Intro", "forminator" ), ), // src/quiz/global/components/intro.js:29
|
1182 |
"Start by adding a title for your quiz to let your visitors know what this quiz is all about." => array( null, __("Start by adding a title for your quiz to let your visitors know what this quiz is all about.", "forminator" ), ), // src/quiz/global/components/intro.js:40
|
1183 |
"Which superhero are you?" => array( null, __("Which superhero are you?", "forminator" ), ), // src/quiz/global/components/intro.js:55
|
@@ -1343,7 +1332,9 @@ $forminator_admin_locale = array(
|
|
1343 |
"Don't Miss Out On Subscription / Recurring Payment Support" => array( null, __("Don't Miss Out On Subscription / Recurring Payment Support", "forminator" ), ), // src/shared/discount.js:21
|
1344 |
"Don't worry, only admin users can see this message" => array( null, __("Don't worry, only admin users can see this message", "forminator" ), ), // src/shared/discount.js:22
|
1345 |
"Get 35% OFF Forminator Pro" => array( null, __("Get 35% OFF Forminator Pro", "forminator" ), ), // src/shared/discount.js:27
|
1346 |
-
"
|
|
|
|
|
1347 |
"is having" => array( null, __("is having", "forminator" ), ), // src/utils.js:876
|
1348 |
"is" => array( null, __("is", "forminator" ), ), // src/utils.js:879
|
1349 |
"is not having" => array( null, __("is not having", "forminator" ), ), // src/utils.js:883
|
320 |
"Enter default value" => array( null, __("Enter default value", "forminator" ), ), // src/form/components/fields/currency.js:69
|
321 |
"Currency" => array( null, __("Currency", "forminator" ), ), // src/form/components/fields/currency.js:100
|
322 |
"Choose the currency to display on the field. If you are going to collect payments based on this field, it is recommended to keep this currency same as your charge currency to avoid any confusions." => array( null, __("Choose the currency to display on the field. If you are going to collect payments based on this field, it is recommended to keep this currency same as your charge currency to avoid any confusions.", "forminator" ), ), // src/form/components/fields/currency.js:108
|
323 |
+
"Decimal Points" => array( null, __("Decimal Points", "forminator" ), ), // src/form/components/fields/currency.js:132
|
324 |
+
"Set the maximum number of digits that your users can enter after the decimal point." => array( null, __("Set the maximum number of digits that your users can enter after the decimal point.", "forminator" ), ), // src/form/components/fields/currency.js:140
|
325 |
"Limit" => array( null, __("Limit", "forminator" ), ), // src/form/components/fields/currency.js:176
|
326 |
"Restrict the value that your users can enter in this field within a custom range." => array( null, __("Restrict the value that your users can enter in this field within a custom range.", "forminator" ), ), // src/form/components/fields/currency.js:180
|
327 |
"Min" => array( null, __("Min", "forminator" ), ), // src/form/components/fields/currency.js:195
|
331 |
"E.g. Please enter a number greater than 0." => array( null, __("E.g. Please enter a number greater than 0.", "forminator" ), ), // src/form/components/fields/currency.js:233
|
332 |
"When number is greater than the max limit" => array( null, __("When number is greater than the max limit", "forminator" ), ), // src/form/components/fields/currency.js:239
|
333 |
"E.g. Please enter a number lower than 1000." => array( null, __("E.g. Please enter a number lower than 1000.", "forminator" ), ), // src/form/components/fields/currency.js:241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
334 |
"Note: The query parameter's value passed in URL should match with the selected date format." => array( null, __("Note: The query parameter's value passed in URL should match with the selected date format.", "forminator" ), ), // src/form/components/fields/date.js:29
|
335 |
"Type" => array( null, __("Type", "forminator" ), ), // src/form/components/fields/date.js:42
|
336 |
"Date Format" => array( null, __("Date Format", "forminator" ), ), // src/form/components/fields/date.js:76
|
619 |
"Name your form" => array( null, __("Name your form", "forminator" ), ), // src/form/components/header/title.js:32
|
620 |
"Give your form a name" => array( null, __("Give your form a name", "forminator" ), ), // src/form/components/header/title.js:37
|
621 |
"Please, enter a valid name." => array( null, __("Please, enter a valid name.", "forminator" ), ), // src/form/components/header/title.js:60
|
622 |
+
"Fetching integration list…" => array( null, __("Fetching integration list…", "forminator" ), ), // src/form/components/integrations.js:107
|
623 |
+
"You need to save this form before using integrations." => array( null, __("You need to save this form before using integrations.", "forminator" ), ), // src/form/components/integrations.js:113
|
624 |
+
"TRY AGAIN" => array( null, __("TRY AGAIN", "forminator" ), ), // src/form/components/integrations.js:116
|
625 |
+
"Integrations" => array( null, __("Integrations", "forminator" ), ), // src/form/components/integrations.js:133
|
626 |
+
"Applications" => array( null, __("Applications", "forminator" ), ), // src/form/components/integrations.js:139
|
627 |
+
"You can send this form's data to any of the connected third party apps. Connect to more apps on the {{link}}Integrations{{/link}} page." => array( null, __("You can send this form's data to any of the connected third party apps. Connect to more apps on the {{link}}Integrations{{/link}} page.", "forminator" ), ), // src/form/components/integrations.js:140
|
628 |
"Login User" => array( null, __("Login User", "forminator" ), ), // src/form/components/login.js:31
|
629 |
"Additional Settings" => array( null, __("Additional Settings", "forminator" ), ), // src/form/components/login/additional-settings.js:20
|
630 |
"These settings will add some extra control on your login process." => array( null, __("These settings will add some extra control on your login process.", "forminator" ), ), // src/form/components/login/additional-settings.js:23
|
1081 |
"Edit Poll" => array( null, __("Edit Poll", "forminator" ), ), // src/poll/components/header.js:13
|
1082 |
"Name your poll" => array( null, __("Name your poll", "forminator" ), ), // src/poll/components/header/title.js:38
|
1083 |
"Give your poll a name" => array( null, __("Give your poll a name", "forminator" ), ), // src/poll/components/header/title.js:43
|
1084 |
+
"You need to save this poll before using integrations." => array( null, __("You need to save this poll before using integrations.", "forminator" ), ), // src/poll/components/integrations.js:114
|
1085 |
"Poll answers can not be empty." => array( null, __("Poll answers can not be empty.", "forminator" ), ), // src/poll/components/meta.js:101
|
1086 |
"Please enter valid voting limit." => array( null, __("Please enter valid voting limit.", "forminator" ), ), // src/poll/components/meta.js:114
|
1087 |
"Deleting this answer" => array( null, __("Deleting this answer", "forminator" ), ), // src/poll/components/modals/delete.js:40
|
1166 |
"A quiz without questions is not going to be very useful… Add your questions above!" => array( null, __("A quiz without questions is not going to be very useful… Add your questions above!", "forminator" ), ), // src/quiz/global/components/builder/questions.js:108
|
1167 |
"Edit Quiz" => array( null, __("Edit Quiz", "forminator" ), ), // src/quiz/global/components/header.js:13
|
1168 |
"Give your quiz a name" => array( null, __("Give your quiz a name", "forminator" ), ), // src/quiz/global/components/header/title.js:43
|
1169 |
+
"You need to save this quiz before using integrations." => array( null, __("You need to save this quiz before using integrations.", "forminator" ), ), // src/quiz/global/components/integrations.js:114
|
1170 |
"Intro" => array( null, __("Intro", "forminator" ), ), // src/quiz/global/components/intro.js:29
|
1171 |
"Start by adding a title for your quiz to let your visitors know what this quiz is all about." => array( null, __("Start by adding a title for your quiz to let your visitors know what this quiz is all about.", "forminator" ), ), // src/quiz/global/components/intro.js:40
|
1172 |
"Which superhero are you?" => array( null, __("Which superhero are you?", "forminator" ), ), // src/quiz/global/components/intro.js:55
|
1332 |
"Don't Miss Out On Subscription / Recurring Payment Support" => array( null, __("Don't Miss Out On Subscription / Recurring Payment Support", "forminator" ), ), // src/shared/discount.js:21
|
1333 |
"Don't worry, only admin users can see this message" => array( null, __("Don't worry, only admin users can see this message", "forminator" ), ), // src/shared/discount.js:22
|
1334 |
"Get 35% OFF Forminator Pro" => array( null, __("Get 35% OFF Forminator Pro", "forminator" ), ), // src/shared/discount.js:27
|
1335 |
+
"Pay only" => array( null, __("Pay only", "forminator" ), ), // src/shared/discount.js:30
|
1336 |
+
"year" => array( null, __("year", "forminator" ), ), // src/shared/discount.js:31
|
1337 |
+
"Subscription Payments, our most anticipated Pro feature, is coming soon in v1.15! Upgrade now and get 35% OFF all annual plans." => array( null, __("Subscription Payments, our most anticipated Pro feature, is coming soon in v1.15! Upgrade now and get 35% OFF all annual plans.", "forminator" ), ), // src/shared/discount.js:33
|
1338 |
"is having" => array( null, __("is having", "forminator" ), ), // src/utils.js:876
|
1339 |
"is" => array( null, __("is", "forminator" ), ), // src/utils.js:879
|
1340 |
"is not having" => array( null, __("is not having", "forminator" ), ), // src/utils.js:883
|
admin/pages/dashboard-page.php
CHANGED
@@ -10,22 +10,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
*/
|
11 |
class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
12 |
|
13 |
-
/**
|
14 |
-
* Register content boxes
|
15 |
-
*
|
16 |
-
* @since 1.0
|
17 |
-
*/
|
18 |
-
public function register_content_boxes() {
|
19 |
-
$this->add_box(
|
20 |
-
'dashboard/create',
|
21 |
-
__( 'Create Modules', Forminator::DOMAIN ),
|
22 |
-
'dashboard-create',
|
23 |
-
null,
|
24 |
-
array( $this, 'dashboard_create_screen' ),
|
25 |
-
null
|
26 |
-
);
|
27 |
-
}
|
28 |
-
|
29 |
/**
|
30 |
* Print Dashboard box
|
31 |
*
|
@@ -41,23 +25,6 @@ class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
|
41 |
);
|
42 |
}
|
43 |
|
44 |
-
/**
|
45 |
-
* Return admin edit url
|
46 |
-
*
|
47 |
-
* @since 1.6
|
48 |
-
* @param $type
|
49 |
-
* @param $id
|
50 |
-
*
|
51 |
-
* @return mixed
|
52 |
-
*/
|
53 |
-
public function getAdminEditUrl( $type, $id ) {
|
54 |
-
if ( 'nowrong' === $type ) {
|
55 |
-
return admin_url( 'admin.php?page=forminator-nowrong-wizard&id=' . $id );
|
56 |
-
} else {
|
57 |
-
return admin_url( 'admin.php?page=forminator-knowledge-wizard&id=' . $id );
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
/**
|
62 |
* Count modules
|
63 |
*
|
@@ -65,7 +32,7 @@ class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
|
65 |
* @return int
|
66 |
*/
|
67 |
public function countModules( $status = '' ) {
|
68 |
-
return
|
69 |
}
|
70 |
|
71 |
/**
|
@@ -76,7 +43,7 @@ class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
|
76 |
* @return array
|
77 |
*/
|
78 |
public function stripeModules() {
|
79 |
-
return
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -89,10 +56,7 @@ class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
|
89 |
public function enqueue_scripts( $hook ) {
|
90 |
parent::enqueue_scripts( $hook );
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
forminator_print_front_styles( FORMINATOR_VERSION );
|
95 |
-
|
96 |
-
forminator_print_front_scripts( FORMINATOR_VERSION );
|
97 |
}
|
98 |
}
|
10 |
*/
|
11 |
class Forminator_Dashboard_Page extends Forminator_Admin_Page {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Print Dashboard box
|
15 |
*
|
25 |
);
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Count modules
|
30 |
*
|
32 |
* @return int
|
33 |
*/
|
34 |
public function countModules( $status = '' ) {
|
35 |
+
return Forminator_Form_Model::model()->count_all( $status );
|
36 |
}
|
37 |
|
38 |
/**
|
43 |
* @return array
|
44 |
*/
|
45 |
public function stripeModules() {
|
46 |
+
return Forminator_Form_Model::model()->get_models_by_field_and_version( 'stripe-1', '1.9-alpha.1' );
|
47 |
}
|
48 |
|
49 |
/**
|
56 |
public function enqueue_scripts( $hook ) {
|
57 |
parent::enqueue_scripts( $hook );
|
58 |
|
59 |
+
forminator_print_front_styles();
|
60 |
+
forminator_print_front_scripts();
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
admin/pages/entries-page.php
CHANGED
@@ -49,16 +49,16 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
49 |
*/
|
50 |
public function populate_modules() {
|
51 |
$modules[] = array(
|
52 |
-
'name' => __( 'Forms',
|
53 |
-
'model' =>
|
54 |
);
|
55 |
$modules[] = array(
|
56 |
-
'name' => __( 'Polls',
|
57 |
-
'model' =>
|
58 |
);
|
59 |
$modules[] = array(
|
60 |
-
'name' => __( 'Quizzes',
|
61 |
-
'model' =>
|
62 |
);
|
63 |
|
64 |
$this->modules = apply_filters( 'forminator_entries_page_modules', $modules );
|
@@ -128,14 +128,14 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
128 |
}
|
129 |
} else {
|
130 |
switch ( $this->get_current_form_type() ) {
|
131 |
-
case
|
132 |
$entries_renderer = new Forminator_CForm_Renderer_Entries( 'custom-form/entries' );
|
133 |
break;
|
134 |
-
case
|
135 |
$entries_renderer = new Forminator_Poll_Renderer_Entries( 'poll/entries' );
|
136 |
break;
|
137 |
-
case
|
138 |
-
$entries_renderer = new
|
139 |
break;
|
140 |
default:
|
141 |
$entries_renderer = null;
|
@@ -145,7 +145,7 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
145 |
if ( $entries_renderer instanceof Forminator_Admin_Page ) {
|
146 |
ob_start();
|
147 |
// render the entries page
|
148 |
-
$entries_renderer->
|
149 |
$this->entries_page = ob_get_clean();
|
150 |
}
|
151 |
}
|
@@ -197,12 +197,12 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
197 |
|
198 |
$empty_option = '';
|
199 |
|
200 |
-
if ( $form_type ===
|
201 |
-
$empty_option = __( 'Choose Form',
|
202 |
-
} elseif ( $form_type ===
|
203 |
-
$empty_option = __( 'Choose Poll',
|
204 |
-
} elseif ( $form_type ===
|
205 |
-
$empty_option = __( 'Choose Quiz',
|
206 |
}
|
207 |
|
208 |
$html .= '<option value="" ' . selected( 0, $form_id, false ) . '>' . $empty_option . '</option>';
|
@@ -232,13 +232,13 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
232 |
switch ( $form_type ) {
|
233 |
case 'forminator_forms':
|
234 |
//TODO: lazy load this
|
235 |
-
$forms =
|
236 |
break;
|
237 |
case 'forminator_polls':
|
238 |
-
$forms =
|
239 |
break;
|
240 |
case 'forminator_quizzes':
|
241 |
-
$forms =
|
242 |
break;
|
243 |
default:
|
244 |
$forms = array();
|
@@ -303,12 +303,12 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
303 |
'%s': [moment().startOf('month'), moment().endOf('month')],
|
304 |
'%s': [moment().subtract(1,'month').startOf('month'), moment().subtract(1,'month').endOf('month')]
|
305 |
};",
|
306 |
-
__( 'Today',
|
307 |
-
__( 'Yesterday',
|
308 |
-
__( 'Last 7 Days',
|
309 |
-
__( 'Last 30 Days',
|
310 |
-
__( 'This Month',
|
311 |
-
__( 'Last Month',
|
312 |
);
|
313 |
|
314 |
/**
|
@@ -364,10 +364,7 @@ class Forminator_Entries_Page extends Forminator_Admin_Page {
|
|
364 |
public function enqueue_scripts( $hook ) {
|
365 |
parent::enqueue_scripts( $hook );
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
forminator_print_front_styles( FORMINATOR_VERSION );
|
370 |
-
|
371 |
-
forminator_print_front_scripts( FORMINATOR_VERSION );
|
372 |
}
|
373 |
}
|
49 |
*/
|
50 |
public function populate_modules() {
|
51 |
$modules[] = array(
|
52 |
+
'name' => __( 'Forms', 'forminator' ),
|
53 |
+
'model' => Forminator_Form_Model::model(),
|
54 |
);
|
55 |
$modules[] = array(
|
56 |
+
'name' => __( 'Polls', 'forminator' ),
|
57 |
+
'model' => Forminator_Poll_Model::model(),
|
58 |
);
|
59 |
$modules[] = array(
|
60 |
+
'name' => __( 'Quizzes', 'forminator' ),
|
61 |
+
'model' => Forminator_Quiz_Model::model(),
|
62 |
);
|
63 |
|
64 |
$this->modules = apply_filters( 'forminator_entries_page_modules', $modules );
|
128 |
}
|
129 |
} else {
|
130 |
switch ( $this->get_current_form_type() ) {
|
131 |
+
case Forminator_Form_Model::model()->get_post_type():
|
132 |
$entries_renderer = new Forminator_CForm_Renderer_Entries( 'custom-form/entries' );
|
133 |
break;
|
134 |
+
case Forminator_Poll_Model::model()->get_post_type():
|
135 |
$entries_renderer = new Forminator_Poll_Renderer_Entries( 'poll/entries' );
|
136 |
break;
|
137 |
+
case Forminator_Quiz_Model::model()->get_post_type():
|
138 |
+
$entries_renderer = new Forminator_Quiz_Renderer_Entries( 'quiz/entries' );
|
139 |
break;
|
140 |
default:
|
141 |
$entries_renderer = null;
|
145 |
if ( $entries_renderer instanceof Forminator_Admin_Page ) {
|
146 |
ob_start();
|
147 |
// render the entries page
|
148 |
+
$entries_renderer->render_page_content();
|
149 |
$this->entries_page = ob_get_clean();
|
150 |
}
|
151 |
}
|
197 |
|
198 |
$empty_option = '';
|
199 |
|
200 |
+
if ( $form_type === Forminator_Form_Model::model()->get_post_type() ) {
|
201 |
+
$empty_option = __( 'Choose Form', 'forminator' );
|
202 |
+
} elseif ( $form_type === Forminator_Poll_Model::model()->get_post_type() ) {
|
203 |
+
$empty_option = __( 'Choose Poll', 'forminator' );
|
204 |
+
} elseif ( $form_type === Forminator_Quiz_Model::model()->get_post_type() ) {
|
205 |
+
$empty_option = __( 'Choose Quiz', 'forminator' );
|
206 |
}
|
207 |
|
208 |
$html .= '<option value="" ' . selected( 0, $form_id, false ) . '>' . $empty_option . '</option>';
|
232 |
switch ( $form_type ) {
|
233 |
case 'forminator_forms':
|
234 |
//TODO: lazy load this
|
235 |
+
$forms = Forminator_Form_Model::model()->get_models( 99 );
|
236 |
break;
|
237 |
case 'forminator_polls':
|
238 |
+
$forms = Forminator_Poll_Model::model()->get_models( 99 );
|
239 |
break;
|
240 |
case 'forminator_quizzes':
|
241 |
+
$forms = Forminator_Quiz_Model::model()->get_models( 99 );
|
242 |
break;
|
243 |
default:
|
244 |
$forms = array();
|
303 |
'%s': [moment().startOf('month'), moment().endOf('month')],
|
304 |
'%s': [moment().subtract(1,'month').startOf('month'), moment().subtract(1,'month').endOf('month')]
|
305 |
};",
|
306 |
+
__( 'Today', 'forminator' ),
|
307 |
+
__( 'Yesterday', 'forminator' ),
|
308 |
+
__( 'Last 7 Days', 'forminator' ),
|
309 |
+
__( 'Last 30 Days', 'forminator' ),
|
310 |
+
__( 'This Month', 'forminator' ),
|
311 |
+
__( 'Last Month', 'forminator' )
|
312 |
);
|
313 |
|
314 |
/**
|
364 |
public function enqueue_scripts( $hook ) {
|
365 |
parent::enqueue_scripts( $hook );
|
366 |
|
367 |
+
forminator_print_front_styles();
|
368 |
+
forminator_print_front_scripts();
|
|
|
|
|
|
|
369 |
}
|
370 |
}
|
admin/pages/integrations-page.php
CHANGED
@@ -85,7 +85,7 @@ class Forminator_Integrations_Page extends Forminator_Admin_Page {
|
|
85 |
<div class="sui-actions-right">
|
86 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
87 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#integrations" target="_blank" class="sui-button sui-button-ghost">
|
88 |
-
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation',
|
89 |
</a>
|
90 |
<?php endif; ?>
|
91 |
</div>
|
85 |
<div class="sui-actions-right">
|
86 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
87 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#integrations" target="_blank" class="sui-button sui-button-ghost">
|
88 |
+
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', 'forminator' ); ?>
|
89 |
</a>
|
90 |
<?php endif; ?>
|
91 |
</div>
|
admin/views/boxes/content-box.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<div id="forminator-content-box-<?php echo esc_attr( $template_class ); ?>" class="wpmudev-box">
|
2 |
-
<?php if ( is_callable( $header_callback ) ) : ?>
|
3 |
-
<div class="wpmudev-box-header">
|
4 |
-
<?php call_user_func( $header_callback ); ?>
|
5 |
-
</div><!-- end content box header -->
|
6 |
-
<?php elseif ( $this->template_exists( $template_id . '/content-header' ) ) : ?>
|
7 |
-
<div class="wpmudev-box-header">
|
8 |
-
<?php $this->template( $template_id . '/content-header', array( 'title' => $title ) ); ?>
|
9 |
-
</div><!-- end content box header -->
|
10 |
-
<?php elseif ( $this->template_exists( $template_id . '-content-header' ) ) : ?>
|
11 |
-
<div class="wpmudev-box-header">
|
12 |
-
<?php $this->template( $template_id . '-content-header', array( 'title' => $title ) ); ?>
|
13 |
-
</div><!-- end content box header -->
|
14 |
-
<?php elseif ( $title ) : ?>
|
15 |
-
<div class="wpmudev-box-header">
|
16 |
-
<h2 class="wpmudev-box-title--alt"><?php echo esc_html( $title ); ?></h2>
|
17 |
-
</div><!-- end content box header -->
|
18 |
-
<?php endif; ?>
|
19 |
-
|
20 |
-
<div class="wpmudev-box-section">
|
21 |
-
<?php if ( is_callable( $main_callback ) ) : ?>
|
22 |
-
<?php call_user_func( $main_callback ); ?>
|
23 |
-
<?php elseif ( $this->template_exists( $template_id . '/content' ) ) : ?>
|
24 |
-
<?php $this->template( $template_id . '/content' ); ?>
|
25 |
-
<?php else : ?>
|
26 |
-
<?php $this->template( $template_id . '-content' ); ?>
|
27 |
-
<?php endif; ?>
|
28 |
-
</div><!-- end content box content -->
|
29 |
-
|
30 |
-
<?php if ( is_callable( $footer_callback ) ) : ?>
|
31 |
-
<div class="wpmudev-box-footer">
|
32 |
-
<?php call_user_func( $footer_callback ); ?>
|
33 |
-
</div><!-- end content box footer -->
|
34 |
-
<?php elseif ( $this->template_exists( $template_id . '/content-footer' ) ) : ?>
|
35 |
-
<div class="wpmudev-box-footer">
|
36 |
-
<?php $this->template( $template_id . '/content-footer' ); ?>
|
37 |
-
</div><!-- end content box footer -->
|
38 |
-
<?php elseif ( $this->template_exists( $template_id . '-content-footer' ) ) : ?>
|
39 |
-
<div class="wpmudev-box-footer">
|
40 |
-
<?php $this->template( $template_id . '-content-footer' ); ?>
|
41 |
-
</div><!-- end content box footer -->
|
42 |
-
<?php endif; ?>
|
43 |
-
</div><!-- end content box-<?php echo esc_attr( $template_class ); ?> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/boxes/popup-box.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php $icon_close = forminator_plugin_dir() . 'assets/icons/admin-icons/close.php'; ?>
|
2 |
-
|
3 |
-
<div id="forminator-modal-<?php echo esc_attr( $template_class ); ?>" class="wpmudev-modal <?php echo esc_attr( $template_class ); ?>">
|
4 |
-
|
5 |
-
<div class="wpmudev-modal-mask" aria-hidden="true"></div>
|
6 |
-
|
7 |
-
<div class="wpmudev-box-modal">
|
8 |
-
|
9 |
-
<div class="wpmudev-box-header">
|
10 |
-
|
11 |
-
<div class="wpmudev-header--text">
|
12 |
-
|
13 |
-
<h2 class="wpmudev-subtitle"><?php echo esc_html( $title ); ?></h2>
|
14 |
-
|
15 |
-
</div>
|
16 |
-
|
17 |
-
<div class="wpmudev-header--action">
|
18 |
-
|
19 |
-
<button class="wpmudev-box--action"><?php require $icon_close; ?></button>
|
20 |
-
|
21 |
-
<button class="wpmudev-sr-only"><?php esc_html_e( 'Close modal', Forminator::DOMAIN ); ?></button>
|
22 |
-
|
23 |
-
</div>
|
24 |
-
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<div class="wpmudev-box-body">
|
28 |
-
<?php if ( is_callable( $main_callback ) ) : ?>
|
29 |
-
<?php call_user_func( $main_callback ); ?>
|
30 |
-
<?php elseif ( $this->template_exists( $template_id . '/content' ) ) : ?>
|
31 |
-
<?php $this->template( $template_id . '/content' ); ?>
|
32 |
-
<?php else : ?>
|
33 |
-
<?php $this->template( $template_id . '-content' ); ?>
|
34 |
-
<?php endif; ?>
|
35 |
-
</div>
|
36 |
-
|
37 |
-
</div>
|
38 |
-
|
39 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/common/dashboard/widget.php
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$_per_page = forminator_form_view_per_page();
|
3 |
+
$module_type = forminator_get_prefix( $module_slug, 'c' );
|
4 |
+
$export_dialog = 'export_' . $module_type;
|
5 |
+
$preview_dialog = 'preview_' . forminator_get_prefix( $module_slug, 'c', false, true );
|
6 |
+
$create_dialog = forminator_get_prefix( $module_slug, 'custom_', false, true );
|
7 |
+
$dashboard_settings = forminator_get_dashboard_settings( forminator_get_prefix( $module_slug, '', false, true ), array() );
|
8 |
+
$num_recent = isset( $dashboard_settings['num_recent'] ) ? $dashboard_settings['num_recent'] : 5;
|
9 |
+
$published = isset( $dashboard_settings['published'] ) ? filter_var( $dashboard_settings['published'], FILTER_VALIDATE_BOOLEAN ) : true;
|
10 |
+
$draft = isset( $dashboard_settings['draft'] ) ? filter_var( $dashboard_settings['draft'], FILTER_VALIDATE_BOOLEAN ) : true;
|
11 |
+
$statuses = array();
|
12 |
+
|
13 |
+
if ( $published ) {
|
14 |
+
$statuses[] = Forminator_Base_Form_Model::STATUS_PUBLISH;
|
15 |
+
}
|
16 |
+
|
17 |
+
if ( $draft ) {
|
18 |
+
$statuses[] = Forminator_Base_Form_Model::STATUS_DRAFT;
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( 0 === $num_recent ) {
|
22 |
+
return;
|
23 |
+
}
|
24 |
+
|
25 |
+
$modules = call_user_func( 'forminator_' . $module_slug . '_modules', $num_recent, $statuses );
|
26 |
+
?>
|
27 |
+
|
28 |
+
<div class="sui-box">
|
29 |
+
|
30 |
+
<div class="sui-box-header">
|
31 |
+
|
32 |
+
<h3 class="sui-box-title"><i class="<?php echo esc_attr( $icon ); ?>" aria-hidden="true"></i><?php echo esc_html( $title ); ?></h3>
|
33 |
+
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="sui-box-body">
|
37 |
+
|
38 |
+
<p><?php echo esc_html( $description ); ?></p>
|
39 |
+
|
40 |
+
<?php // Strict comparison is removed for a reason! ?>
|
41 |
+
<?php if ( 0 == $total ) { ?>
|
42 |
+
|
43 |
+
<p><button class="sui-button sui-button-blue wpmudev-open-modal"
|
44 |
+
data-modal="<?php echo esc_attr( $create_dialog ); ?>">
|
45 |
+
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', 'forminator' ); ?>
|
46 |
+
</button></p>
|
47 |
+
|
48 |
+
<?php } ?>
|
49 |
+
|
50 |
+
</div>
|
51 |
+
|
52 |
+
<?php if ( 0 < $total ) { ?>
|
53 |
+
|
54 |
+
<table class="sui-table sui-table-flushed">
|
55 |
+
|
56 |
+
<thead>
|
57 |
+
|
58 |
+
<tr>
|
59 |
+
|
60 |
+
<th><?php esc_html_e( 'Name', 'forminator' ); ?></th>
|
61 |
+
|
62 |
+
<th class="fui-col-status"><?php esc_html_e( 'Status', 'forminator' ); ?></th>
|
63 |
+
|
64 |
+
</tr>
|
65 |
+
|
66 |
+
</thead>
|
67 |
+
|
68 |
+
<tbody>
|
69 |
+
|
70 |
+
<?php
|
71 |
+
foreach ( $modules as $index => $module ) {
|
72 |
+
$page = ceil( ( $index + 1 ) / $_per_page );
|
73 |
+
?>
|
74 |
+
|
75 |
+
<tr>
|
76 |
+
|
77 |
+
<td class="sui-table-item-title"><?php echo esc_html( htmlspecialchars( $module['name'] ) ); ?></td>
|
78 |
+
|
79 |
+
<td class="fui-col-status">
|
80 |
+
|
81 |
+
<?php
|
82 |
+
if ( 'publish' === $module['status'] ) {
|
83 |
+
$status_class = 'published';
|
84 |
+
$status_text = esc_html__( 'Published', 'forminator' );
|
85 |
+
} else {
|
86 |
+
$status_class = 'draft';
|
87 |
+
$status_text = esc_html__( 'Draft', 'forminator' );
|
88 |
+
}
|
89 |
+
// For Quizzes.
|
90 |
+
$has_leads = isset( $module['has_leads'] ) ? $module['has_leads'] : false;
|
91 |
+
$leads_id = isset( $module['leads_id'] ) ? $module['leads_id'] : 0;
|
92 |
+
?>
|
93 |
+
|
94 |
+
<span
|
95 |
+
class="sui-status-dot sui-<?php echo esc_html( $status_class ); ?> sui-tooltip"
|
96 |
+
data-tooltip="<?php echo esc_html( $status_text ); ?>"
|
97 |
+
>
|
98 |
+
<span aria-hidden="true"></span>
|
99 |
+
</span>
|
100 |
+
|
101 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=forminator-' . $module_type . '&view-stats=' . $module['id'] . '&paged=' . $page ) ); ?>"
|
102 |
+
class="sui-button-icon sui-tooltip sui-tooltip-top-right-mobile"
|
103 |
+
data-tooltip="<?php esc_html_e( 'View Stats', 'forminator' ); ?>">
|
104 |
+
<i class="sui-icon-graph-line" aria-hidden="true"></i>
|
105 |
+
</a>
|
106 |
+
|
107 |
+
<div class="sui-dropdown">
|
108 |
+
|
109 |
+
<button class="sui-button-icon sui-dropdown-anchor"
|
110 |
+
aria-expanded="false"
|
111 |
+
aria-label="<?php esc_html_e( 'More options', 'forminator' ); ?>">
|
112 |
+
<i class="sui-icon-widget-settings-config" aria-hidden="true"></i>
|
113 |
+
</button>
|
114 |
+
|
115 |
+
<ul>
|
116 |
+
<li>
|
117 |
+
<?php $wizard_page_prefix = 'quiz' !== $module_type ? $module_type : ( 'nowrong' === $module['type'] ? $module['type'] : 'knowledge' ); ?>
|
118 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=forminator-' . $wizard_page_prefix . '-wizard&id=' . $module['id'] ) ); ?>">
|
119 |
+
<i class="sui-icon-pencil" aria-hidden="true"></i> <?php esc_html_e( 'Edit', 'forminator' ); ?>
|
120 |
+
</a>
|
121 |
+
</li>
|
122 |
+
|
123 |
+
<li><button class="wpmudev-open-modal"
|
124 |
+
data-modal="<?php echo esc_attr( $preview_dialog ); ?>"
|
125 |
+
data-modal-title="<?php echo sprintf( '%s - %s', esc_html( $preview_title ), htmlspecialchars( htmlspecialchars( $module['name'] ) ) ); // phpcs:ignore ?>"
|
126 |
+
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
127 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
128 |
+
data-has-leads="<?php echo esc_attr( $has_leads ); ?>"
|
129 |
+
data-leads-id="<?php echo esc_attr( $leads_id ); ?>"
|
130 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_' . $preview_dialog ) ); ?>">
|
131 |
+
<i class="sui-icon-eye" aria-hidden="true"></i> <?php esc_html_e( 'Preview', 'forminator' ); ?>
|
132 |
+
</button></li>
|
133 |
+
|
134 |
+
<li>
|
135 |
+
<button class="copy-clipboard" data-shortcode='[forminator_<?php echo esc_attr( $module_slug ); ?> id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', 'forminator' ); ?></button>
|
136 |
+
</li>
|
137 |
+
|
138 |
+
<li><a href="<?php echo esc_url( admin_url( 'admin.php?page=forminator-entries&form_type=' . forminator_get_prefix( $module_slug, 'post_type' ) . '&form_id=' . $module['id'] ) ); ?>"><i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', 'forminator' ); ?></a></li>
|
139 |
+
|
140 |
+
<li <?php echo ( $has_leads ) ? 'aria-hidden="true"' : ''; ?>><form method="post">
|
141 |
+
<input type="hidden" name="forminator_action" value="clone">
|
142 |
+
<input type="hidden" name="form_type" value="<?php echo esc_attr( forminator_get_prefix( $module_slug, 'custom-' ) ); ?>">
|
143 |
+
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
144 |
+
<?php
|
145 |
+
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
146 |
+
wp_nonce_field( $clone_nonce, 'forminatorNonce' );
|
147 |
+
?>
|
148 |
+
<?php if ( $has_leads ): ?>
|
149 |
+
<button type="submit" disabled="disabled" class="fui-button-with-tag sui-tooltip sui-tooltip-left sui-constrained" data-tooltip="<?php esc_html_e( 'Duplicate isn\'t supported at the moment for the quizzes with lead capturing enabled.', 'forminator' ); ?>">
|
150 |
+
<span class="sui-icon-page-multiple" aria-hidden="true"></span>
|
151 |
+
<span class="fui-button-label"><?php esc_html_e( 'Duplicate', 'forminator' ); ?></span>
|
152 |
+
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', 'forminator' ); ?></span>
|
153 |
+
</button>
|
154 |
+
<?php else: ?>
|
155 |
+
<button type="submit">
|
156 |
+
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', 'forminator' ); ?>
|
157 |
+
</button>
|
158 |
+
<?php endif; ?>
|
159 |
+
</form></li>
|
160 |
+
|
161 |
+
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
162 |
+
|
163 |
+
<?php if ( $has_leads ): ?>
|
164 |
+
<li aria-hidden="true"><a href="#" class="fui-button-with-tag sui-tooltip sui-tooltip-left"
|
165 |
+
data-tooltip="<?php esc_html_e( 'Export isn\'t supported at the moment for the quizzes with lead capturing enabled.', 'forminator' ); ?>">
|
166 |
+
<span class="sui-icon-cloud-migration" aria-hidden="true"></span>
|
167 |
+
<span class="fui-button-label"><?php esc_html_e( 'Export', 'forminator' ); ?></span>
|
168 |
+
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', 'forminator' ); ?></span>
|
169 |
+
</a></li>
|
170 |
+
<?php else: ?>
|
171 |
+
<li><a href="#"
|
172 |
+
class="wpmudev-open-modal"
|
173 |
+
data-modal="<?php echo esc_attr( $export_dialog ); ?>"
|
174 |
+
data-modal-title=""
|
175 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
176 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_' . $module_slug ) ); ?>">
|
177 |
+
<i class="sui-icon-cloud-migration" aria-hidden="true"></i> <?php esc_html_e( 'Export', 'forminator' ); ?>
|
178 |
+
</a></li>
|
179 |
+
<?php endif; ?>
|
180 |
+
|
181 |
+
<?php endif; ?>
|
182 |
+
|
183 |
+
<li>
|
184 |
+
<button class="wpmudev-open-modal"
|
185 |
+
data-modal="delete-module"
|
186 |
+
data-modal-title="<?php echo esc_attr( $delete_title ); ?>"
|
187 |
+
data-modal-content="<?php echo esc_attr( $delete_description ); ?>"
|
188 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
189 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_' . $module_slug . '_request' ) ); ?>">
|
190 |
+
<i class="sui-icon-trash" aria-hidden="true"></i> <?php esc_html_e( 'Delete', 'forminator' ); ?>
|
191 |
+
</button>
|
192 |
+
</li>
|
193 |
+
|
194 |
+
</ul>
|
195 |
+
|
196 |
+
</div>
|
197 |
+
|
198 |
+
</td>
|
199 |
+
|
200 |
+
</tr>
|
201 |
+
|
202 |
+
<?php } ?>
|
203 |
+
|
204 |
+
</tbody>
|
205 |
+
|
206 |
+
</table>
|
207 |
+
|
208 |
+
<div class="sui-box-footer">
|
209 |
+
|
210 |
+
<button class="sui-button sui-button-blue wpmudev-open-modal forminator-create-<?php echo esc_attr( $module_slug ); ?>"
|
211 |
+
data-modal="<?php echo esc_attr( $create_dialog ); ?>">
|
212 |
+
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', 'forminator' ); ?>
|
213 |
+
</button>
|
214 |
+
|
215 |
+
<div class="sui-actions-right">
|
216 |
+
<p class="sui-description"><a href="<?php echo admin_url( 'admin.php?page=forminator-' . $module_type ); // phpcs:ignore ?>" class="sui-link-gray"><?php echo esc_html( $view_all ); ?></a></p>
|
217 |
+
</div>
|
218 |
+
|
219 |
+
</div>
|
220 |
+
|
221 |
+
<?php } ?>
|
222 |
+
|
223 |
+
</div>
|
admin/views/common/entries/active_filters_row.php
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="sui-box-body fui-box-actions-filters">
|
2 |
+
|
3 |
+
<label class="sui-label"><?php esc_html_e( 'Active Filters', 'forminator' ); ?></label>
|
4 |
+
|
5 |
+
<div class="sui-pagination-active-filters forminator-entries-fields-filters">
|
6 |
+
|
7 |
+
<?php if ( isset( $this->filters['search'] ) ) : ?>
|
8 |
+
<div class="sui-active-filter">
|
9 |
+
<?php
|
10 |
+
printf(/* translators: ... */
|
11 |
+
esc_html__( 'Keyword: %s', 'forminator' ),
|
12 |
+
esc_html( $this->filters['search'] )
|
13 |
+
);
|
14 |
+
?>
|
15 |
+
<button class="sui-active-filter-remove" type="submit" name="search" value="">
|
16 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', 'forminator' ); ?></span>
|
17 |
+
</button>
|
18 |
+
</div>
|
19 |
+
<?php endif; ?>
|
20 |
+
|
21 |
+
<?php if ( isset( $this->filters['min_id'] ) ) : ?>
|
22 |
+
<div class="sui-active-filter">
|
23 |
+
<?php
|
24 |
+
printf(/* translators: ... */
|
25 |
+
esc_html__( 'From ID: %s', 'forminator' ),
|
26 |
+
esc_html( $this->filters['min_id'] )
|
27 |
+
);
|
28 |
+
?>
|
29 |
+
<button class="sui-active-filter-remove" type="submit" name="min_id" value="">
|
30 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', 'forminator' ); ?></span>
|
31 |
+
</button>
|
32 |
+
</div>
|
33 |
+
<?php endif; ?>
|
34 |
+
|
35 |
+
<?php if ( isset( $this->filters['max_id'] ) ) : ?>
|
36 |
+
<div class="sui-active-filter">
|
37 |
+
<?php
|
38 |
+
printf(/* translators: ... */
|
39 |
+
esc_html__( 'To ID: %s', 'forminator' ),
|
40 |
+
esc_html( $this->filters['max_id'] )
|
41 |
+
);
|
42 |
+
?>
|
43 |
+
<button class="sui-active-filter-remove" type="submit" name="max_id" value="">
|
44 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', 'forminator' ); ?></span>
|
45 |
+
</button>
|
46 |
+
</div>
|
47 |
+
<?php endif; ?>
|
48 |
+
|
49 |
+
<?php if ( isset( $this->filters['date_created'][0] ) || isset( $this->filters['date_created'][1] ) ) : ?>
|
50 |
+
<div class="sui-active-filter">
|
51 |
+
<?php
|
52 |
+
printf(/* translators: ... */
|
53 |
+
esc_html__( 'Submission Date Range: %1$s to %2$s', 'forminator' ),
|
54 |
+
esc_html( $this->filters['date_created'][0] ),
|
55 |
+
esc_html( $this->filters['date_created'][1] )
|
56 |
+
);
|
57 |
+
?>
|
58 |
+
<button class="sui-active-filter-remove" type="submit" name="date_range" value="">
|
59 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', 'forminator' ); ?></span>
|
60 |
+
</button>
|
61 |
+
</div>
|
62 |
+
<?php endif; ?>
|
63 |
+
|
64 |
+
<div class="sui-active-filter">
|
65 |
+
<?php
|
66 |
+
esc_html_e( 'Sort Order', 'forminator' );
|
67 |
+
echo ': ';
|
68 |
+
if ( 'DESC' === $this->order['order'] ) {
|
69 |
+
esc_html_e( 'Descending', 'forminator' );
|
70 |
+
} else {
|
71 |
+
esc_html_e( 'Ascending', 'forminator' );
|
72 |
+
}
|
73 |
+
?>
|
74 |
+
</div>
|
75 |
+
|
76 |
+
</div>
|
77 |
+
|
78 |
+
</div>
|
admin/views/common/entries/content-none.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="sui-box sui-message">
|
2 |
+
|
3 |
+
<?php if ( forminator_is_show_branding() ) : ?>
|
4 |
+
<img src="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?>"
|
5 |
+
srcset="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?> 1x, <?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions@2x.png' ); ?> 2x"
|
6 |
+
alt="<?php esc_html_e( 'Forminator', 'forminator' ); ?>"
|
7 |
+
class="sui-image"
|
8 |
+
aria-hidden="true"/>
|
9 |
+
<?php endif; ?>
|
10 |
+
|
11 |
+
<div class="sui-message-content">
|
12 |
+
|
13 |
+
<h2>
|
14 |
+
<?php
|
15 |
+
if ( empty( $none_title ) ) {
|
16 |
+
echo forminator_get_form_name( $this->form_id ); // phpcs:ignore
|
17 |
+
} else {
|
18 |
+
echo esc_html( $none_title );
|
19 |
+
}
|
20 |
+
?>
|
21 |
+
</h2>
|
22 |
+
|
23 |
+
<p>
|
24 |
+
<?php
|
25 |
+
if ( empty( $none_text ) ) {
|
26 |
+
printf( esc_html__( 'You haven’t received any submissions for this %s yet. When you do, you’ll be able to view all the data here.', 'forminator' ), esc_html( static::$module_slug ) );
|
27 |
+
} else {
|
28 |
+
echo esc_html( $none_text );
|
29 |
+
}
|
30 |
+
?>
|
31 |
+
</p>
|
32 |
+
|
33 |
+
</div>
|
34 |
+
|
35 |
+
</div>
|
admin/views/{entries → common/entries}/content.php
RENAMED
@@ -44,10 +44,10 @@ $count = Forminator_Form_Entry_Model::count_all_entries();
|
|
44 |
|
45 |
</div>
|
46 |
|
47 |
-
<button class="sui-button sui-button-blue show-submissions" onclick="submit()"><?php esc_html_e( 'Show Submissions',
|
48 |
|
49 |
<?php if ( $markup ) : ?>
|
50 |
-
<a href="/" class="sui-button sui-button-ghost wpmudev-open-modal" data-modal="exports-schedule"><i class="sui-icon-paperclip" aria-hidden="true"></i> <?php esc_html_e( 'Export',
|
51 |
<?php endif; ?>
|
52 |
|
53 |
</div>
|
@@ -65,15 +65,15 @@ $count = Forminator_Form_Entry_Model::count_all_entries();
|
|
65 |
<?php if ( forminator_is_show_branding() ) : ?>
|
66 |
<img src="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled.png' ); ?>"
|
67 |
srcset="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled.png' ); ?> 1x, <?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled@2x.png' ); ?> 2x"
|
68 |
-
alt="<?php esc_html_e( 'Forminator',
|
69 |
class="sui-image"/>
|
70 |
<?php endif; ?>
|
71 |
|
72 |
<div class="sui-message-content">
|
73 |
|
74 |
-
<h2><?php esc_html_e( 'Almost there!',
|
75 |
|
76 |
-
<p><?php esc_html_e( 'Select the form, poll or quiz module to view the corresponding submissions.',
|
77 |
|
78 |
</div>
|
79 |
|
@@ -81,25 +81,10 @@ $count = Forminator_Form_Entry_Model::count_all_entries();
|
|
81 |
|
82 |
<?php endif; ?>
|
83 |
|
84 |
-
<?php
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
<?php if ( forminator_is_show_branding() ) : ?>
|
89 |
-
<img src="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?>"
|
90 |
-
srcset="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?> 1x, <?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions@2x.png' ); ?> 2x"
|
91 |
-
alt="<?php esc_html_e( 'Forminator', Forminator::DOMAIN ); ?>"
|
92 |
-
class="sui-image"/>
|
93 |
-
<?php endif; ?>
|
94 |
-
|
95 |
-
<div class="sui-message-content">
|
96 |
-
|
97 |
-
<h2><?php esc_html_e( 'Submissions', Forminator::DOMAIN ); ?></h2>
|
98 |
-
|
99 |
-
<p><?php esc_html_e( 'You haven’t received any form, poll or quiz submissions yet. When you do, you’ll be able to view all the data here.', Forminator::DOMAIN ); ?></p>
|
100 |
-
|
101 |
-
</div>
|
102 |
-
|
103 |
-
</div>
|
104 |
|
105 |
-
|
|
44 |
|
45 |
</div>
|
46 |
|
47 |
+
<button class="sui-button sui-button-blue show-submissions" onclick="submit()"><?php esc_html_e( 'Show Submissions', 'forminator' ); ?></button>
|
48 |
|
49 |
<?php if ( $markup ) : ?>
|
50 |
+
<a href="/" class="sui-button sui-button-ghost wpmudev-open-modal" data-modal="exports-schedule"><i class="sui-icon-paperclip" aria-hidden="true"></i> <?php esc_html_e( 'Export', 'forminator' ); ?></a>
|
51 |
<?php endif; ?>
|
52 |
|
53 |
</div>
|
65 |
<?php if ( forminator_is_show_branding() ) : ?>
|
66 |
<img src="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled.png' ); ?>"
|
67 |
srcset="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled.png' ); ?> 1x, <?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-disabled@2x.png' ); ?> 2x"
|
68 |
+
alt="<?php esc_html_e( 'Forminator', 'forminator' ); ?>"
|
69 |
class="sui-image"/>
|
70 |
<?php endif; ?>
|
71 |
|
72 |
<div class="sui-message-content">
|
73 |
|
74 |
+
<h2><?php esc_html_e( 'Almost there!', 'forminator' ); ?></h2>
|
75 |
|
76 |
+
<p><?php esc_html_e( 'Select the form, poll or quiz module to view the corresponding submissions.', 'forminator' ); ?></p>
|
77 |
|
78 |
</div>
|
79 |
|
81 |
|
82 |
<?php endif; ?>
|
83 |
|
84 |
+
<?php
|
85 |
+
} else {
|
86 |
+
$none_title = esc_html__( 'Submissions', 'forminator' );
|
87 |
+
$none_text = esc_html__( 'You haven’t received any form, poll or quiz submissions yet. When you do, you’ll be able to view all the data here.', 'forminator' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
+
include_once forminator_plugin_dir() . 'admin/views/common/entries/content-none.php';
|
90 |
+
}
|
admin/views/{quiz → common}/entries/filter.php
RENAMED
@@ -5,6 +5,7 @@
|
|
5 |
|
6 |
/** @var $this Forminator_CForm_View_Page */
|
7 |
$is_filter_enabled = $this->is_filter_box_enabled();
|
|
|
8 |
$date_range = '';
|
9 |
$date_created = isset( $this->filters['date_created'] ) ? $this->filters['date_created'] : '';
|
10 |
if ( is_array( $date_created ) && isset( $date_created[0] ) && isset( $date_created[1] ) ) {
|
@@ -18,6 +19,30 @@ $max_id = isset( $this->filters['max_id'] ) ? $this->filters['max_id'] :
|
|
18 |
$order_by = isset( $this->order['order_by'] ) ? $this->order['order_by'] : '';
|
19 |
$order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
20 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
<div class="sui-pagination-filter <?php echo( $is_filter_enabled ? 'sui-open' : '' ); ?>">
|
22 |
|
23 |
<div class="sui-row">
|
@@ -26,12 +51,12 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
26 |
|
27 |
<div class="sui-form-field">
|
28 |
|
29 |
-
<label for="forminator-forms-filter--by-date" class="sui-label"><?php esc_html_e( 'Submission Date Range',
|
30 |
|
31 |
<div class="sui-date">
|
32 |
<i class="sui-icon-calendar" aria-hidden="true"></i>
|
33 |
<input type="text"
|
34 |
-
placeholder="<?php esc_html_e( 'Pick a date range',
|
35 |
id="forminator-forms-filter--by-date"
|
36 |
name="date_range"
|
37 |
autocomplete="off"
|
@@ -45,12 +70,12 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
45 |
|
46 |
<div class="sui-col-md-3">
|
47 |
|
48 |
-
<label for="forminator-forms-filter--from-id" class="sui-label"><?php esc_html_e( 'From ID',
|
49 |
<input type="number"
|
50 |
name="min_id"
|
51 |
min="0"
|
52 |
value="<?php echo esc_attr( $min_id ); ?>"
|
53 |
-
placeholder="<?php esc_html_e( 'E.g. 100',
|
54 |
id="forminator-forms-filter--from-id"
|
55 |
class="sui-form-control"/>
|
56 |
|
@@ -58,12 +83,12 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
58 |
|
59 |
<div class="sui-col-md-3">
|
60 |
|
61 |
-
<label for="forminator-forms-filter--to-id" class="sui-label"><?php esc_html_e( 'To ID',
|
62 |
<input type="number"
|
63 |
name="max_id"
|
64 |
min="0"
|
65 |
value="<?php echo esc_attr( $max_id ); ?>"
|
66 |
-
placeholder="<?php esc_html_e( 'E.g. 100',
|
67 |
id="forminator-forms-filte--to-id"
|
68 |
class="sui-form-control"/>
|
69 |
|
@@ -77,14 +102,14 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
77 |
|
78 |
<div class="sui-form-field">
|
79 |
|
80 |
-
<label for="forminator-forms-filter--by-keyword" class="sui-label"><?php esc_html_e( 'Keyword',
|
81 |
|
82 |
<div class="sui-control-with-icon">
|
83 |
<i class="sui-icon-magnifying-glass-search" aria-hidden="true"></i>
|
84 |
<input type="text"
|
85 |
name="search"
|
86 |
value="<?php echo esc_attr( $search_filter ); ?>"
|
87 |
-
placeholder="<?php esc_html_e( 'E.g. search',
|
88 |
id="forminator-forms-filter--by-keyword"
|
89 |
class="sui-form-control"/>
|
90 |
</div>
|
@@ -95,20 +120,20 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
95 |
|
96 |
<div class="sui-col-md-3">
|
97 |
|
98 |
-
<label for="forminator-forms-filter--sort-by" class="sui-label"><?php esc_html_e( 'Sort by',
|
99 |
<select id="forminator-forms-filter--sort-by" name="order_by">
|
100 |
-
<!-- <option value="">--><?php //esc_html_e( 'ID',
|
101 |
-
<option value="entries.date_created" <?php selected( 'entries.date_created', $order_by ); ?> ><?php esc_html_e( 'Submissions Date',
|
102 |
</select>
|
103 |
|
104 |
</div>
|
105 |
|
106 |
<div class="sui-col-md-3">
|
107 |
|
108 |
-
<label for="forminator-forms-filter--sort-order" class="sui-label"><?php esc_html_e( 'Sort Order',
|
109 |
<select id="forminator-forms-filter--sort-order" name="order">
|
110 |
-
<option value="DESC" <?php selected( 'DESC', $order_filter ); ?>><?php esc_html_e( 'Descending',
|
111 |
-
<option value="ASC" <?php selected( 'ASC', $order_filter ); ?>><?php esc_html_e( 'Ascending',
|
112 |
</select>
|
113 |
|
114 |
</div>
|
@@ -117,7 +142,7 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
117 |
|
118 |
<div class="sui-form-field">
|
119 |
|
120 |
-
<label class="sui-label"><?php esc_html_e( 'Display Fields',
|
121 |
|
122 |
<div class="sui-side-tabs forminator-field-select-tab">
|
123 |
|
@@ -128,7 +153,7 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
128 |
name="fields_select"
|
129 |
id="forminator-forms-filter--display-false"
|
130 |
value="false"/>
|
131 |
-
<?php esc_html_e( 'All',
|
132 |
</label>
|
133 |
|
134 |
<label for="forminator-forms-filter--display-true" class="sui-tab-item <?php echo ( $this->fields_is_filtered ? 'active' : '' ); ?>" data-tab-index="2">
|
@@ -136,7 +161,7 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
136 |
name="fields_select"
|
137 |
id="forminator-forms-filter--display-true"
|
138 |
value="true"/>
|
139 |
-
<?php esc_html_e( 'Specified Fields',
|
140 |
</label>
|
141 |
|
142 |
</div>
|
@@ -150,7 +175,7 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
150 |
<fieldset class="forminator-entries-fields-filter" <?php echo ( $this->fields_is_filtered ? '' : 'disabled=disabled' ); ?>>
|
151 |
<?php
|
152 |
$ignored_field_types = Forminator_Form_Entry_Model::ignored_fields();
|
153 |
-
$fields = apply_filters( 'forminator_custom_form_filter_fields', $
|
154 |
|
155 |
foreach ( $fields as $field ) {
|
156 |
|
@@ -195,10 +220,10 @@ $order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
|
195 |
|
196 |
<div class="sui-filter-footer">
|
197 |
|
198 |
-
<button class="sui-button sui-button-ghost forminator-entries-clear-filter"><?php esc_html_e( 'Clear Filters',
|
199 |
|
200 |
<div class="sui-actions-right">
|
201 |
-
<button class="sui-button forminator-entries-apply-filter" type="submit"><?php esc_html_e( 'Apply',
|
202 |
</div>
|
203 |
|
204 |
</div>
|
5 |
|
6 |
/** @var $this Forminator_CForm_View_Page */
|
7 |
$is_filter_enabled = $this->is_filter_box_enabled();
|
8 |
+
$count = $this->filtered_total_entries();
|
9 |
$date_range = '';
|
10 |
$date_created = isset( $this->filters['date_created'] ) ? $this->filters['date_created'] : '';
|
11 |
if ( is_array( $date_created ) && isset( $date_created[0] ) && isset( $date_created[1] ) ) {
|
19 |
$order_by = isset( $this->order['order_by'] ) ? $this->order['order_by'] : '';
|
20 |
$order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
21 |
?>
|
22 |
+
<div class="sui-box-search">
|
23 |
+
|
24 |
+
<div class="sui-search-left">
|
25 |
+
|
26 |
+
<?php $this->bulk_actions(); ?>
|
27 |
+
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<div class="sui-search-right">
|
31 |
+
|
32 |
+
<div class="sui-pagination-wrap">
|
33 |
+
|
34 |
+
<?php $this->paginate(); ?>
|
35 |
+
|
36 |
+
<button class="sui-button-icon sui-button-outlined forminator-toggle-entries-filter <?php echo( $is_filter_enabled ? 'sui-active' : '' ); ?>">
|
37 |
+
<i class="sui-icon-filter" aria-hidden="true"></i>
|
38 |
+
</button>
|
39 |
+
|
40 |
+
</div>
|
41 |
+
|
42 |
+
</div>
|
43 |
+
|
44 |
+
</div>
|
45 |
+
|
46 |
<div class="sui-pagination-filter <?php echo( $is_filter_enabled ? 'sui-open' : '' ); ?>">
|
47 |
|
48 |
<div class="sui-row">
|
51 |
|
52 |
<div class="sui-form-field">
|
53 |
|
54 |
+
<label for="forminator-forms-filter--by-date" class="sui-label"><?php esc_html_e( 'Submission Date Range', 'forminator' ); ?></label>
|
55 |
|
56 |
<div class="sui-date">
|
57 |
<i class="sui-icon-calendar" aria-hidden="true"></i>
|
58 |
<input type="text"
|
59 |
+
placeholder="<?php esc_html_e( 'Pick a date range', 'forminator' ); ?>"
|
60 |
id="forminator-forms-filter--by-date"
|
61 |
name="date_range"
|
62 |
autocomplete="off"
|
70 |
|
71 |
<div class="sui-col-md-3">
|
72 |
|
73 |
+
<label for="forminator-forms-filter--from-id" class="sui-label"><?php esc_html_e( 'From ID', 'forminator' ); ?></label>
|
74 |
<input type="number"
|
75 |
name="min_id"
|
76 |
min="0"
|
77 |
value="<?php echo esc_attr( $min_id ); ?>"
|
78 |
+
placeholder="<?php esc_html_e( 'E.g. 100', 'forminator' ); ?>"
|
79 |
id="forminator-forms-filter--from-id"
|
80 |
class="sui-form-control"/>
|
81 |
|
83 |
|
84 |
<div class="sui-col-md-3">
|
85 |
|
86 |
+
<label for="forminator-forms-filter--to-id" class="sui-label"><?php esc_html_e( 'To ID', 'forminator' ); ?></label>
|
87 |
<input type="number"
|
88 |
name="max_id"
|
89 |
min="0"
|
90 |
value="<?php echo esc_attr( $max_id ); ?>"
|
91 |
+
placeholder="<?php esc_html_e( 'E.g. 100', 'forminator' ); ?>"
|
92 |
id="forminator-forms-filte--to-id"
|
93 |
class="sui-form-control"/>
|
94 |
|
102 |
|
103 |
<div class="sui-form-field">
|
104 |
|
105 |
+
<label for="forminator-forms-filter--by-keyword" class="sui-label"><?php esc_html_e( 'Keyword', 'forminator' ); ?></label>
|
106 |
|
107 |
<div class="sui-control-with-icon">
|
108 |
<i class="sui-icon-magnifying-glass-search" aria-hidden="true"></i>
|
109 |
<input type="text"
|
110 |
name="search"
|
111 |
value="<?php echo esc_attr( $search_filter ); ?>"
|
112 |
+
placeholder="<?php esc_html_e( 'E.g. search', 'forminator' ); ?>"
|
113 |
id="forminator-forms-filter--by-keyword"
|
114 |
class="sui-form-control"/>
|
115 |
</div>
|
120 |
|
121 |
<div class="sui-col-md-3">
|
122 |
|
123 |
+
<label for="forminator-forms-filter--sort-by" class="sui-label"><?php esc_html_e( 'Sort by', 'forminator' ); ?></label>
|
124 |
<select id="forminator-forms-filter--sort-by" name="order_by">
|
125 |
+
<!-- <option value="">--><?php //esc_html_e( 'ID', 'forminator' ); ?><!--</option>-->
|
126 |
+
<option value="entries.date_created" <?php selected( 'entries.date_created', $order_by ); ?> ><?php esc_html_e( 'Submissions Date', 'forminator' ); ?></option>
|
127 |
</select>
|
128 |
|
129 |
</div>
|
130 |
|
131 |
<div class="sui-col-md-3">
|
132 |
|
133 |
+
<label for="forminator-forms-filter--sort-order" class="sui-label"><?php esc_html_e( 'Sort Order', 'forminator' ); ?></label>
|
134 |
<select id="forminator-forms-filter--sort-order" name="order">
|
135 |
+
<option value="DESC" <?php selected( 'DESC', $order_filter ); ?>><?php esc_html_e( 'Descending', 'forminator' ); ?></option>
|
136 |
+
<option value="ASC" <?php selected( 'ASC', $order_filter ); ?>><?php esc_html_e( 'Ascending', 'forminator' ); ?></option>
|
137 |
</select>
|
138 |
|
139 |
</div>
|
142 |
|
143 |
<div class="sui-form-field">
|
144 |
|
145 |
+
<label class="sui-label"><?php esc_html_e( 'Display Fields', 'forminator' ); ?></label>
|
146 |
|
147 |
<div class="sui-side-tabs forminator-field-select-tab">
|
148 |
|
153 |
name="fields_select"
|
154 |
id="forminator-forms-filter--display-false"
|
155 |
value="false"/>
|
156 |
+
<?php esc_html_e( 'All', 'forminator' ); ?>
|
157 |
</label>
|
158 |
|
159 |
<label for="forminator-forms-filter--display-true" class="sui-tab-item <?php echo ( $this->fields_is_filtered ? 'active' : '' ); ?>" data-tab-index="2">
|
161 |
name="fields_select"
|
162 |
id="forminator-forms-filter--display-true"
|
163 |
value="true"/>
|
164 |
+
<?php esc_html_e( 'Specified Fields', 'forminator' ); ?>
|
165 |
</label>
|
166 |
|
167 |
</div>
|
175 |
<fieldset class="forminator-entries-fields-filter" <?php echo ( $this->fields_is_filtered ? '' : 'disabled=disabled' ); ?>>
|
176 |
<?php
|
177 |
$ignored_field_types = Forminator_Form_Entry_Model::ignored_fields();
|
178 |
+
$fields = apply_filters( 'forminator_custom_form_filter_fields', $args['fields'] );
|
179 |
|
180 |
foreach ( $fields as $field ) {
|
181 |
|
220 |
|
221 |
<div class="sui-filter-footer">
|
222 |
|
223 |
+
<button class="sui-button sui-button-ghost forminator-entries-clear-filter"><?php esc_html_e( 'Clear Filters', 'forminator' ); ?></button>
|
224 |
|
225 |
<div class="sui-actions-right">
|
226 |
+
<button class="sui-button forminator-entries-apply-filter" type="submit"><?php esc_html_e( 'Apply', 'forminator' ); ?></button>
|
227 |
</div>
|
228 |
|
229 |
</div>
|
admin/views/{entries → common/entries}/header.php
RENAMED
@@ -1,9 +1,11 @@
|
|
1 |
-
<
|
|
|
2 |
|
3 |
<div class="sui-actions-right">
|
4 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
5 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#submissions" target="_blank" class="sui-button sui-button-ghost">
|
6 |
-
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation',
|
7 |
</a>
|
8 |
<?php endif; ?>
|
9 |
</div>
|
|
1 |
+
<header class="sui-header">
|
2 |
+
<h1 class="sui-header-title"><?php esc_html_e( 'Submissions', 'forminator' ); ?></h1>
|
3 |
|
4 |
<div class="sui-actions-right">
|
5 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
6 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#submissions" target="_blank" class="sui-button sui-button-ghost">
|
7 |
+
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', 'forminator' ); ?>
|
8 |
</a>
|
9 |
<?php endif; ?>
|
10 |
</div>
|
11 |
+
</header>
|
admin/views/{quiz → common}/entries/prompt.php
RENAMED
@@ -1,32 +1,40 @@
|
|
1 |
<?php
|
2 |
if ( ! FORMINATOR_PRO ) {
|
3 |
-
$submission = $
|
4 |
$form_id = $this->form_id;
|
5 |
$notice_success = get_option( 'forminator_rating_success', false );
|
6 |
$notice_dismissed = get_option( 'forminator_rating_dismissed', false );
|
7 |
$submission_later = get_post_meta( $form_id, 'forminator_submission_rating_later' );
|
8 |
$submission_later_dismiss = get_post_meta( $form_id, 'forminator_submission_rating_later_dismiss' );
|
|
|
9 |
if ( ! $notice_dismissed && ! $notice_success ) {
|
10 |
-
if ( (
|
11 |
-
|| ( 100 < $submission && ! $submission_later_dismiss ) ) {
|
12 |
-
$milestone = ( 100 >= $submission ) ? 10 : 100;
|
13 |
-
?>
|
14 |
<div class="forminator-rating-notice sui-notice sui-notice-purple fui-notice-rate<?php echo forminator_is_show_branding() ? '' : ' fui-unbranded'; ?>"
|
15 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
16 |
|
17 |
-
<p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
<p>
|
19 |
<a type="button" href="#" target="_blank"
|
20 |
class="sui-button sui-button-purple"
|
21 |
-
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator',
|
22 |
|
23 |
<button type="button"
|
24 |
class="sui-button sui-button-ghost"
|
25 |
-
data-prop="<?php echo 100 > $submission ? 'forminator_submission_rating_later' : 'forminator_submission_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later',
|
26 |
|
27 |
<a href="#" style="color: #888;"
|
28 |
data-prop="forminator_rating_dismissed"
|
29 |
-
data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks',
|
30 |
</p>
|
31 |
|
32 |
</div>
|
1 |
<?php
|
2 |
if ( ! FORMINATOR_PRO ) {
|
3 |
+
$submission = $args['submissions'];
|
4 |
$form_id = $this->form_id;
|
5 |
$notice_success = get_option( 'forminator_rating_success', false );
|
6 |
$notice_dismissed = get_option( 'forminator_rating_dismissed', false );
|
7 |
$submission_later = get_post_meta( $form_id, 'forminator_submission_rating_later' );
|
8 |
$submission_later_dismiss = get_post_meta( $form_id, 'forminator_submission_rating_later_dismiss' );
|
9 |
+
$min_submissions = isset( $args['min_submissions'] ) ? $args['min_submissions'] : 10;
|
10 |
if ( ! $notice_dismissed && ! $notice_success ) {
|
11 |
+
if ( ( $min_submissions < $submission && 100 >= $submission && ! $submission_later )
|
12 |
+
|| ( 100 < $submission && ! $submission_later_dismiss ) ) { ?>
|
|
|
|
|
13 |
<div class="forminator-rating-notice sui-notice sui-notice-purple fui-notice-rate<?php echo forminator_is_show_branding() ? '' : ' fui-unbranded'; ?>"
|
14 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
15 |
|
16 |
+
<p>
|
17 |
+
<?php
|
18 |
+
if ( empty( $args['notice'] ) ) {
|
19 |
+
$milestone = ( 100 >= $submission ) ? $min_submissions : 100;
|
20 |
+
printf( esc_html__( "Hey, we noticed you just crossed %1\$s submissions%2\$s on this %3\$s - that's awesome! We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", 'forminator' ), '<strong> ' . $milestone, '</strong>', static::$module_slug );
|
21 |
+
} else {
|
22 |
+
echo $args['notice'];
|
23 |
+
}
|
24 |
+
?>
|
25 |
+
</p>
|
26 |
<p>
|
27 |
<a type="button" href="#" target="_blank"
|
28 |
class="sui-button sui-button-purple"
|
29 |
+
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator', 'forminator' ); ?></a>
|
30 |
|
31 |
<button type="button"
|
32 |
class="sui-button sui-button-ghost"
|
33 |
+
data-prop="<?php echo 100 > $submission ? 'forminator_submission_rating_later' : 'forminator_submission_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later', 'forminator' ); ?></button>
|
34 |
|
35 |
<a href="#" style="color: #888;"
|
36 |
data-prop="forminator_rating_dismissed"
|
37 |
+
data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks', 'forminator' ); ?></a>
|
38 |
</p>
|
39 |
|
40 |
</div>
|
admin/views/common/list/chart_script.php
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$days_array = array();
|
3 |
+
$default_array = array();
|
4 |
+
|
5 |
+
for ( $h = 30; $h >= 0; $h-- ) {
|
6 |
+
$time = strtotime( '-' . $h . ' days' );
|
7 |
+
$date = date( 'Y-m-d', $time );//phpcs:ignore
|
8 |
+
$default_array[ $date ] = 0;
|
9 |
+
$days_array[] = date( 'M j, Y', $time );//phpcs:ignore
|
10 |
+
}
|
11 |
+
|
12 |
+
foreach ( $this->getModules() as $module ) {
|
13 |
+
|
14 |
+
if ( 0 === $module['entries'] ) {
|
15 |
+
$submissions_data = $default_array;
|
16 |
+
} else {
|
17 |
+
$submissions = Forminator_Form_Entry_Model::get_form_latest_entries_count_grouped_by_day( $module['id'], $args['start_date'] );
|
18 |
+
$submissions_array = wp_list_pluck( $submissions, 'entries_amount', 'date_created' );
|
19 |
+
$submissions_data = array_merge( $default_array, array_intersect_key( $submissions_array, $default_array ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
// Get highest value
|
23 |
+
$highest_submission = max( $submissions_data );
|
24 |
+
|
25 |
+
// Calculate canvas top spacing
|
26 |
+
$canvas_top_spacing = $highest_submission + 8;
|
27 |
+
?>
|
28 |
+
<script>
|
29 |
+
|
30 |
+
var ctx = document.getElementById( 'forminator-module-<?php echo $module['id']; // phpcs:ignore ?>-stats' );
|
31 |
+
var monthDays = [ '<?php echo implode( "', '", $days_array ); // phpcs:ignore ?>' ],
|
32 |
+
submissions = [ <?php echo implode( ', ', $submissions_data ); // phpcs:ignore ?> ];
|
33 |
+
|
34 |
+
var chartData = {
|
35 |
+
labels: monthDays,
|
36 |
+
datasets: [{
|
37 |
+
label: '<?php esc_html_e( 'Submissions', 'forminator' ); ?>',
|
38 |
+
data: submissions,
|
39 |
+
backgroundColor: [
|
40 |
+
'#E1F6FF'
|
41 |
+
],
|
42 |
+
borderColor: [
|
43 |
+
'#17A8E3'
|
44 |
+
],
|
45 |
+
borderWidth: 2,
|
46 |
+
pointRadius: 0,
|
47 |
+
pointHitRadius: 20,
|
48 |
+
pointHoverRadius: 5,
|
49 |
+
pointHoverBorderColor: '#17A8E3',
|
50 |
+
pointHoverBackgroundColor: '#17A8E3'
|
51 |
+
}]
|
52 |
+
};
|
53 |
+
|
54 |
+
var chartOptions = {
|
55 |
+
maintainAspectRatio: false,
|
56 |
+
legend: {
|
57 |
+
display: false
|
58 |
+
},
|
59 |
+
scales: {
|
60 |
+
xAxes: [{
|
61 |
+
display: false,
|
62 |
+
gridLines: {
|
63 |
+
color: 'rgba(0, 0, 0, 0)'
|
64 |
+
}
|
65 |
+
}],
|
66 |
+
yAxes: [{
|
67 |
+
display: false,
|
68 |
+
gridLines: {
|
69 |
+
color: 'rgba(0, 0, 0, 0)'
|
70 |
+
},
|
71 |
+
ticks: {
|
72 |
+
beginAtZero: false,
|
73 |
+
min: 0,
|
74 |
+
max: <?php echo esc_attr( $canvas_top_spacing ); ?>,
|
75 |
+
stepSize: 1
|
76 |
+
}
|
77 |
+
}]
|
78 |
+
},
|
79 |
+
elements: {
|
80 |
+
line: {
|
81 |
+
tension: 0
|
82 |
+
},
|
83 |
+
point: {
|
84 |
+
radius: 0
|
85 |
+
}
|
86 |
+
},
|
87 |
+
tooltips: {
|
88 |
+
custom: function( tooltip ) {
|
89 |
+
if ( ! tooltip ) return;
|
90 |
+
// disable displaying the color box;
|
91 |
+
tooltip.displayColors = false;
|
92 |
+
},
|
93 |
+
callbacks: {
|
94 |
+
title: function( tooltipItem, data ) {
|
95 |
+
return tooltipItem[0].yLabel + " Submissions";
|
96 |
+
},
|
97 |
+
label: function( tooltipItem, data ) {
|
98 |
+
return tooltipItem.xLabel;
|
99 |
+
},
|
100 |
+
// Set label text color
|
101 |
+
labelTextColor:function( tooltipItem, chart ) {
|
102 |
+
return '#AAAAAA';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
},
|
106 |
+
plugins: {
|
107 |
+
datalabels: {
|
108 |
+
display: false
|
109 |
+
}
|
110 |
+
}
|
111 |
+
};
|
112 |
+
|
113 |
+
if (ctx) {
|
114 |
+
var myChart = new Chart(ctx, {
|
115 |
+
type: 'line',
|
116 |
+
fill: 'start',
|
117 |
+
data: chartData,
|
118 |
+
plugins: [
|
119 |
+
ChartDataLabels
|
120 |
+
],
|
121 |
+
options: chartOptions
|
122 |
+
});
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
</script>
|
127 |
+
<?php
|
128 |
+
// Only for QUizzes.
|
129 |
+
if ( isset( $module['has_leads'] ) && $module['has_leads'] ) {
|
130 |
+
|
131 |
+
if ( ! isset( $module['leads'] ) || 0 === $module['leads'] ) {
|
132 |
+
$submissions_data = $default_array;
|
133 |
+
} else {
|
134 |
+
$submissions = Forminator_Form_Entry_Model::get_form_latest_lead_entries_count_grouped_by_day( $module['id'], $args['start_date'] );
|
135 |
+
$submissions_array = wp_list_pluck( $submissions, 'entries_amount', 'date_created' );
|
136 |
+
$submissions_data = array_merge( $default_array, array_intersect_key( $submissions_array, $default_array ) );
|
137 |
+
}
|
138 |
+
|
139 |
+
// Get highest value.
|
140 |
+
$highest_submission = max( $submissions_data );
|
141 |
+
|
142 |
+
// Calculate canvas top spacing.
|
143 |
+
$canvas_top_spacing = $highest_submission + 8;
|
144 |
+
?>
|
145 |
+
<script>
|
146 |
+
var ctx = document.getElementById( 'forminator-module-<?php echo $module['leads_id']; // phpcs:ignore ?>-stats' );
|
147 |
+
|
148 |
+
var monthDays = [ '<?php echo implode( "', '", $days_array ); // phpcs:ignore ?>' ],
|
149 |
+
submissions = [ <?php echo implode( ', ', $submissions_data ); // phpcs:ignore ?> ];
|
150 |
+
|
151 |
+
var chartData = {
|
152 |
+
labels: monthDays,
|
153 |
+
datasets: [{
|
154 |
+
label: 'Submissions',
|
155 |
+
data: submissions,
|
156 |
+
backgroundColor: [
|
157 |
+
'#E1F6FF'
|
158 |
+
],
|
159 |
+
borderColor: [
|
160 |
+
'#17A8E3'
|
161 |
+
],
|
162 |
+
borderWidth: 2,
|
163 |
+
pointRadius: 0,
|
164 |
+
pointHitRadius: 20,
|
165 |
+
pointHoverRadius: 5,
|
166 |
+
pointHoverBorderColor: '#17A8E3',
|
167 |
+
pointHoverBackgroundColor: '#17A8E3'
|
168 |
+
}]
|
169 |
+
};
|
170 |
+
|
171 |
+
var chartOptions = {
|
172 |
+
maintainAspectRatio: false,
|
173 |
+
legend: {
|
174 |
+
display: false
|
175 |
+
},
|
176 |
+
scales: {
|
177 |
+
xAxes: [{
|
178 |
+
display: false,
|
179 |
+
gridLines: {
|
180 |
+
color: 'rgba(0, 0, 0, 0)'
|
181 |
+
}
|
182 |
+
}],
|
183 |
+
yAxes: [{
|
184 |
+
display: false,
|
185 |
+
gridLines: {
|
186 |
+
color: 'rgba(0, 0, 0, 0)'
|
187 |
+
},
|
188 |
+
ticks: {
|
189 |
+
beginAtZero: false,
|
190 |
+
min: 0,
|
191 |
+
max: <?php echo esc_attr( $canvas_top_spacing ); ?>,
|
192 |
+
stepSize: 1
|
193 |
+
}
|
194 |
+
}]
|
195 |
+
},
|
196 |
+
elements: {
|
197 |
+
line: {
|
198 |
+
tension: 0
|
199 |
+
},
|
200 |
+
point: {
|
201 |
+
radius: 0
|
202 |
+
}
|
203 |
+
},
|
204 |
+
tooltips: {
|
205 |
+
custom: function( tooltip ) {
|
206 |
+
if ( ! tooltip ) return;
|
207 |
+
// disable displaying the color box;
|
208 |
+
tooltip.displayColors = false;
|
209 |
+
},
|
210 |
+
callbacks: {
|
211 |
+
title: function( tooltipItem, data ) {
|
212 |
+
return tooltipItem[0].yLabel + " Submissions";
|
213 |
+
},
|
214 |
+
label: function( tooltipItem, data ) {
|
215 |
+
return tooltipItem.xLabel;
|
216 |
+
},
|
217 |
+
// Set label text color
|
218 |
+
labelTextColor:function( tooltipItem, chart ) {
|
219 |
+
return '#AAAAAA';
|
220 |
+
}
|
221 |
+
}
|
222 |
+
},
|
223 |
+
plugins: {
|
224 |
+
datalabels: {
|
225 |
+
display: false
|
226 |
+
}
|
227 |
+
}
|
228 |
+
};
|
229 |
+
|
230 |
+
if (ctx) {
|
231 |
+
var myChart = new Chart(ctx, {
|
232 |
+
type: 'line',
|
233 |
+
fill: 'start',
|
234 |
+
data: chartData,
|
235 |
+
plugins: [
|
236 |
+
ChartDataLabels
|
237 |
+
],
|
238 |
+
options: chartOptions
|
239 |
+
});
|
240 |
+
}
|
241 |
+
|
242 |
+
|
243 |
+
</script>
|
244 |
+
<?php
|
245 |
+
}
|
246 |
+
}
|
admin/views/common/list/empty_content.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$import_dialog = 'import_' . forminator_get_prefix( static::$module_slug, 'c' );
|
3 |
+
// Empty message.
|
4 |
+
$image_empty = forminator_plugin_url() . 'assets/images/forminator-empty-message.png';
|
5 |
+
$image_empty2x = forminator_plugin_url() . 'assets/images/forminator-empty-message@2x.png';
|
6 |
+
// Search no results image.
|
7 |
+
$search_empty = forminator_plugin_url() . 'assets/images/forminator-no-result.png';
|
8 |
+
$search_empty2x = forminator_plugin_url() . 'assets/images/forminator-no-result@2x.png';
|
9 |
+
?>
|
10 |
+
|
11 |
+
<div class="sui-box sui-message sui-message-lg">
|
12 |
+
|
13 |
+
<?php if ( forminator_is_show_branding() ) : ?>
|
14 |
+
<?php if ( ! $is_search ) : ?>
|
15 |
+
|
16 |
+
<img src="<?php echo esc_url( $image_empty ); ?>"
|
17 |
+
srcset="<?php echo esc_url( $image_empty2x ); ?> 1x, <?php echo esc_url( $image_empty2x ); ?> 2x"
|
18 |
+
alt="<?php esc_html_e( 'Empty modules', 'forminator' ); ?>"
|
19 |
+
class="sui-image sui-image-center"
|
20 |
+
aria-hidden="true"/>
|
21 |
+
|
22 |
+
<?php else: ?>
|
23 |
+
|
24 |
+
<img src="<?php echo esc_url( $search_empty ); ?>"
|
25 |
+
srcset="<?php echo esc_url( $search_empty2x ); ?> 1x, <?php echo esc_url( $search_empty2x ); ?> 2x"
|
26 |
+
alt="<?php esc_html_e( 'No results', 'forminator' ); ?>"
|
27 |
+
class="sui-image sui-image-center"
|
28 |
+
aria-hidden="true"/>
|
29 |
+
|
30 |
+
<?php endif; ?>
|
31 |
+
<?php endif; ?>
|
32 |
+
|
33 |
+
<div class="sui-message-content">
|
34 |
+
|
35 |
+
<?php if ( ! $is_search ) : ?>
|
36 |
+
|
37 |
+
<p><?php echo esc_html( $empty_title ); ?></p>
|
38 |
+
|
39 |
+
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
40 |
+
|
41 |
+
<p>
|
42 |
+
<button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="<?php echo esc_attr( $create_dialog ); ?>"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', 'forminator' ); ?></button>
|
43 |
+
|
44 |
+
<a href="#"
|
45 |
+
class="sui-button wpmudev-open-modal"
|
46 |
+
data-modal="<?php echo esc_attr( $import_dialog ); ?>"
|
47 |
+
data-modal-title=""
|
48 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_' . $import_dialog ) ); ?>">
|
49 |
+
<i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Import', 'forminator' ); ?>
|
50 |
+
</a>
|
51 |
+
</p>
|
52 |
+
|
53 |
+
<?php else : ?>
|
54 |
+
|
55 |
+
<p><button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="<?php echo esc_attr( $create_dialog ); ?>">
|
56 |
+
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', 'forminator' ); ?>
|
57 |
+
</button></p>
|
58 |
+
|
59 |
+
<?php endif; ?>
|
60 |
+
|
61 |
+
<?php else: // Search no-result message ?>
|
62 |
+
|
63 |
+
<h2><?php
|
64 |
+
echo sprintf(
|
65 |
+
'%s "%s"',
|
66 |
+
esc_html__( 'No results for', 'forminator' ),
|
67 |
+
esc_html( $search_keyword )
|
68 |
+
);
|
69 |
+
?></h2>
|
70 |
+
|
71 |
+
<p><?php printf( esc_html__( "We couldn't find any %s matching your search keyword. Perhaps try again?", 'forminator' ), forminator_get_prefix( static::$module_slug, '', false, true ) ); ?></p>
|
72 |
+
|
73 |
+
<?php endif; ?>
|
74 |
+
|
75 |
+
</div>
|
76 |
+
|
77 |
+
</div>
|
admin/views/common/list/header.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<header class="sui-header">
|
2 |
+
|
3 |
+
<h1 class="sui-header-title"><?php echo esc_html( $title ); ?></h1>
|
4 |
+
|
5 |
+
<div class="sui-actions-left">
|
6 |
+
|
7 |
+
<button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="<?php echo esc_attr( $create_dialog ); ?>"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', 'forminator' ); ?></button>
|
8 |
+
|
9 |
+
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
10 |
+
|
11 |
+
<a href="#"
|
12 |
+
class="sui-button wpmudev-open-modal"
|
13 |
+
data-modal="<?php echo esc_attr( $import_dialog ); ?>"
|
14 |
+
data-modal-title=""
|
15 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_' . $import_dialog ) ); ?>"><i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Import', 'forminator' ); ?></a>
|
16 |
+
|
17 |
+
<?php endif; ?>
|
18 |
+
|
19 |
+
</div>
|
20 |
+
|
21 |
+
<div class="sui-actions-right">
|
22 |
+
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
23 |
+
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/<?php echo esc_attr( $hash ); ?>" target="_blank" class="sui-button sui-button-ghost">
|
24 |
+
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', 'forminator' ); ?>
|
25 |
+
</a>
|
26 |
+
<?php endif; ?>
|
27 |
+
</div>
|
28 |
+
</header>
|
admin/views/common/list/main_content.php
ADDED
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- START: Bulk actions and pagination -->
|
2 |
+
<div class="fui-listings-pagination">
|
3 |
+
|
4 |
+
<div class="fui-pagination-mobile sui-pagination-wrap">
|
5 |
+
<?php $this->pagination( $is_search, $count ); ?>
|
6 |
+
</div>
|
7 |
+
|
8 |
+
<div class="fui-pagination-desktop sui-box">
|
9 |
+
|
10 |
+
<div class="sui-box-search">
|
11 |
+
|
12 |
+
<form
|
13 |
+
method="post"
|
14 |
+
name="bulk-action-form"
|
15 |
+
class="sui-search-left"
|
16 |
+
style="display: flex; align-items: center;"
|
17 |
+
>
|
18 |
+
|
19 |
+
<?php wp_nonce_field( 'forminator_' . static::$module_slug . '_request', 'forminatorNonce' ); ?>
|
20 |
+
|
21 |
+
<input type="hidden" name="ids" value="" />
|
22 |
+
|
23 |
+
<label for="forminator-check-all-modules" class="sui-checkbox">
|
24 |
+
<input type="checkbox" id="forminator-check-all-modules">
|
25 |
+
<span aria-hidden="true"></span>
|
26 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Select all', 'forminator' ); ?></span>
|
27 |
+
</label>
|
28 |
+
|
29 |
+
<select class="sui-select-sm sui-select-inline fui-select-listing-actions" name="forminator_action">
|
30 |
+
<option value=""><?php esc_html_e( 'Bulk Action', 'forminator' ); ?></option>
|
31 |
+
<?php foreach ( $this->bulk_actions() as $val => $label ) : ?>
|
32 |
+
<option value="<?php echo esc_attr( $val ); ?>"><?php echo esc_html( $label ); ?></option>
|
33 |
+
<?php endforeach; ?>
|
34 |
+
</select>
|
35 |
+
|
36 |
+
<button class="sui-button"><?php esc_html_e( 'Apply', 'forminator' ); ?></button>
|
37 |
+
|
38 |
+
</form>
|
39 |
+
|
40 |
+
<div class="sui-search-right">
|
41 |
+
|
42 |
+
<div class="sui-pagination-wrap">
|
43 |
+
<?php $this->pagination( $is_search, $count ); ?>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
|
48 |
+
</div>
|
49 |
+
|
50 |
+
</div>
|
51 |
+
|
52 |
+
</div>
|
53 |
+
<!-- END: Bulk actions and pagination -->
|
54 |
+
|
55 |
+
<?php
|
56 |
+
$preview_dialog = 'preview_' . forminator_get_prefix( static::$module_slug, 'c', false, true );
|
57 |
+
$export_dialog = 'export_' . forminator_get_prefix( static::$module_slug, 'c' );
|
58 |
+
$post_type = 'forminator_' . forminator_get_prefix( static::$module_slug, '', false, true );
|
59 |
+
$soon = 'quiz' === static::$module_slug;
|
60 |
+
?>
|
61 |
+
<div class="sui-accordion sui-accordion-block" id="forminator-modules-list">
|
62 |
+
|
63 |
+
<?php
|
64 |
+
foreach ( $modules as $module ) {
|
65 |
+
$module_entries_from_last_month = 0 !== $module['entries'] ? count( Forminator_Form_Entry_Model::get_newer_entry_ids_of_form_id( $module['id'], $sql_month_start_date ) ) : 0;
|
66 |
+
$opened_class = '';
|
67 |
+
$opened_chart = '';
|
68 |
+
$has_leads = isset( $module['has_leads'] ) ? $module['has_leads'] : false;
|
69 |
+
$leads_id = isset( $module['leads_id'] ) ? $module['leads_id'] : 0;
|
70 |
+
if ( isset( $wizard_page ) && ! isset( $module['type'] ) ) {
|
71 |
+
$edit_url = admin_url( 'admin.php?page=' . $wizard_page . '&id=' . $module['id'] );
|
72 |
+
} else {
|
73 |
+
// For quizzes.
|
74 |
+
$edit_url = admin_url( 'admin.php?page=forminator-' . ( 'nowrong' === $module['type'] ? $module['type'] : 'knowledge' ) . '-wizard&id=' . $module['id'] );
|
75 |
+
}
|
76 |
+
|
77 |
+
if( isset( $_GET['view-stats'] ) && intval( $_GET['view-stats'] ) === intval( $module['id'] ) ) { // phpcs:ignore
|
78 |
+
$opened_class = ' sui-accordion-item--open forminator-scroll-to';
|
79 |
+
$opened_chart = ' sui-chartjs-loaded';
|
80 |
+
}
|
81 |
+
?>
|
82 |
+
|
83 |
+
<div class="sui-accordion-item<?php echo esc_attr( $opened_class ); ?>">
|
84 |
+
|
85 |
+
<div class="sui-accordion-item-header">
|
86 |
+
|
87 |
+
<div class="sui-accordion-item-title sui-trim-title">
|
88 |
+
|
89 |
+
<label for="wpf-module-<?php echo esc_attr( $module['id'] ); ?>" class="sui-checkbox sui-accordion-item-action">
|
90 |
+
<input type="checkbox" id="wpf-module-<?php echo esc_attr( $module['id'] ); ?>" value="<?php echo esc_html( $module['id'] ); ?>">
|
91 |
+
<span aria-hidden="true"></span>
|
92 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Select this module', 'forminator' ); ?></span>
|
93 |
+
</label>
|
94 |
+
|
95 |
+
<span class="sui-trim-text"><?php echo htmlspecialchars( forminator_get_form_name( $module['id'] ) ); // phpcs:ignore ?></span>
|
96 |
+
|
97 |
+
<?php
|
98 |
+
if ( 'publish' === $module['status'] ) {
|
99 |
+
echo '<span class="sui-tag sui-tag-blue">' . esc_html__( 'Published', 'forminator' ) . '</span>';
|
100 |
+
}
|
101 |
+
?>
|
102 |
+
|
103 |
+
<?php
|
104 |
+
if ( 'draft' === $module['status'] ) {
|
105 |
+
echo '<span class="sui-tag">' . esc_html__( 'Draft', 'forminator' ) . '</span>';
|
106 |
+
}
|
107 |
+
?>
|
108 |
+
|
109 |
+
</div>
|
110 |
+
|
111 |
+
<div class="sui-accordion-item-date"><strong><?php esc_html_e( 'Last Submission', 'forminator' ); ?></strong> <?php echo esc_html( $module['last_entry_time'] ); ?></div>
|
112 |
+
|
113 |
+
<div class="sui-accordion-col-auto">
|
114 |
+
|
115 |
+
<a href="<?php echo esc_url( $edit_url ); ?>"
|
116 |
+
class="sui-button sui-button-ghost sui-accordion-item-action sui-desktop-visible">
|
117 |
+
<i class="sui-icon-pencil" aria-hidden="true"></i> <?php esc_html_e( 'Edit', 'forminator' ); ?>
|
118 |
+
</a>
|
119 |
+
|
120 |
+
<a href="<?php echo esc_url( $edit_url ); ?>"
|
121 |
+
class="sui-button-icon sui-accordion-item-action sui-mobile-visible">
|
122 |
+
<i class="sui-icon-pencil" aria-hidden="true"></i>
|
123 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Edit', 'forminator' ); ?></span>
|
124 |
+
</a>
|
125 |
+
|
126 |
+
<div class="sui-dropdown sui-accordion-item-action<?php echo $soon ? ' fui-dropdown-soon' : ''; ?>">
|
127 |
+
|
128 |
+
<button class="sui-button-icon sui-dropdown-anchor">
|
129 |
+
<i class="sui-icon-widget-settings-config" aria-hidden="true"></i>
|
130 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Open list settings', 'forminator' ); ?></span>
|
131 |
+
</button>
|
132 |
+
|
133 |
+
<ul>
|
134 |
+
|
135 |
+
<li><a href="#"
|
136 |
+
class="wpmudev-open-modal"
|
137 |
+
data-modal="<?php echo esc_attr( $preview_dialog ); ?>"
|
138 |
+
data-modal-title="<?php printf( '%s - %s', esc_html( $preview_title ), htmlspecialchars( htmlspecialchars( forminator_get_form_name( $module['id'] ) ) ) ); // phpcs:ignore ?>"
|
139 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
140 |
+
data-has-leads="<?php echo esc_attr( $has_leads ); ?>"
|
141 |
+
data-leads-id="<?php echo esc_attr( $leads_id ); ?>"
|
142 |
+
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
143 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_' . $preview_dialog ) ); ?>">
|
144 |
+
<i class="sui-icon-eye" aria-hidden="true"></i> <?php esc_html_e( 'Preview', 'forminator' ); ?>
|
145 |
+
</a></li>
|
146 |
+
|
147 |
+
<li>
|
148 |
+
<button class="copy-clipboard" data-shortcode='[forminator_<?php echo esc_attr( static::$module_slug ); ?> id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', 'forminator' ); ?></button>
|
149 |
+
</li>
|
150 |
+
|
151 |
+
<li>
|
152 |
+
<form method="post">
|
153 |
+
<input type="hidden" name="forminator_action" value="update-status">
|
154 |
+
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
155 |
+
|
156 |
+
<?php if ( 'publish' === $module['status'] ) : ?>
|
157 |
+
<input type="hidden" name="status" value="draft"/>
|
158 |
+
<?php elseif ( 'draft' === $module['status'] ) : ?>
|
159 |
+
<input type="hidden" name="status" value="publish"/>
|
160 |
+
<?php endif; ?>
|
161 |
+
|
162 |
+
<?php
|
163 |
+
$update_status_nonce = esc_attr( 'forminator-nonce-update-status-' . $module['id'] );
|
164 |
+
wp_nonce_field( $update_status_nonce, $update_status_nonce );
|
165 |
+
?>
|
166 |
+
<button type="submit">
|
167 |
+
|
168 |
+
<?php if ( 'publish' === $module['status'] ) : ?>
|
169 |
+
<i class="sui-icon-unpublish" aria-hidden="true"></i> <?php esc_html_e( 'Unpublish', 'forminator' ); ?>
|
170 |
+
<?php elseif ( 'draft' === $module['status'] ) : ?>
|
171 |
+
<i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Publish', 'forminator' ); ?>
|
172 |
+
<?php endif; ?>
|
173 |
+
|
174 |
+
</button>
|
175 |
+
</form>
|
176 |
+
</li>
|
177 |
+
|
178 |
+
<li><a href="<?php echo admin_url( 'admin.php?page=forminator-entries&form_type=' . $post_type . '&form_id=' . $module['id'] ); // phpcs:ignore ?>">
|
179 |
+
<i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', 'forminator' ); ?>
|
180 |
+
</a></li>
|
181 |
+
|
182 |
+
<li <?php echo ( $has_leads ) ? 'aria-hidden="true"' : ''; ?>><form method="post">
|
183 |
+
<input type="hidden" name="forminator_action" value="clone">
|
184 |
+
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
185 |
+
<?php
|
186 |
+
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
187 |
+
wp_nonce_field( $clone_nonce, 'forminatorNonce' );
|
188 |
+
?>
|
189 |
+
<?php if ( $has_leads ): ?>
|
190 |
+
<button type="submit" disabled="disabled" class="fui-button-with-tag sui-tooltip sui-tooltip-left sui-constrained" data-tooltip="<?php esc_html_e( 'Duplicate isn\'t supported at the moment for the quizzes with lead capturing enabled.', 'forminator' ); ?>">
|
191 |
+
<span class="sui-icon-page-multiple" aria-hidden="true"></span>
|
192 |
+
<span class="fui-button-label"><?php esc_html_e( 'Duplicate', 'forminator' ); ?></span>
|
193 |
+
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', 'forminator' ); ?></span>
|
194 |
+
</button>
|
195 |
+
<?php else: ?>
|
196 |
+
<button type="submit">
|
197 |
+
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', 'forminator' ); ?>
|
198 |
+
</button>
|
199 |
+
<?php endif; ?>
|
200 |
+
</form></li>
|
201 |
+
|
202 |
+
<li>
|
203 |
+
<button
|
204 |
+
class="wpmudev-open-modal"
|
205 |
+
data-modal="delete-module"
|
206 |
+
data-modal-title="<?php esc_attr_e( 'Reset Tracking Data', 'forminator' ); ?>"
|
207 |
+
data-modal-content="<?php printf( esc_attr__( 'Are you sure you wish reset the tracking data of this %s?', 'forminator' ), static::$module_slug ); ?>"
|
208 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
209 |
+
data-action="reset-views"
|
210 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator-nonce-reset-views-' . $module['id'] ) ); ?>"
|
211 |
+
>
|
212 |
+
<i class="sui-icon-update" aria-hidden="true"></i> <?php esc_html_e( 'Reset Tracking data', 'forminator' ); ?>
|
213 |
+
</button>
|
214 |
+
</li>
|
215 |
+
|
216 |
+
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
217 |
+
<?php if ( $has_leads ): ?>
|
218 |
+
<li aria-hidden="true"><a href="#" class="fui-button-with-tag sui-tooltip sui-tooltip-left"
|
219 |
+
data-tooltip="<?php esc_html_e( 'Export isn\'t supported at the moment for the quizzes with lead capturing enabled.', 'forminator' ); ?>">
|
220 |
+
<span class="sui-icon-cloud-migration" aria-hidden="true"></span>
|
221 |
+
<span class="fui-button-label"><?php esc_html_e( 'Export', 'forminator' ); ?></span>
|
222 |
+
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', 'forminator' ); ?></span>
|
223 |
+
</a></li>
|
224 |
+
<?php else: ?>
|
225 |
+
<li><a href="#"
|
226 |
+
class="wpmudev-open-modal"
|
227 |
+
data-modal="<?php echo esc_attr( $export_dialog ); ?>"
|
228 |
+
data-modal-title=""
|
229 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
230 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_' . static::$module_slug ) ); ?>">
|
231 |
+
<i class="sui-icon-cloud-migration" aria-hidden="true"></i> <?php esc_html_e( 'Export', 'forminator' ); ?>
|
232 |
+
</a></li>
|
233 |
+
<?php endif; ?>
|
234 |
+
|
235 |
+
<?php endif; ?>
|
236 |
+
|
237 |
+
<li>
|
238 |
+
<button
|
239 |
+
class="sui-option-red wpmudev-open-modal"
|
240 |
+
data-modal="delete-module"
|
241 |
+
data-modal-title="<?php printf( esc_attr__( 'Delete %s', 'forminator' ), forminator_get_prefix( static::$module_slug, '', true ) ); ?>"
|
242 |
+
data-modal-content="<?php printf( esc_attr__( 'Are you sure you wish to permanently delete this %s?', 'forminator' ), static::$module_slug ); ?>"
|
243 |
+
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
244 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_' . static::$module_slug . '_request' ) ); ?>"
|
245 |
+
>
|
246 |
+
<i class="sui-icon-trash" aria-hidden="true"></i> <?php esc_html_e( 'Delete', 'forminator' ); ?>
|
247 |
+
</button>
|
248 |
+
</li>
|
249 |
+
|
250 |
+
</ul>
|
251 |
+
|
252 |
+
</div>
|
253 |
+
|
254 |
+
<button class="sui-button-icon sui-accordion-open-indicator" aria-label="<?php esc_html_e( 'Open item', 'forminator' ); ?>"><i class="sui-icon-chevron-down" aria-hidden="true"></i></button>
|
255 |
+
|
256 |
+
</div>
|
257 |
+
|
258 |
+
</div>
|
259 |
+
|
260 |
+
<div class="sui-accordion-item-body">
|
261 |
+
|
262 |
+
<ul class="sui-accordion-item-data">
|
263 |
+
|
264 |
+
<li data-col="large">
|
265 |
+
<strong><?php esc_html_e( 'Last Submission', 'forminator' ); ?></strong>
|
266 |
+
<span><?php echo esc_html( $module['last_entry_time'] ); ?></span>
|
267 |
+
</li>
|
268 |
+
|
269 |
+
<li data-col="small">
|
270 |
+
<strong><?php esc_html_e( 'Views', 'forminator' ); ?></strong>
|
271 |
+
<span><?php echo esc_html( $module['views'] ); ?></span>
|
272 |
+
</li>
|
273 |
+
|
274 |
+
<li>
|
275 |
+
<?php if ( $has_leads ) : ?>
|
276 |
+
<strong class="forminator-leads-leads" style="display:none;"><?php esc_html_e( 'Leads Collected', 'forminator' ); ?></strong>
|
277 |
+
<a href="<?php echo admin_url( 'admin.php?page=forminator-quiz-view&form_id=' . $module['id'] ); // phpcs:ignore ?>" class="forminator-leads-leads" style="display:none;"><?php echo esc_html( $module['leads'] ); ?></a>
|
278 |
+
<?php endif; ?>
|
279 |
+
<strong class="forminator-leads-submissions"><?php esc_html_e( 'Submissions', 'forminator' ); ?></strong>
|
280 |
+
<a href="<?php echo admin_url( 'admin.php?page=forminator-entries&form_type=' . $post_type . '&form_id=' . $module['id'] ); // phpcs:ignore ?>" class="forminator-leads-submissions"><?php echo esc_html( $module['entries'] ); ?></a>
|
281 |
+
</li>
|
282 |
+
|
283 |
+
<li>
|
284 |
+
<strong><?php esc_html_e( 'Conversion Rate', 'forminator' ); ?></strong>
|
285 |
+
<span class="forminator-submission-rate"><?php echo esc_html( $this->getRate( $module ) ); ?>%</span>
|
286 |
+
<?php if ( $has_leads ): ?>
|
287 |
+
<span class="forminator-leads-rate" style="display:none;"><?php echo $this->getLeadsRate( $module ); // phpcs:ignore ?>%</span>
|
288 |
+
<?php endif; ?>
|
289 |
+
</li>
|
290 |
+
|
291 |
+
<?php if ( $has_leads ): ?>
|
292 |
+
<li class="fui-conversion-select" data-col="selector">
|
293 |
+
<label class="fui-selector-label"><?php esc_html_e( 'View data for', 'forminator' ); ?></label>
|
294 |
+
<select class="sui-select-sm fui-selector-button fui-select-listing-data">
|
295 |
+
<option value="submissions"><?php esc_html_e( 'Submissions', 'forminator' ); ?></option>
|
296 |
+
<option value="leads"><?php esc_html_e( 'Leads Form', 'forminator' ); ?></option>
|
297 |
+
</select>
|
298 |
+
</li>
|
299 |
+
<?php endif; ?>
|
300 |
+
|
301 |
+
</ul>
|
302 |
+
|
303 |
+
<div class="sui-chartjs sui-chartjs-animated<?php echo esc_attr( $opened_chart ); ?> forminator-stats-chart" data-chart-id="<?php echo esc_attr( $module['id'] ); ?>">
|
304 |
+
|
305 |
+
<div class="sui-chartjs-message sui-chartjs-message--loading">
|
306 |
+
<p><i class="sui-icon-loader sui-loading" aria-hidden="true"></i> <?php esc_html_e( 'Loading data...', 'forminator' ); ?></p>
|
307 |
+
</div>
|
308 |
+
|
309 |
+
<?php
|
310 |
+
unset( $message );
|
311 |
+
if ( 0 === $module['entries'] ) {
|
312 |
+
$message = sprintf( esc_html__( "Your %s doesn't have any submission yet. Try again in a moment.", 'forminator' ), static::$module_slug );
|
313 |
+
} else if ( 'draft' === $module['status'] ) {
|
314 |
+
$message = sprintf( esc_html__( "This %s is in draft state, so we've paused collecting data until you publish it live.", 'forminator' ), static::$module_slug );
|
315 |
+
} else if ( 0 === $module_entries_from_last_month ) {
|
316 |
+
$message = sprintf( esc_html__( "Your %s didn't collect submissions the past 30 days.", 'forminator' ), static::$module_slug );
|
317 |
+
}
|
318 |
+
?>
|
319 |
+
<?php if ( ! empty( $message ) ) { ?>
|
320 |
+
|
321 |
+
<div class="sui-chartjs-message sui-chartjs-message--empty">
|
322 |
+
<p><i class="sui-icon-info" aria-hidden="true"></i> <?php echo esc_html( $message ); ?></p>
|
323 |
+
</div>
|
324 |
+
|
325 |
+
<?php } ?>
|
326 |
+
|
327 |
+
<div class="sui-chartjs-canvas">
|
328 |
+
|
329 |
+
<?php if ( ( 0 !== $module['entries'] ) || ( 0 !== $module_entries_from_last_month ) ) { ?>
|
330 |
+
<canvas id="forminator-module-<?php echo $module['id']; // phpcs:ignore ?>-stats"></canvas>
|
331 |
+
<?php } ?>
|
332 |
+
|
333 |
+
</div>
|
334 |
+
|
335 |
+
</div>
|
336 |
+
|
337 |
+
<?php if ( $has_leads ) { ?>
|
338 |
+
|
339 |
+
<div class="sui-chartjs sui-chartjs-animated<?php echo esc_attr( $opened_chart ); ?> forminator-leads-chart" style="display: none;" data-chart-id="<?php echo esc_attr( $leads_id ); ?>">
|
340 |
+
|
341 |
+
<div class="sui-chartjs-message sui-chartjs-message--loading">
|
342 |
+
<p><i class="sui-icon-loader sui-loading" aria-hidden="true"></i> <?php esc_html_e( 'Loading data...', 'forminator' ); ?></p>
|
343 |
+
</div>
|
344 |
+
|
345 |
+
<?php if ( ! empty( $message ) ) { ?>
|
346 |
+
|
347 |
+
<div class="sui-chartjs-message sui-chartjs-message--empty">
|
348 |
+
<p><i class="sui-icon-info" aria-hidden="true"></i> <?php echo esc_html( $message ); ?></p>
|
349 |
+
</div>
|
350 |
+
|
351 |
+
<?php } ?>
|
352 |
+
|
353 |
+
<div class="sui-chartjs-canvas">
|
354 |
+
|
355 |
+
<?php if ( ( 0 !== $module['entries'] ) || ( 0 !== $module_entries_from_last_month ) ) { ?>
|
356 |
+
<canvas id="forminator-module-<?php echo esc_attr( $leads_id ); ?>-stats"></canvas>
|
357 |
+
<?php } ?>
|
358 |
+
|
359 |
+
</div>
|
360 |
+
|
361 |
+
</div>
|
362 |
+
|
363 |
+
<?php } ?>
|
364 |
+
|
365 |
+
</div>
|
366 |
+
|
367 |
+
</div>
|
368 |
+
|
369 |
+
<?php } ?>
|
370 |
+
|
371 |
+
</div>
|
admin/views/common/list/summary.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( $count > 0 || $is_search ) {
|
3 |
+
$count_active = $this->countModules( 'publish' );
|
4 |
+
// Count total entries from last 30 days.
|
5 |
+
$total_entries_from_last_month = count( Forminator_Form_Entry_Model::get_newer_entry_ids( $entry_type, $sql_month_start_date ) );
|
6 |
+
|
7 |
+
$most_entry = Forminator_Form_Entry_Model::get_most_entry( $entry_type );
|
8 |
+
|
9 |
+
?>
|
10 |
+
|
11 |
+
<div class="sui-box sui-summary sui-summary-sm <?php echo esc_attr( $this->get_box_summary_classes() ); ?>">
|
12 |
+
|
13 |
+
<div class="sui-summary-image-space" aria-hidden="true" style="<?php echo esc_attr( $this->get_box_summary_image_style() ); ?>"></div>
|
14 |
+
|
15 |
+
<div class="sui-summary-segment">
|
16 |
+
|
17 |
+
<div class="sui-summary-details">
|
18 |
+
|
19 |
+
<span class="sui-summary-large"><?php echo esc_html( $count_active ); ?></span>
|
20 |
+
|
21 |
+
<span class="sui-summary-sub"><?php echo esc_html( _n(
|
22 |
+
sprintf( 'Active %s', forminator_get_prefix( static::$module_slug, '', true ) ),
|
23 |
+
sprintf( 'Active %s', forminator_get_prefix( static::$module_slug, '', true, true ) ),
|
24 |
+
esc_html( $count_active ), 'forminator' ) ); ?></span>
|
25 |
+
|
26 |
+
<form action="" method="get" id="forminator-search-modules" class="forminator-search-modules">
|
27 |
+
|
28 |
+
<div class="sui-row">
|
29 |
+
|
30 |
+
<div class="sui-col-lg-10 sui-col-md-12">
|
31 |
+
|
32 |
+
<div class="sui-form-field">
|
33 |
+
|
34 |
+
<div class="sui-control-with-icon">
|
35 |
+
<button class="forminator-search-submit"><i class="sui-icon-magnifying-glass-search"></i></button>
|
36 |
+
<input type="text" name="search" value="<?php esc_attr_e( $search_keyword ); ?>" placeholder="<?php printf( esc_attr__( 'Search %s...', 'forminator' ), static::$module_slug ); ?>" id="forminator-module-search" class="sui-form-control">
|
37 |
+
</div>
|
38 |
+
|
39 |
+
</div>
|
40 |
+
|
41 |
+
</div>
|
42 |
+
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<input type="hidden" name="page" value="<?php echo filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING ); ?>" />
|
46 |
+
<?php
|
47 |
+
wp_nonce_field( $search_module_nonce, $search_module_nonce, false );
|
48 |
+
?>
|
49 |
+
|
50 |
+
</form>
|
51 |
+
|
52 |
+
</div>
|
53 |
+
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<div class="sui-summary-segment">
|
57 |
+
|
58 |
+
<ul class="sui-list">
|
59 |
+
|
60 |
+
<li>
|
61 |
+
<span class="sui-list-label"><?php esc_html_e( 'Last Submission', 'forminator' ); ?></span>
|
62 |
+
<span class="sui-list-detail"><?php echo esc_html( forminator_get_latest_entry_time( static::$module_slug ) ); ?></span>
|
63 |
+
</li>
|
64 |
+
|
65 |
+
<li>
|
66 |
+
<span class="sui-list-label"><?php esc_html_e( 'Submissions in the last 30 days', 'forminator' ); ?></span>
|
67 |
+
<span class="sui-list-detail"><?php echo esc_html( $total_entries_from_last_month ); ?></span>
|
68 |
+
</li>
|
69 |
+
<?php if ( ! empty( $most_entry ) && get_post_status( $most_entry->form_id ) && 0 !== (int) $most_entry->entry_count ) { ?>
|
70 |
+
<li>
|
71 |
+
<span class="sui-list-label"><?php esc_html_e( 'Most submissions', 'forminator' ); ?></span>
|
72 |
+
<span class="sui-list-detail">
|
73 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=' . $wizard_page . '&id=' . $most_entry->form_id ) ); ?>">
|
74 |
+
<?php echo forminator_get_form_name( $most_entry->form_id ); ?>
|
75 |
+
</a>
|
76 |
+
</span>
|
77 |
+
</li>
|
78 |
+
<?php } ?>
|
79 |
+
</ul>
|
80 |
+
|
81 |
+
</div>
|
82 |
+
|
83 |
+
</div>
|
84 |
+
|
85 |
+
<?php
|
86 |
+
// Call the css here to prevent search icon from flashing above the search form while the page is loading...
|
87 |
+
$this->template( 'common/list/temp_css' );
|
88 |
+
}
|
admin/views/common/list/temp_css.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- Keep the css here for faster loading -->
|
2 |
+
<style type="text/css">
|
3 |
+
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules {
|
4 |
+
padding-top: 18px;
|
5 |
+
margin-bottom: -18px;
|
6 |
+
}
|
7 |
+
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules .forminator-search-submit {
|
8 |
+
position: absolute;
|
9 |
+
bottom: 0;
|
10 |
+
left: 0;
|
11 |
+
width: 36px;
|
12 |
+
height: 100%;
|
13 |
+
background: transparent;
|
14 |
+
border: none;
|
15 |
+
outline: none;
|
16 |
+
cursor: pointer;
|
17 |
+
}
|
18 |
+
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules .forminator-search-submit .sui-icon-magnifying-glass-search {
|
19 |
+
position: relative;
|
20 |
+
top: 0;
|
21 |
+
left: 4px;
|
22 |
+
}
|
23 |
+
</style>
|
admin/views/{poll → common}/popup/export.php
RENAMED
@@ -1,10 +1,12 @@
|
|
1 |
<?php
|
2 |
$form_id = $_POST['id'];// phpcs:ignore -- varified on admin ajax
|
3 |
-
$
|
|
|
|
|
4 |
|
5 |
$exportable = array();
|
6 |
-
$model =
|
7 |
-
if ( $model instanceof
|
8 |
$exportable = $model->to_exportable_data();
|
9 |
}
|
10 |
$text_area_id = uniqid( 'export-text-' );
|
@@ -14,7 +16,7 @@ $text_area_id = uniqid( 'export-text-' );
|
|
14 |
|
15 |
<div class="sui-form-field">
|
16 |
<textarea class="sui-form-control" readonly="readonly" rows="10" id="<?php echo esc_attr( $text_area_id ); ?>"></textarea>
|
17 |
-
<span class="sui-description"><?php esc_html_e( 'Copy ALL text above, and paste to import dialog.',
|
18 |
</div>
|
19 |
|
20 |
<div class="sui-notice sui-notice-info">
|
@@ -22,12 +24,12 @@ $text_area_id = uniqid( 'export-text-' );
|
|
22 |
<?php
|
23 |
echo(
|
24 |
sprintf(
|
25 |
-
__( 'You can import this %1$s in Forminator %2$s%3$s%4$s or above. The %5$s may break on a version lower than your install.',
|
26 |
-
|
27 |
'<strong>',
|
28 |
FORMINATOR_VERSION,//phpcs:ignore
|
29 |
'</strong>',
|
30 |
-
|
31 |
)
|
32 |
);
|
33 |
?>
|
@@ -38,15 +40,15 @@ $text_area_id = uniqid( 'export-text-' );
|
|
38 |
|
39 |
<div class="sui-box-footer">
|
40 |
|
41 |
-
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup"><?php esc_html_e( 'Close',
|
42 |
|
43 |
<div class="sui-actions-right">
|
44 |
|
45 |
-
<form action="<?php echo esc_attr( admin_url( 'admin.php?page=
|
46 |
<input type="hidden" name="forminator_action" value="export">
|
47 |
<input type="hidden" name="forminatorNonce" value="<?php echo esc_attr( $nonce ); ?>">
|
48 |
<input type="hidden" name="id" value="<?php echo esc_attr( $form_id ); ?>">
|
49 |
-
<button class="sui-button sui-button-primary"><i class="sui-icon-download" aria-hidden="true"></i> <?php esc_html_e( 'Download',
|
50 |
</form>
|
51 |
|
52 |
</div>
|
1 |
<?php
|
2 |
$form_id = $_POST['id'];// phpcs:ignore -- varified on admin ajax
|
3 |
+
$slug = $args['slug'];
|
4 |
+
$_page = 'forminator-' . forminator_get_prefix( $slug, 'c' );
|
5 |
+
$nonce = wp_create_nonce( 'forminator_' . $slug . '_request' );
|
6 |
|
7 |
$exportable = array();
|
8 |
+
$model = Forminator_Base_Form_Model::get_model( $form_id );
|
9 |
+
if ( $model instanceof Forminator_Base_Form_Model ) {
|
10 |
$exportable = $model->to_exportable_data();
|
11 |
}
|
12 |
$text_area_id = uniqid( 'export-text-' );
|
16 |
|
17 |
<div class="sui-form-field">
|
18 |
<textarea class="sui-form-control" readonly="readonly" rows="10" id="<?php echo esc_attr( $text_area_id ); ?>"></textarea>
|
19 |
+
<span class="sui-description"><?php esc_html_e( 'Copy ALL text above, and paste to import dialog.', 'forminator' ); ?></span>
|
20 |
</div>
|
21 |
|
22 |
<div class="sui-notice sui-notice-info">
|
24 |
<?php
|
25 |
echo(
|
26 |
sprintf(
|
27 |
+
__( 'You can import this %1$s in Forminator %2$s%3$s%4$s or above. The %5$s may break on a version lower than your install.', 'forminator' ), //phpcs:ignore
|
28 |
+
$slug,//phpcs:ignore
|
29 |
'<strong>',
|
30 |
FORMINATOR_VERSION,//phpcs:ignore
|
31 |
'</strong>',
|
32 |
+
$slug
|
33 |
)
|
34 |
);
|
35 |
?>
|
40 |
|
41 |
<div class="sui-box-footer">
|
42 |
|
43 |
+
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup"><?php esc_html_e( 'Close', 'forminator' ); ?></button>
|
44 |
|
45 |
<div class="sui-actions-right">
|
46 |
|
47 |
+
<form action="<?php echo esc_attr( admin_url( 'admin.php?page=' . $_page ) ); ?>" method="post">
|
48 |
<input type="hidden" name="forminator_action" value="export">
|
49 |
<input type="hidden" name="forminatorNonce" value="<?php echo esc_attr( $nonce ); ?>">
|
50 |
<input type="hidden" name="id" value="<?php echo esc_attr( $form_id ); ?>">
|
51 |
+
<button class="sui-button sui-button-primary"><i class="sui-icon-download" aria-hidden="true"></i> <?php esc_html_e( 'Download', 'forminator' ); ?></button>
|
52 |
</form>
|
53 |
|
54 |
</div>
|
admin/views/{quiz → common}/popup/import.php
RENAMED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
-
$
|
|
|
3 |
?>
|
4 |
|
5 |
<div class="sui-box-body wpmudev-popup-form">
|
@@ -10,7 +11,7 @@ $nonce = wp_create_nonce( 'forminator_save_import_quiz' );
|
|
10 |
|
11 |
<textarea class="sui-form-control" rows="10" name="importable"></textarea>
|
12 |
|
13 |
-
<span class="sui-description"><?php
|
14 |
|
15 |
</div>
|
16 |
|
@@ -19,14 +20,14 @@ $nonce = wp_create_nonce( 'forminator_save_import_quiz' );
|
|
19 |
<div class="sui-box-footer">
|
20 |
|
21 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
22 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Cancel',
|
23 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
24 |
</button>
|
25 |
|
26 |
<div class="sui-actions-right">
|
27 |
|
28 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
29 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Import',
|
30 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
31 |
</button>
|
32 |
|
1 |
<?php
|
2 |
+
$slug = $args['slug'];
|
3 |
+
$nonce = wp_create_nonce( 'forminator_save_import_' . $slug );
|
4 |
?>
|
5 |
|
6 |
<div class="sui-box-body wpmudev-popup-form">
|
11 |
|
12 |
<textarea class="sui-form-control" rows="10" name="importable"></textarea>
|
13 |
|
14 |
+
<span class="sui-description"><?php printf( esc_html__( 'Paste exported %s above.', 'forminator' ), $slug ); ?></span>
|
15 |
|
16 |
</div>
|
17 |
|
20 |
<div class="sui-box-footer">
|
21 |
|
22 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
23 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Cancel', 'forminator' ); ?></span>
|
24 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
25 |
</button>
|
26 |
|
27 |
<div class="sui-actions-right">
|
28 |
|
29 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
30 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Import', 'forminator' ); ?></span>
|
31 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
32 |
</button>
|
33 |
|
admin/views/custom-form/entries/content.php
CHANGED
@@ -7,6 +7,19 @@
|
|
7 |
$count = $this->filtered_total_entries();
|
8 |
$is_filter_enabled = $this->is_filter_box_enabled();
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
if ( $this->error_message() ) : ?>
|
11 |
|
12 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $this->error_message() ); ?></p></span>
|
@@ -24,133 +37,26 @@ if ( $this->total_entries() > 0 ) :
|
|
24 |
<input type="hidden" name="form_id" value="<?php echo esc_attr( $this->get_form_id() ); ?>">
|
25 |
|
26 |
<div class="fui-pagination-entries sui-pagination-wrap">
|
27 |
-
|
28 |
-
<span class="sui-pagination-results"><?php if ( 1 === $count ) { printf( esc_html__( '%s result', Forminator::DOMAIN ), $count ); } else { printf( esc_html__( '%s results', Forminator::DOMAIN ), $count ); } // phpcs:ignore ?></span>
|
29 |
-
|
30 |
<?php $this->paginate(); ?>
|
31 |
-
|
32 |
</div>
|
33 |
|
34 |
<div class="sui-box fui-box-entries">
|
35 |
|
36 |
<fieldset class="forminator-entries-nonce">
|
37 |
-
<?php wp_nonce_field( '
|
38 |
</fieldset>
|
39 |
|
40 |
<div class="sui-box-body fui-box-actions">
|
41 |
|
42 |
-
<?php $this->template( '
|
43 |
-
|
44 |
-
<div class="sui-box-search">
|
45 |
-
|
46 |
-
<div class="sui-search-left">
|
47 |
-
|
48 |
-
<?php $this->bulk_actions(); ?>
|
49 |
-
|
50 |
-
</div>
|
51 |
-
|
52 |
-
<div class="sui-search-right">
|
53 |
-
|
54 |
-
<div class="sui-pagination-wrap">
|
55 |
-
|
56 |
-
<span class="sui-pagination-results"><?php if ( 1 === $count ) { printf( esc_html__( '%s result', Forminator::DOMAIN ), $count ); } else { printf( esc_html__( '%s results', Forminator::DOMAIN ), $count ); } // phpcs:ignore ?></span>
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
<button class="sui-button-icon sui-button-outlined forminator-toggle-entries-filter <?php echo( $is_filter_enabled ? 'sui-active' : '' ); ?>">
|
61 |
-
<i class="sui-icon-filter" aria-hidden="true"></i>
|
62 |
-
</button>
|
63 |
-
|
64 |
-
</div>
|
65 |
-
|
66 |
-
</div>
|
67 |
-
|
68 |
-
</div>
|
69 |
-
|
70 |
-
<?php $this->template( 'custom-form/entries/filter' ); ?>
|
71 |
|
72 |
</div>
|
73 |
|
74 |
<?php if ( true === $is_filter_enabled ) : ?>
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
<label class="sui-label"><?php esc_html_e( 'Active Filters', Forminator::DOMAIN ); ?></label>
|
79 |
-
|
80 |
-
<div class="sui-pagination-active-filters forminator-entries-fields-filters">
|
81 |
-
|
82 |
-
<?php if ( isset( $this->filters['search'] ) ) : ?>
|
83 |
-
<div class="sui-active-filter">
|
84 |
-
<?php
|
85 |
-
printf(/* translators: ... */
|
86 |
-
esc_html__( 'Keyword: %s', Forminator::DOMAIN ),
|
87 |
-
esc_html( $this->filters['search'] )
|
88 |
-
);
|
89 |
-
?>
|
90 |
-
<button class="sui-active-filter-remove" type="submit" name="search" value="">
|
91 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', Forminator::DOMAIN ); ?></span>
|
92 |
-
</button>
|
93 |
-
</div>
|
94 |
-
<?php endif; ?>
|
95 |
-
|
96 |
-
<?php if ( isset( $this->filters['min_id'] ) ) : ?>
|
97 |
-
<div class="sui-active-filter">
|
98 |
-
<?php
|
99 |
-
printf(/* translators: ... */
|
100 |
-
esc_html__( 'From ID: %s', Forminator::DOMAIN ),
|
101 |
-
esc_html( $this->filters['min_id'] )
|
102 |
-
);
|
103 |
-
?>
|
104 |
-
<button class="sui-active-filter-remove" type="submit" name="min_id" value="">
|
105 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', Forminator::DOMAIN ); ?></span>
|
106 |
-
</button>
|
107 |
-
</div>
|
108 |
-
<?php endif; ?>
|
109 |
-
|
110 |
-
<?php if ( isset( $this->filters['max_id'] ) ) : ?>
|
111 |
-
<div class="sui-active-filter">
|
112 |
-
<?php
|
113 |
-
printf(/* translators: ... */
|
114 |
-
esc_html__( 'To ID: %s', Forminator::DOMAIN ),
|
115 |
-
esc_html( $this->filters['max_id'] )
|
116 |
-
);
|
117 |
-
?>
|
118 |
-
<button class="sui-active-filter-remove" type="submit" name="max_id" value="">
|
119 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', Forminator::DOMAIN ); ?></span>
|
120 |
-
</button>
|
121 |
-
</div>
|
122 |
-
<?php endif; ?>
|
123 |
-
|
124 |
-
<?php if ( isset( $this->filters['date_created'][0] ) || isset( $this->filters['date_created'][1] ) ) : ?>
|
125 |
-
<div class="sui-active-filter">
|
126 |
-
<?php
|
127 |
-
printf(/* translators: ... */
|
128 |
-
esc_html__( 'Submission Date Range: %1$s to %2$s', Forminator::DOMAIN ),
|
129 |
-
esc_html( $this->filters['date_created'][0] ),
|
130 |
-
esc_html( $this->filters['date_created'][1] )
|
131 |
-
);
|
132 |
-
?>
|
133 |
-
<button class="sui-active-filter-remove" type="submit" name="date_range" value="">
|
134 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Remove this keyword', Forminator::DOMAIN ); ?></span>
|
135 |
-
</button>
|
136 |
-
</div>
|
137 |
-
<?php endif; ?>
|
138 |
-
|
139 |
-
<div class="sui-active-filter">
|
140 |
-
<?php
|
141 |
-
esc_html_e( 'Sort Order', Forminator::DOMAIN );
|
142 |
-
echo ': ';
|
143 |
-
if ( 'DESC' === $this->order['order'] ) {
|
144 |
-
esc_html_e( 'Descending', Forminator::DOMAIN );
|
145 |
-
} else {
|
146 |
-
esc_html_e( 'Ascending', Forminator::DOMAIN );
|
147 |
-
}
|
148 |
-
?>
|
149 |
-
</div>
|
150 |
-
|
151 |
-
</div>
|
152 |
-
|
153 |
-
</div>
|
154 |
|
155 |
<?php endif; ?>
|
156 |
|
@@ -206,7 +112,7 @@ if ( $this->total_entries() > 0 ) :
|
|
206 |
echo '<span aria-hidden="true"></span>';
|
207 |
|
208 |
echo '<span class="sui-screen-reader-text">' . sprintf(/* translators: ... */
|
209 |
-
esc_html__( 'Select entry number %s',
|
210 |
esc_html( $db_entry_id )
|
211 |
) . '</span>';
|
212 |
|
@@ -238,7 +144,7 @@ if ( $this->total_entries() > 0 ) :
|
|
238 |
|
239 |
echo '<td>';
|
240 |
echo '' . sprintf(/* translators: ... */
|
241 |
-
esc_html__( '+ %s other fields',
|
242 |
esc_html( $summary['num_fields_left'] )
|
243 |
) . '';
|
244 |
echo '<span class="sui-accordion-open-indicator">';
|
@@ -387,7 +293,7 @@ if ( $this->total_entries() > 0 ) :
|
|
387 |
type="button"
|
388 |
class="sui-button sui-button-ghost sui-button-red wpmudev-open-modal"
|
389 |
<?php if ( isset( $entries['activation_key'] ) ) {
|
390 |
-
$button_title = esc_html( 'Delete Submission & User',
|
391 |
$is_activation_key = true;
|
392 |
?>
|
393 |
data-activation-key="<?php echo $entries['activation_key']; ?>"
|
@@ -395,15 +301,15 @@ if ( $this->total_entries() > 0 ) :
|
|
395 |
data-entry-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
396 |
data-form-id="<?php echo esc_attr( $this->model->id ); ?>"
|
397 |
<?php } else {
|
398 |
-
$button_title = esc_html( 'Delete',
|
399 |
$is_activation_key = false;
|
400 |
?>
|
401 |
data-modal="delete-module"
|
402 |
data-form-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
403 |
<?php } ?>
|
404 |
-
data-modal-title="<?php esc_attr_e( 'Delete Submission',
|
405 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this submission?',
|
406 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( '
|
407 |
>
|
408 |
<i class="sui-icon-trash" aria-hidden="true"></i> <?php echo $button_title; ?>
|
409 |
</button>
|
@@ -415,13 +321,13 @@ if ( $this->total_entries() > 0 ) :
|
|
415 |
type="button"
|
416 |
class="sui-button wpmudev-open-modal"
|
417 |
data-modal="approve-user-module"
|
418 |
-
data-modal-title="<?php esc_attr_e( 'Approve User',
|
419 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you want to approve and activate this user?',
|
420 |
data-form-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
421 |
data-activation-key="<?php echo esc_attr( $entries['activation_key'] ); ?>"
|
422 |
-
data-nonce="<?php echo wp_create_nonce( '
|
423 |
>
|
424 |
-
<?php esc_html_e( 'Approve User',
|
425 |
</button>
|
426 |
</div>
|
427 |
|
@@ -457,24 +363,6 @@ if ( $this->total_entries() > 0 ) :
|
|
457 |
|
458 |
<?php else : ?>
|
459 |
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
<img src="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?>"
|
464 |
-
srcset="<?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions.png' ); ?> 1x, <?php echo esc_url( forminator_plugin_url() . 'assets/img/forminator-submissions@2x.png' ); ?> 2x"
|
465 |
-
alt="<?php esc_html_e( 'Forminator', Forminator::DOMAIN ); ?>"
|
466 |
-
class="sui-image"
|
467 |
-
aria-hidden="true"/>
|
468 |
-
<?php endif; ?>
|
469 |
-
|
470 |
-
<div class="sui-message-content">
|
471 |
-
|
472 |
-
<h2><?php echo forminator_get_form_name( $this->form_id, 'custom_form' );// phpcs:ignore ?></h2>
|
473 |
-
|
474 |
-
<p><?php esc_html_e( 'You haven’t received any submissions for this form yet. When you do, you’ll be able to view all the data here.', Forminator::DOMAIN ); ?></p>
|
475 |
-
|
476 |
-
</div>
|
477 |
-
|
478 |
-
</div>
|
479 |
-
|
480 |
-
<?php endif; ?>
|
7 |
$count = $this->filtered_total_entries();
|
8 |
$is_filter_enabled = $this->is_filter_box_enabled();
|
9 |
|
10 |
+
$live_payment_count = $this->has_live_payments( $this->form_id );
|
11 |
+
if ( $this->has_payments() && $count <= 100 ) {
|
12 |
+
$notice_args = array(
|
13 |
+
'submissions' => $live_payment_count,
|
14 |
+
'min_submissions' => 0,
|
15 |
+
'notice' => sprintf( esc_html__( "%1\$sCongratulations!%2\$s You have started collecting live payments on this form - that's awesome. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", 'forminator' ), '<strong>', '</strong>' ),
|
16 |
+
);
|
17 |
+
} else {
|
18 |
+
$notice_args = array(
|
19 |
+
'submissions' => $count,
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
if ( $this->error_message() ) : ?>
|
24 |
|
25 |
<span class="sui-notice sui-notice-error"><p><?php echo esc_html( $this->error_message() ); ?></p></span>
|
37 |
<input type="hidden" name="form_id" value="<?php echo esc_attr( $this->get_form_id() ); ?>">
|
38 |
|
39 |
<div class="fui-pagination-entries sui-pagination-wrap">
|
|
|
|
|
|
|
40 |
<?php $this->paginate(); ?>
|
|
|
41 |
</div>
|
42 |
|
43 |
<div class="sui-box fui-box-entries">
|
44 |
|
45 |
<fieldset class="forminator-entries-nonce">
|
46 |
+
<?php wp_nonce_field( 'forminatorFormEntries', 'forminatorEntryNonce' ); ?>
|
47 |
</fieldset>
|
48 |
|
49 |
<div class="sui-box-body fui-box-actions">
|
50 |
|
51 |
+
<?php $this->template( 'common/entries/prompt', $notice_args ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
<?php $this->template( 'common/entries/filter', array( 'fields' => $this->get_fields() ) ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
</div>
|
56 |
|
57 |
<?php if ( true === $is_filter_enabled ) : ?>
|
58 |
|
59 |
+
<?php $this->template( 'common/entries/active_filters_row' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
<?php endif; ?>
|
62 |
|
112 |
echo '<span aria-hidden="true"></span>';
|
113 |
|
114 |
echo '<span class="sui-screen-reader-text">' . sprintf(/* translators: ... */
|
115 |
+
esc_html__( 'Select entry number %s', 'forminator' ),
|
116 |
esc_html( $db_entry_id )
|
117 |
) . '</span>';
|
118 |
|
144 |
|
145 |
echo '<td>';
|
146 |
echo '' . sprintf(/* translators: ... */
|
147 |
+
esc_html__( '+ %s other fields', 'forminator' ),
|
148 |
esc_html( $summary['num_fields_left'] )
|
149 |
) . '';
|
150 |
echo '<span class="sui-accordion-open-indicator">';
|
293 |
type="button"
|
294 |
class="sui-button sui-button-ghost sui-button-red wpmudev-open-modal"
|
295 |
<?php if ( isset( $entries['activation_key'] ) ) {
|
296 |
+
$button_title = esc_html( 'Delete Submission & User', 'forminator' );
|
297 |
$is_activation_key = true;
|
298 |
?>
|
299 |
data-activation-key="<?php echo $entries['activation_key']; ?>"
|
301 |
data-entry-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
302 |
data-form-id="<?php echo esc_attr( $this->model->id ); ?>"
|
303 |
<?php } else {
|
304 |
+
$button_title = esc_html( 'Delete', 'forminator' );
|
305 |
$is_activation_key = false;
|
306 |
?>
|
307 |
data-modal="delete-module"
|
308 |
data-form-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
309 |
<?php } ?>
|
310 |
+
data-modal-title="<?php esc_attr_e( 'Delete Submission', 'forminator' ); ?>"
|
311 |
+
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this submission?', 'forminator' ); ?>"
|
312 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminatorFormEntries' ) ); ?>"
|
313 |
>
|
314 |
<i class="sui-icon-trash" aria-hidden="true"></i> <?php echo $button_title; ?>
|
315 |
</button>
|
321 |
type="button"
|
322 |
class="sui-button wpmudev-open-modal"
|
323 |
data-modal="approve-user-module"
|
324 |
+
data-modal-title="<?php esc_attr_e( 'Approve User', 'forminator' ); ?>"
|
325 |
+
data-modal-content="<?php esc_attr_e( 'Are you sure you want to approve and activate this user?', 'forminator' ); ?>"
|
326 |
data-form-id="<?php echo esc_attr( $db_entry_id ); ?>"
|
327 |
data-activation-key="<?php echo esc_attr( $entries['activation_key'] ); ?>"
|
328 |
+
data-nonce="<?php echo wp_create_nonce( 'forminatorFormEntries' ); // WPCS: XSS ok. ?>"
|
329 |
>
|
330 |
+
<?php esc_html_e( 'Approve User', 'forminator' ); ?>
|
331 |
</button>
|
332 |
</div>
|
333 |
|
363 |
|
364 |
<?php else : ?>
|
365 |
|
366 |
+
<?php include_once forminator_plugin_dir() . 'admin/views/common/entries/content-none.php'; ?>
|
367 |
+
<?php
|
368 |
+
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/entries/filter.php
DELETED
@@ -1,206 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* JS reference : assets/js/admin/layout.js
|
4 |
-
*/
|
5 |
-
|
6 |
-
/** @var $this Forminator_CForm_View_Page */
|
7 |
-
$is_filter_enabled = $this->is_filter_box_enabled();
|
8 |
-
$date_range = '';
|
9 |
-
$date_created = isset( $this->filters['date_created'] ) ? $this->filters['date_created'] : '';
|
10 |
-
if ( is_array( $date_created ) && isset( $date_created[0] ) && isset( $date_created[1] ) ) {
|
11 |
-
$date_created[0] = date( 'm/d/Y', strtotime( $date_created[0] ) );// phpcs:ignore
|
12 |
-
$date_created[1] = date( 'm/d/Y', strtotime( $date_created[1] ) );// phpcs:ignore
|
13 |
-
$date_range = implode( ' - ', $date_created );
|
14 |
-
}
|
15 |
-
$search_filter = isset( $this->filters['search'] ) ? $this->filters['search'] : '';
|
16 |
-
$min_id = isset( $this->filters['min_id'] ) ? $this->filters['min_id'] : '';
|
17 |
-
$max_id = isset( $this->filters['max_id'] ) ? $this->filters['max_id'] : '';
|
18 |
-
$order_by = isset( $this->order['order_by'] ) ? $this->order['order_by'] : '';
|
19 |
-
$order_filter = isset( $this->order['order'] ) ? $this->order['order'] : '';
|
20 |
-
?>
|
21 |
-
<div class="sui-pagination-filter <?php echo( $is_filter_enabled ? 'sui-open' : '' ); ?>">
|
22 |
-
|
23 |
-
<div class="sui-row">
|
24 |
-
|
25 |
-
<div class="sui-col-md-6">
|
26 |
-
|
27 |
-
<div class="sui-form-field">
|
28 |
-
|
29 |
-
<label for="forminator-forms-filter--by-date" class="sui-label"><?php esc_html_e( 'Submission Date Range', Forminator::DOMAIN ); ?></label>
|
30 |
-
|
31 |
-
<div class="sui-date">
|
32 |
-
<i class="sui-icon-calendar" aria-hidden="true"></i>
|
33 |
-
<input type="text"
|
34 |
-
placeholder="<?php esc_html_e( 'Pick a date range', Forminator::DOMAIN ); ?>"
|
35 |
-
id="forminator-forms-filter--by-date"
|
36 |
-
name="date_range"
|
37 |
-
autocomplete="off"
|
38 |
-
value="<?php echo esc_attr( $date_range ); ?>"
|
39 |
-
class="sui-form-control forminator-entries-filter-date"/>
|
40 |
-
</div>
|
41 |
-
|
42 |
-
</div>
|
43 |
-
|
44 |
-
</div>
|
45 |
-
|
46 |
-
<div class="sui-col-md-3">
|
47 |
-
|
48 |
-
<label for="forminator-forms-filter--from-id" class="sui-label"><?php esc_html_e( 'From ID', Forminator::DOMAIN ); ?></label>
|
49 |
-
<input type="number"
|
50 |
-
name="min_id"
|
51 |
-
min="0"
|
52 |
-
value="<?php echo esc_attr( $min_id ); ?>"
|
53 |
-
placeholder="<?php esc_html_e( 'E.g. 100', Forminator::DOMAIN ); ?>"
|
54 |
-
id="forminator-forms-filter--from-id"
|
55 |
-
class="sui-form-control"/>
|
56 |
-
|
57 |
-
</div>
|
58 |
-
|
59 |
-
<div class="sui-col-md-3">
|
60 |
-
|
61 |
-
<label for="forminator-forms-filter--to-id" class="sui-label"><?php esc_html_e( 'To ID', Forminator::DOMAIN ); ?></label>
|
62 |
-
<input type="number"
|
63 |
-
name="max_id"
|
64 |
-
min="0"
|
65 |
-
value="<?php echo esc_attr( $max_id ); ?>"
|
66 |
-
placeholder="<?php esc_html_e( 'E.g. 100', Forminator::DOMAIN ); ?>"
|
67 |
-
id="forminator-forms-filte--to-id"
|
68 |
-
class="sui-form-control"/>
|
69 |
-
|
70 |
-
</div>
|
71 |
-
|
72 |
-
</div>
|
73 |
-
|
74 |
-
<div class="sui-row">
|
75 |
-
|
76 |
-
<div class="sui-col-md-6">
|
77 |
-
|
78 |
-
<div class="sui-form-field">
|
79 |
-
|
80 |
-
<label for="forminator-forms-filter--by-keyword" class="sui-label"><?php esc_html_e( 'Keyword', Forminator::DOMAIN ); ?></label>
|
81 |
-
|
82 |
-
<div class="sui-control-with-icon">
|
83 |
-
<i class="sui-icon-magnifying-glass-search" aria-hidden="true"></i>
|
84 |
-
<input type="text"
|
85 |
-
name="search"
|
86 |
-
value="<?php echo esc_attr( $search_filter ); ?>"
|
87 |
-
placeholder="<?php esc_html_e( 'E.g. search', Forminator::DOMAIN ); ?>"
|
88 |
-
id="forminator-forms-filter--by-keyword"
|
89 |
-
class="sui-form-control"/>
|
90 |
-
</div>
|
91 |
-
|
92 |
-
</div>
|
93 |
-
|
94 |
-
</div>
|
95 |
-
|
96 |
-
<div class="sui-col-md-3">
|
97 |
-
|
98 |
-
<label for="forminator-forms-filter--sort-by" class="sui-label"><?php esc_html_e( 'Sort by', Forminator::DOMAIN ); ?></label>
|
99 |
-
<select id="forminator-forms-filter--sort-by" name="order_by">
|
100 |
-
<!-- <option value="">--><?php //esc_html_e( 'ID', Forminator::DOMAIN ); ?><!--</option>-->
|
101 |
-
<option value="entries.date_created" <?php selected( 'entries.date_created', $order_by ); ?> ><?php esc_html_e( 'Submissions Date', Forminator::DOMAIN ); ?></option>
|
102 |
-
</select>
|
103 |
-
|
104 |
-
</div>
|
105 |
-
|
106 |
-
<div class="sui-col-md-3">
|
107 |
-
|
108 |
-
<label for="forminator-forms-filter--sort-order" class="sui-label"><?php esc_html_e( 'Sort Order', Forminator::DOMAIN ); ?></label>
|
109 |
-
<select id="forminator-forms-filter--sort-order" name="order">
|
110 |
-
<option value="DESC" <?php selected( 'DESC', $order_filter ); ?>><?php esc_html_e( 'Descending', Forminator::DOMAIN ); ?></option>
|
111 |
-
<option value="ASC" <?php selected( 'ASC', $order_filter ); ?>><?php esc_html_e( 'Ascending', Forminator::DOMAIN ); ?></option>
|
112 |
-
</select>
|
113 |
-
|
114 |
-
</div>
|
115 |
-
|
116 |
-
</div>
|
117 |
-
|
118 |
-
<div class="sui-form-field">
|
119 |
-
|
120 |
-
<label class="sui-label"><?php esc_html_e( 'Display Fields', Forminator::DOMAIN ); ?></label>
|
121 |
-
|
122 |
-
<div class="sui-side-tabs forminator-field-select-tab">
|
123 |
-
|
124 |
-
<div class="sui-tabs-menu">
|
125 |
-
|
126 |
-
<label for="forminator-forms-filter--display-false" class="sui-tab-item <?php echo ( $this->fields_is_filtered ? '' : 'active' ); ?>" data-tab-index="1">
|
127 |
-
<input type="radio"
|
128 |
-
name="fields_select"
|
129 |
-
id="forminator-forms-filter--display-false"
|
130 |
-
value="false"/>
|
131 |
-
<?php esc_html_e( 'All', Forminator::DOMAIN ); ?>
|
132 |
-
</label>
|
133 |
-
|
134 |
-
<label for="forminator-forms-filter--display-true" class="sui-tab-item <?php echo ( $this->fields_is_filtered ? 'active' : '' ); ?>" data-tab-index="2">
|
135 |
-
<input type="radio"
|
136 |
-
name="fields_select"
|
137 |
-
id="forminator-forms-filter--display-true"
|
138 |
-
value="true"/>
|
139 |
-
<?php esc_html_e( 'Specified Fields', Forminator::DOMAIN ); ?>
|
140 |
-
</label>
|
141 |
-
|
142 |
-
</div>
|
143 |
-
|
144 |
-
<div class="sui-tabs-content">
|
145 |
-
|
146 |
-
<div class="sui-tab-content <?php echo ( $this->fields_is_filtered ? '' : 'active' ); ?>" data-tab-index="1">
|
147 |
-
</div>
|
148 |
-
<div class="sui-tab-content sui-tab-boxed <?php echo ( $this->fields_is_filtered ? 'active' : '' ); ?>" data-tab-index="2">
|
149 |
-
|
150 |
-
<fieldset class="forminator-entries-fields-filter" <?php echo ( $this->fields_is_filtered ? '' : 'disabled=disabled' ); ?>>
|
151 |
-
<?php
|
152 |
-
$ignored_field_types = Forminator_Form_Entry_Model::ignored_fields();
|
153 |
-
$fields = apply_filters( 'forminator_custom_form_filter_fields', $this->get_fields() );
|
154 |
-
|
155 |
-
foreach ( $fields as $field ) {
|
156 |
-
|
157 |
-
$label = $field->__get( 'field_label' );
|
158 |
-
$field_type = $field->__get( 'type' );
|
159 |
-
|
160 |
-
if ( in_array( $field_type, $ignored_field_types, true ) ) {
|
161 |
-
continue;
|
162 |
-
}
|
163 |
-
|
164 |
-
if ( ! $label ) {
|
165 |
-
$label = $field->title;
|
166 |
-
}
|
167 |
-
|
168 |
-
if ( empty( $label ) ) {
|
169 |
-
$label = ucfirst( $field_type );
|
170 |
-
}
|
171 |
-
|
172 |
-
$slug = isset( $field->slug ) ? $field->slug : sanitize_title( $label );
|
173 |
-
?>
|
174 |
-
|
175 |
-
<label class="sui-checkbox" for="<?php echo esc_attr( $slug ); ?>-enable">
|
176 |
-
<input type="checkbox"
|
177 |
-
name="field[]"
|
178 |
-
value="<?php echo esc_attr( $slug ); ?>"
|
179 |
-
id="<?php echo esc_attr( $slug ); ?>-enable"
|
180 |
-
<?php $this->checked_field( $slug ); ?> />
|
181 |
-
<span aria-hidden="true"></span>
|
182 |
-
<span class="sui-description"><?php echo esc_html( $label ); ?></span>
|
183 |
-
</label>
|
184 |
-
|
185 |
-
<?php } ?>
|
186 |
-
</fieldset>
|
187 |
-
|
188 |
-
</div>
|
189 |
-
|
190 |
-
</div>
|
191 |
-
|
192 |
-
</div>
|
193 |
-
|
194 |
-
</div>
|
195 |
-
|
196 |
-
<div class="sui-filter-footer">
|
197 |
-
|
198 |
-
<button class="sui-button sui-button-ghost forminator-entries-clear-filter"><?php esc_html_e( 'Clear Filters', Forminator::DOMAIN ); ?></button>
|
199 |
-
|
200 |
-
<div class="sui-actions-right">
|
201 |
-
<button class="sui-button forminator-entries-apply-filter" type="submit"><?php esc_html_e( 'Apply', Forminator::DOMAIN ); ?></button>
|
202 |
-
</div>
|
203 |
-
|
204 |
-
</div>
|
205 |
-
|
206 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/entries/header.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<h1 class="sui-header-title"><?php esc_html_e( 'Submissions', Forminator::DOMAIN ); ?></h1>
|
2 |
-
|
3 |
-
<div class="sui-actions-right">
|
4 |
-
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
5 |
-
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#submissions" target="_blank" class="sui-button sui-button-ghost">
|
6 |
-
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', Forminator::DOMAIN ); ?>
|
7 |
-
</a>
|
8 |
-
<?php endif; ?>
|
9 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/entries/popup/schedule-export-content.php
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
<div class="wpmudev-box-gray">
|
2 |
-
<form class="forminator_schedule_export" method="post">
|
3 |
-
<div id="forminator-export-schedule-timeframe" class="wpmudev-row">
|
4 |
-
|
5 |
-
<div class="wpmudev-col col-12 col-md-4">
|
6 |
-
|
7 |
-
<label><?php esc_html_e( 'Frequency', Forminator::DOMAIN ); ?></label>
|
8 |
-
|
9 |
-
<select class="wpmudev-select">
|
10 |
-
|
11 |
-
<option><?php esc_html_e( 'Daily', Forminator::DOMAIN ); ?></option>
|
12 |
-
<option><?php esc_html_e( 'Weekly', Forminator::DOMAIN ); ?></option>
|
13 |
-
<option><?php esc_html_e( 'Monthly', Forminator::DOMAIN ); ?></option>
|
14 |
-
|
15 |
-
</select>
|
16 |
-
|
17 |
-
</div>
|
18 |
-
|
19 |
-
<div class="wpmudev-col col-12 col-md-4">
|
20 |
-
|
21 |
-
<label><?php esc_html_e( 'Day of the week', Forminator::DOMAIN ); ?></label>
|
22 |
-
|
23 |
-
<select class="wpmudev-select">
|
24 |
-
|
25 |
-
<option><?php esc_html_e( 'Monday', Forminator::DOMAIN ); ?></option>
|
26 |
-
<option><?php esc_html_e( 'Tuesday', Forminator::DOMAIN ); ?></option>
|
27 |
-
<option><?php esc_html_e( 'Wednesday', Forminator::DOMAIN ); ?></option>
|
28 |
-
<option><?php esc_html_e( 'Thursday', Forminator::DOMAIN ); ?></option>
|
29 |
-
<option><?php esc_html_e( 'Friday', Forminator::DOMAIN ); ?></option>
|
30 |
-
<option><?php esc_html_e( 'Saturday', Forminator::DOMAIN ); ?></option>
|
31 |
-
<option><?php esc_html_e( 'Sunday', Forminator::DOMAIN ); ?></option>
|
32 |
-
|
33 |
-
</select>
|
34 |
-
|
35 |
-
</div>
|
36 |
-
|
37 |
-
<div class="wpmudev-col col-12 col-md-4">
|
38 |
-
|
39 |
-
<label><?php esc_html_e( 'Time of the day', Forminator::DOMAIN ); ?></label>
|
40 |
-
|
41 |
-
<select class="wpmudev-select">
|
42 |
-
|
43 |
-
<option>12:00 AM</option>
|
44 |
-
<option>01:00 AM</option>
|
45 |
-
<option>02:00 AM</option>
|
46 |
-
<option>03:00 AM</option>
|
47 |
-
<option>04:00 AM</option>
|
48 |
-
<option>05:00 AM</option>
|
49 |
-
<option>06:00 AM</option>
|
50 |
-
<option>07:00 AM</option>
|
51 |
-
<option>08:00 AM</option>
|
52 |
-
<option>09:00 AM</option>
|
53 |
-
<option>10:00 AM</option>
|
54 |
-
<option>11:00 AM</option>
|
55 |
-
<option>12:00 PM</option>
|
56 |
-
<option>01:00 PM</option>
|
57 |
-
<option>02:00 PM</option>
|
58 |
-
<option>03:00 PM</option>
|
59 |
-
<option>04:00 PM</option>
|
60 |
-
<option>05:00 PM</option>
|
61 |
-
<option>06:00 PM</option>
|
62 |
-
<option>07:00 PM</option>
|
63 |
-
<option>08:00 PM</option>
|
64 |
-
<option>09:00 PM</option>
|
65 |
-
<option>10:00 PM</option>
|
66 |
-
<option>11:00 PM</option>
|
67 |
-
|
68 |
-
</select>
|
69 |
-
|
70 |
-
</div>
|
71 |
-
|
72 |
-
</div>
|
73 |
-
|
74 |
-
<div id="forminator-export-schedule-email" class="wpmudev-row">
|
75 |
-
|
76 |
-
<div class="wpmudev-col col-12">
|
77 |
-
|
78 |
-
<label><?php esc_html_e( 'Email export data to', Forminator::DOMAIN ); ?></label>
|
79 |
-
|
80 |
-
<input type="email" class="wpmudev-input"
|
81 |
-
placeholder="<?php esc_html_e( 'admin@website.com', Forminator::DOMAIN ); ?>">
|
82 |
-
|
83 |
-
<label class="wpmudev-helper"><?php esc_html_e( "Leave blank if you don't want to receive exports via email.", Forminator::DOMAIN ); ?></label>
|
84 |
-
|
85 |
-
</div>
|
86 |
-
|
87 |
-
</div>
|
88 |
-
<?php wp_nonce_field( 'forminator_export_data', '_forminator_nonce' ); ?>
|
89 |
-
<button class="wpmudev-button wpmudev-button-blue" type="submit"><?php esc_html_e( 'Save Changes', Forminator::DOMAIN ); ?></button>
|
90 |
-
</form>
|
91 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/entries/prompt.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! FORMINATOR_PRO ) {
|
3 |
-
$submission = $this->filtered_total_entries();
|
4 |
-
$form_id = $this->get_form_id();
|
5 |
-
$notice_success = get_option( 'forminator_rating_success', false );
|
6 |
-
$notice_dismissed = get_option( 'forminator_rating_dismissed', false );
|
7 |
-
$submission_later = get_post_meta( $form_id, 'forminator_submission_rating_later' );
|
8 |
-
$submission_later_dismiss = get_post_meta( $form_id, 'forminator_submission_rating_later_dismiss' );
|
9 |
-
$live_payment_count = $this->has_live_payments( $form_id );
|
10 |
-
if ( ! $notice_dismissed && ! $notice_success ) {
|
11 |
-
if ( $this->has_payments() ) {
|
12 |
-
if ( ( 0 < $live_payment_count && 100 >= $submission && ! $submission_later ) ||
|
13 |
-
( 0 < $live_payment_count && 100 < $submission && ! $submission_later_dismiss ) ) { ?>
|
14 |
-
<div class="forminator-rating-notice sui-notice sui-notice-purple fui-notice-rate<?php echo forminator_is_show_branding() ? '' : ' fui-unbranded'; ?>"
|
15 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
16 |
-
<?php if ( $submission <= 100 ) { ?>
|
17 |
-
<p><?php printf( esc_html__( "%1\$sCongratulations!%2\$s You have started collecting live payments on this form - that's awesome. We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", Forminator::DOMAIN ), '<strong>', '</strong>' ); ?></p>
|
18 |
-
<?php } else { ?>
|
19 |
-
<p><?php printf( esc_html__( "Hey, we noticed you just crossed %1\$s 100 submissions%2\$s on this form - that's awesome! We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", Forminator::DOMAIN ), '<strong> ', '</strong>' ); ?></p>
|
20 |
-
<?php } ?>
|
21 |
-
<p>
|
22 |
-
<a type="button" href="#" target="_blank"
|
23 |
-
class="sui-button sui-button-purple"
|
24 |
-
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator', Forminator::DOMAIN ); ?></a>
|
25 |
-
|
26 |
-
<button type="button"
|
27 |
-
class="sui-button sui-button-ghost"
|
28 |
-
data-prop="<?php echo 100 > $live_payment_count ? 'forminator_submission_rating_later' : 'forminator_submission_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later', Forminator::DOMAIN ); ?></button>
|
29 |
-
|
30 |
-
<a href="#" style="color: #888;"
|
31 |
-
data-prop="forminator_rating_dismissed"
|
32 |
-
data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks', Forminator::DOMAIN ); ?></a>
|
33 |
-
</p>
|
34 |
-
|
35 |
-
</div>
|
36 |
-
<?php }
|
37 |
-
} else {
|
38 |
-
if ( ( ( 10 < $submission && 100 >= $submission ) && ! $submission_later )
|
39 |
-
|| ( 100 < $submission && ! $submission_later_dismiss ) ) {
|
40 |
-
$milestone = ( 100 >= $submission ) ? 10 : 100;
|
41 |
-
?>
|
42 |
-
<div class="forminator-rating-notice sui-notice sui-notice-purple fui-notice-rate<?php echo forminator_is_show_branding() ? '' : ' fui-unbranded'; ?>"
|
43 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_dismiss_notification' ) ); ?>">
|
44 |
-
|
45 |
-
<p><?php printf( esc_html__( "Hey, we noticed you just crossed %1\$s submissions%2\$s on this form - that's awesome! We have spent countless hours developing this free plugin for you, and we would really appreciate it if you could drop us a rating on wp.org to help us spread the word and boost our motivation.", Forminator::DOMAIN ), '<strong> ' . $milestone, '</strong>' ); ?></p>
|
46 |
-
<p>
|
47 |
-
<a type="button" href="#" target="_blank"
|
48 |
-
class="sui-button sui-button-purple"
|
49 |
-
data-prop="forminator_rating_success"><?php esc_html_e( 'Rate Forminator', Forminator::DOMAIN ); ?></a>
|
50 |
-
|
51 |
-
<button type="button"
|
52 |
-
class="sui-button sui-button-ghost"
|
53 |
-
data-prop="<?php echo 100 > $submission ? 'forminator_submission_rating_later' : 'forminator_submission_rating_later_dismiss'; ?>"><?php esc_html_e( 'Maybe later', Forminator::DOMAIN ); ?></button>
|
54 |
-
|
55 |
-
<a href="#" style="color: #888;"
|
56 |
-
data-prop="forminator_rating_dismissed"
|
57 |
-
data-prop="forminator_rating_dismissed"><?php esc_html_e( 'No Thanks', Forminator::DOMAIN ); ?></a>
|
58 |
-
</p>
|
59 |
-
|
60 |
-
</div>
|
61 |
-
<?php }
|
62 |
-
} ?>
|
63 |
-
<script type="text/javascript">
|
64 |
-
var ajaxUrl = '<?php echo forminator_ajax_url(); ?>';
|
65 |
-
jQuery('.forminator-rating-notice a').on('click', function (e) {
|
66 |
-
e.preventDefault();
|
67 |
-
|
68 |
-
var $notice = jQuery(e.currentTarget).closest('.forminator-rating-notice'),
|
69 |
-
prop = jQuery(this).data('prop');
|
70 |
-
|
71 |
-
if ('forminator_rating_success' === prop) {
|
72 |
-
window.open('https://wordpress.org/support/plugin/forminator/reviews/#new-post', '_blank');
|
73 |
-
}
|
74 |
-
|
75 |
-
jQuery.post(
|
76 |
-
ajaxUrl,
|
77 |
-
{
|
78 |
-
action: 'forminator_dismiss_notification',
|
79 |
-
prop: prop,
|
80 |
-
_ajax_nonce: $notice.data('nonce')
|
81 |
-
}
|
82 |
-
).always(function () {
|
83 |
-
$notice.hide();
|
84 |
-
});
|
85 |
-
});
|
86 |
-
jQuery('.forminator-rating-notice button').on('click', function (e) {
|
87 |
-
e.preventDefault();
|
88 |
-
|
89 |
-
var $notice = jQuery(e.currentTarget).closest('.forminator-rating-notice'),
|
90 |
-
prop = jQuery(this).data('prop');
|
91 |
-
|
92 |
-
jQuery.post(
|
93 |
-
ajaxUrl,
|
94 |
-
{
|
95 |
-
action: 'forminator_later_notification',
|
96 |
-
prop: prop,
|
97 |
-
form_id: <?php echo $form_id; ?>,
|
98 |
-
_ajax_nonce: $notice.data('nonce')
|
99 |
-
}
|
100 |
-
).always(function () {
|
101 |
-
$notice.hide();
|
102 |
-
});
|
103 |
-
});
|
104 |
-
</script>
|
105 |
-
<?php
|
106 |
-
} ?>
|
107 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/list/content.php
CHANGED
@@ -4,672 +4,36 @@
|
|
4 |
// Search keyword
|
5 |
$search_keyword = null;
|
6 |
$is_search = false;
|
7 |
-
$
|
8 |
-
if ( isset( $_GET['search'] ) && check_admin_referer( $
|
9 |
$search_keyword = sanitize_text_field( $_GET['search'] );
|
10 |
$is_search = true;
|
11 |
}
|
12 |
|
13 |
-
// Search no results image
|
14 |
-
$search_empty = forminator_plugin_url() . 'assets/images/forminator-no-result.png';
|
15 |
-
$search_empty2x = forminator_plugin_url() . 'assets/images/forminator-no-result@2x.png';
|
16 |
-
|
17 |
// Get modules
|
18 |
$modules = $this->getModules( $search_keyword );
|
19 |
|
20 |
-
// Empty message
|
21 |
-
$image_empty = forminator_plugin_url() . 'assets/images/forminator-empty-message.png';
|
22 |
-
$image_empty2x = forminator_plugin_url() . 'assets/images/forminator-empty-message@2x.png';
|
23 |
-
|
24 |
// Count total forms
|
25 |
$count = ! $is_search ? $this->countModules() : count( $modules );
|
26 |
-
$count_active = $this->countModules( 'publish' );
|
27 |
-
|
28 |
-
// available bulk actions
|
29 |
-
$bulk_actions = $this->bulk_actions();
|
30 |
|
31 |
// Start date for retrieving the information of the last 30 days in sql format
|
32 |
$sql_month_start_date = date( 'Y-m-d H:i:s', strtotime( '-30 days midnight' ) );// phpcs:ignore
|
33 |
|
34 |
-
|
35 |
-
$
|
36 |
-
|
37 |
-
$
|
38 |
-
|
39 |
-
|
40 |
-
<?php if ( $count > 0 || $is_search ) { ?>
|
41 |
-
|
42 |
-
<div class="sui-box sui-summary sui-summary-sm <?php echo esc_attr( $this->get_box_summary_classes() ); ?>">
|
43 |
-
|
44 |
-
<div class="sui-summary-image-space" aria-hidden="true" style="<?php echo esc_attr( $this->get_box_summary_image_style() ); ?>"></div>
|
45 |
-
|
46 |
-
<div class="sui-summary-segment">
|
47 |
-
|
48 |
-
<div class="sui-summary-details">
|
49 |
-
|
50 |
-
<span class="sui-summary-large"><?php echo esc_html( $count_active ); ?></span>
|
51 |
-
|
52 |
-
<span class="sui-summary-sub"><?php printf( esc_html( _n( 'Active Form', 'Active Forms', esc_html( $count_active ), Forminator::DOMAIN ) ), esc_html( $count_active ) ); ?></span>
|
53 |
-
|
54 |
-
<form action="" method="get" id="forminator-search-custom-forms" class="forminator-search-modules">
|
55 |
-
|
56 |
-
<div class="sui-row">
|
57 |
-
|
58 |
-
<div class="sui-col-lg-10 sui-col-md-12">
|
59 |
-
|
60 |
-
<div class="sui-form-field">
|
61 |
-
|
62 |
-
<div class="sui-control-with-icon">
|
63 |
-
<button class="forminator-search-submit"><i class="sui-icon-magnifying-glass-search"></i></button>
|
64 |
-
<input type="text" name="search" value="<?php esc_attr_e( $search_keyword ); ?>" placeholder="<?php esc_attr_e( 'Search form...', Forminator::DOMAIN ); ?>" id="forminator-custom-form-search" class="sui-form-control">
|
65 |
-
</div>
|
66 |
-
|
67 |
-
</div>
|
68 |
-
|
69 |
-
</div>
|
70 |
-
|
71 |
-
</div>
|
72 |
-
|
73 |
-
<input type="hidden" name="page" value="forminator-cform" />
|
74 |
-
<?php
|
75 |
-
wp_nonce_field( $search_customform_nonce, $search_customform_nonce, false );
|
76 |
-
?>
|
77 |
-
|
78 |
-
</form>
|
79 |
-
|
80 |
-
</div>
|
81 |
-
|
82 |
-
</div>
|
83 |
-
|
84 |
-
<div class="sui-summary-segment">
|
85 |
-
|
86 |
-
<ul class="sui-list">
|
87 |
-
|
88 |
-
<li>
|
89 |
-
<span class="sui-list-label"><?php esc_html_e( 'Last Submission', Forminator::DOMAIN ); ?></span>
|
90 |
-
<span class="sui-list-detail"><?php echo esc_html( forminator_get_latest_entry_time( 'custom-forms' ) ); ?></span>
|
91 |
-
</li>
|
92 |
-
|
93 |
-
<li>
|
94 |
-
<span class="sui-list-label"><?php esc_html_e( 'Submissions in the last 30 days', Forminator::DOMAIN ); ?></span>
|
95 |
-
<span class="sui-list-detail"><?php echo esc_html( $total_entries_from_last_month ); ?></span>
|
96 |
-
</li>
|
97 |
-
<li>
|
98 |
-
<span class="sui-list-label"><?php esc_html_e( 'Most submissions', Forminator::DOMAIN ); ?></span>
|
99 |
-
<span class="sui-list-detail">
|
100 |
-
<?php if ( ! empty( $most_entry ) && get_post_status( $most_entry->form_id ) && 0 !== (int) $most_entry->entry_count ) { ?>
|
101 |
-
<a href="<?php echo esc_url( admin_url( 'admin.php?page=forminator-cform-wizard&id=' . $most_entry->form_id ) ); ?>">
|
102 |
-
<?php echo esc_html( forminator_get_form_name( $most_entry->form_id, 'custom_form' ) ); ?>
|
103 |
-
</a>
|
104 |
-
<?php
|
105 |
-
} else {
|
106 |
-
echo esc_html( '—' );
|
107 |
-
}
|
108 |
-
?>
|
109 |
-
</span>
|
110 |
-
</li>
|
111 |
-
</ul>
|
112 |
-
|
113 |
-
</div>
|
114 |
-
|
115 |
-
</div>
|
116 |
-
|
117 |
-
<?php } ?>
|
118 |
-
|
119 |
-
<?php if ( $count > 0 ) { ?>
|
120 |
-
|
121 |
-
<!-- START: Bulk actions and pagination -->
|
122 |
-
<div class="fui-listings-pagination">
|
123 |
-
|
124 |
-
<div class="fui-pagination-mobile sui-pagination-wrap">
|
125 |
-
|
126 |
-
<span class="sui-pagination-results"><?php /* translators: ... */ echo esc_html( sprintf( _n( '%s result', '%s results', $count, Forminator::DOMAIN ), $count ) ); ?></span>
|
127 |
-
|
128 |
-
<?php $this->pagination( $is_search ); ?>
|
129 |
-
|
130 |
-
</div>
|
131 |
-
|
132 |
-
<div class="fui-pagination-desktop sui-box">
|
133 |
-
|
134 |
-
<div class="sui-box-search">
|
135 |
-
|
136 |
-
<form method="post" name="bulk-action-form" class="sui-search-left"
|
137 |
-
style="display: flex; align-items: center;">
|
138 |
-
|
139 |
-
<?php wp_nonce_field( 'forminatorCustomFormRequest', 'forminatorNonce' ); ?>
|
140 |
-
|
141 |
-
<input type="hidden" name="ids" value="" />
|
142 |
-
|
143 |
-
<label for="forminator-check-all-modules" class="sui-checkbox">
|
144 |
-
<input type="checkbox" id="forminator-check-all-modules">
|
145 |
-
<span aria-hidden="true"></span>
|
146 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Select all', Forminator::DOMAIN ); ?></span>
|
147 |
-
</label>
|
148 |
-
|
149 |
-
<select class="sui-select-sm sui-select-inline fui-select-listing-actions" name="forminator_action">
|
150 |
-
<option value=""><?php esc_html_e( 'Bulk Action', Forminator::DOMAIN ); ?></option>
|
151 |
-
<?php foreach ( $bulk_actions as $val => $label ) : ?>
|
152 |
-
<option value="<?php echo esc_attr( $val ); ?>"><?php echo esc_html( $label ); ?></option>
|
153 |
-
<?php endforeach; ?>
|
154 |
-
</select>
|
155 |
-
|
156 |
-
<button class="sui-button"><?php esc_html_e( 'Apply', Forminator::DOMAIN ); ?></button>
|
157 |
-
|
158 |
-
</form>
|
159 |
-
|
160 |
-
<div class="sui-search-right">
|
161 |
-
|
162 |
-
<div class="sui-pagination-wrap">
|
163 |
-
<span class="sui-pagination-results"><?php /* translators: ... */ echo esc_html( sprintf( _n( '%s result', '%s results', $count, Forminator::DOMAIN ), $count ) ); ?></span>
|
164 |
-
<?php $this->pagination( $is_search ); ?>
|
165 |
-
</div>
|
166 |
-
|
167 |
-
</div>
|
168 |
-
|
169 |
-
</div>
|
170 |
-
|
171 |
-
</div>
|
172 |
-
|
173 |
-
</div>
|
174 |
-
<!-- END: Bulk actions and pagination -->
|
175 |
-
|
176 |
-
<div class="sui-accordion sui-accordion-block" id="forminator-modules-list">
|
177 |
-
|
178 |
-
<?php
|
179 |
-
foreach ( $modules as $module ) {
|
180 |
-
$module_entries_from_last_month = 0 !== $module['entries'] ? count( Forminator_Form_Entry_Model::get_newer_entry_ids_of_form_id( $module['id'], $sql_month_start_date ) ) : 0;
|
181 |
-
$opened_class = '';
|
182 |
-
$opened_chart = '';
|
183 |
-
|
184 |
-
if( isset( $_GET['view-stats'] ) && intval( $_GET['view-stats'] ) === intval( $module['id'] ) ) { // phpcs:ignore
|
185 |
-
$opened_class = ' sui-accordion-item--open forminator-scroll-to';
|
186 |
-
$opened_chart = ' sui-chartjs-loaded';
|
187 |
-
}
|
188 |
-
?>
|
189 |
-
|
190 |
-
<div class="sui-accordion-item<?php echo esc_attr( $opened_class ); ?>">
|
191 |
-
|
192 |
-
<div class="sui-accordion-item-header">
|
193 |
-
|
194 |
-
<div class="sui-accordion-item-title sui-trim-title">
|
195 |
-
|
196 |
-
<label for="wpf-module-<?php echo esc_attr( $module['id'] ); ?>" class="sui-checkbox sui-accordion-item-action">
|
197 |
-
<input type="checkbox" id="wpf-module-<?php echo esc_attr( $module['id'] ); ?>" value="<?php echo esc_html( $module['id'] ); ?>">
|
198 |
-
<span aria-hidden="true"></span>
|
199 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Select this form', Forminator::DOMAIN ); ?></span>
|
200 |
-
</label>
|
201 |
-
|
202 |
-
<span class="sui-trim-text"><?php echo htmlspecialchars( forminator_get_form_name( $module['id'], 'custom_form' ) );// phpcs:ignore ?></span>
|
203 |
-
|
204 |
-
<?php
|
205 |
-
if ( 'publish' === $module['status'] ) {
|
206 |
-
echo '<span class="sui-tag sui-tag-blue">' . esc_html__( 'Published', Forminator::DOMAIN ) . '</span>';
|
207 |
-
}
|
208 |
-
?>
|
209 |
-
|
210 |
-
<?php
|
211 |
-
if ( 'draft' === $module['status'] ) {
|
212 |
-
echo '<span class="sui-tag">' . esc_html__( 'Draft', Forminator::DOMAIN ) . '</span>';
|
213 |
-
}
|
214 |
-
?>
|
215 |
-
|
216 |
-
</div>
|
217 |
-
|
218 |
-
<div class="sui-accordion-item-date"><strong><?php esc_html_e( 'Last Submission', Forminator::DOMAIN ); ?></strong> <?php echo esc_html( $module['last_entry_time'] ); ?></div>
|
219 |
-
|
220 |
-
<div class="sui-accordion-col-auto">
|
221 |
-
|
222 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-cform-wizard&id=' . $module['id'] ); // phpcs:ignore ?>"
|
223 |
-
class="sui-button sui-button-ghost sui-accordion-item-action sui-desktop-visible">
|
224 |
-
<i class="sui-icon-pencil" aria-hidden="true"></i> <?php esc_html_e( 'Edit', Forminator::DOMAIN ); ?>
|
225 |
-
</a>
|
226 |
-
|
227 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-cform-wizard&id=' . $module['id'] ); // phpcs:ignore ?>"
|
228 |
-
class="sui-button-icon sui-accordion-item-action sui-mobile-visible">
|
229 |
-
<i class="sui-icon-pencil" aria-hidden="true"></i>
|
230 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Edit', Forminator::DOMAIN ); ?></span>
|
231 |
-
</a>
|
232 |
-
|
233 |
-
<div class="sui-dropdown sui-accordion-item-action">
|
234 |
-
|
235 |
-
<button class="sui-button-icon sui-dropdown-anchor">
|
236 |
-
<i class="sui-icon-widget-settings-config" aria-hidden="true"></i>
|
237 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Open list settings', Forminator::DOMAIN ); ?></span>
|
238 |
-
</button>
|
239 |
-
|
240 |
-
<ul>
|
241 |
-
|
242 |
-
<li><a href="#"
|
243 |
-
class="wpmudev-open-modal"
|
244 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_preview_cforms' ) ); ?>"
|
245 |
-
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
246 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
247 |
-
data-modal="preview_cforms"
|
248 |
-
data-modal-title="<?php echo sprintf( '%s - %s', esc_html__( 'Preview Custom Form', Forminator::DOMAIN ), htmlspecialchars( htmlspecialchars( forminator_get_form_name( $module['id'], 'custom_form' ) ) ) ); // phpcs:ignore ?>">
|
249 |
-
<i class="sui-icon-eye" aria-hidden="true"></i> <?php esc_html_e( 'Preview', Forminator::DOMAIN ); ?>
|
250 |
-
</a></li>
|
251 |
-
|
252 |
-
<li>
|
253 |
-
<button class="copy-clipboard" data-shortcode='[forminator_form id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', Forminator::DOMAIN ); ?></button>
|
254 |
-
</li>
|
255 |
-
|
256 |
-
<?php if ( 'publish' === $module['status'] ) { ?>
|
257 |
-
|
258 |
-
<li>
|
259 |
-
<form method="post">
|
260 |
-
<input type="hidden" name="forminator_action" value="update-status">
|
261 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
262 |
-
<input type="hidden" name="status" value="draft"/>
|
263 |
-
<?php
|
264 |
-
$update_status_nonce = esc_attr( 'forminator-nonce-update-status-' . $module['id'] );
|
265 |
-
wp_nonce_field( $update_status_nonce, $update_status_nonce );
|
266 |
-
?>
|
267 |
-
<button type="submit">
|
268 |
-
<i class="sui-icon-unpublish" aria-hidden="true"></i> <?php esc_html_e( 'Unpublish', Forminator::DOMAIN ); ?>
|
269 |
-
</button>
|
270 |
-
</form>
|
271 |
-
</li>
|
272 |
-
|
273 |
-
<?php } ?>
|
274 |
-
|
275 |
-
<?php if ( 'draft' === $module['status'] ) { ?>
|
276 |
-
|
277 |
-
<li>
|
278 |
-
<form method="post">
|
279 |
-
<input type="hidden" name="forminator_action" value="update-status">
|
280 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
281 |
-
<input type="hidden" name="status" value="publish"/>
|
282 |
-
<?php
|
283 |
-
$update_status_nonce = esc_attr( 'forminator-nonce-update-status-' . $module['id'] );
|
284 |
-
wp_nonce_field( $update_status_nonce, $update_status_nonce );
|
285 |
-
?>
|
286 |
-
<button type="submit">
|
287 |
-
<i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Publish', Forminator::DOMAIN ); ?>
|
288 |
-
</button>
|
289 |
-
</form>
|
290 |
-
</li>
|
291 |
-
|
292 |
-
<li><button>
|
293 |
-
|
294 |
-
</button></li>
|
295 |
-
|
296 |
-
<?php } ?>
|
297 |
|
298 |
-
|
299 |
-
<i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', Forminator::DOMAIN ); ?>
|
300 |
-
</a></li>
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
307 |
-
wp_nonce_field( $clone_nonce, $clone_nonce );
|
308 |
-
?>
|
309 |
-
<button type="submit">
|
310 |
-
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', Forminator::DOMAIN ); ?>
|
311 |
-
</button>
|
312 |
-
</form></li>
|
313 |
-
|
314 |
-
<li>
|
315 |
-
<button
|
316 |
-
class="wpmudev-open-modal"
|
317 |
-
data-modal="delete-module"
|
318 |
-
data-modal-title="<?php esc_attr_e( 'Reset Tracking Data', Forminator::DOMAIN ); ?>"
|
319 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish reset the tracking data of this form?', Forminator::DOMAIN ); ?>"
|
320 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
321 |
-
data-action="reset-views"
|
322 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator-nonce-reset-views-' . $module['id'] ) ); ?>"
|
323 |
-
>
|
324 |
-
<i class="sui-icon-update" aria-hidden="true"></i> <?php esc_html_e( 'Reset Tracking data', Forminator::DOMAIN ); ?>
|
325 |
-
</button>
|
326 |
-
</li>
|
327 |
-
|
328 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
329 |
-
|
330 |
-
<li><a href="#"
|
331 |
-
class="wpmudev-open-modal"
|
332 |
-
data-modal="export_cform"
|
333 |
-
data-modal-title=""
|
334 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
335 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_cform' ) ); ?>">
|
336 |
-
<i class="sui-icon-cloud-migration" aria-hidden="true"></i> <?php esc_html_e( 'Export', Forminator::DOMAIN ); ?>
|
337 |
-
</a></li>
|
338 |
-
|
339 |
-
<?php endif; ?>
|
340 |
-
|
341 |
-
<li>
|
342 |
-
<button
|
343 |
-
class="sui-option-red wpmudev-open-modal"
|
344 |
-
data-modal="delete-module"
|
345 |
-
data-modal-title="<?php esc_attr_e( 'Delete Form', Forminator::DOMAIN ); ?>"
|
346 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this form?', Forminator::DOMAIN ); ?>"
|
347 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
348 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminatorCustomFormRequest' ) ); ?>"
|
349 |
-
>
|
350 |
-
<i class="sui-icon-trash" aria-hidden="true"></i> <?php esc_html_e( 'Delete', Forminator::DOMAIN ); ?>
|
351 |
-
</button>
|
352 |
-
</li>
|
353 |
-
|
354 |
-
</ul>
|
355 |
-
|
356 |
-
</div>
|
357 |
-
|
358 |
-
<button class="sui-button-icon sui-accordion-open-indicator" aria-label="<?php esc_html_e( 'Open item', Forminator::DOMAIN ); ?>"><i class="sui-icon-chevron-down" aria-hidden="true"></i></button>
|
359 |
-
|
360 |
-
</div>
|
361 |
-
|
362 |
-
</div>
|
363 |
-
|
364 |
-
<div class="sui-accordion-item-body">
|
365 |
-
|
366 |
-
<ul class="sui-accordion-item-data">
|
367 |
-
|
368 |
-
<li data-col="large">
|
369 |
-
<strong><?php esc_html_e( 'Last Submission', Forminator::DOMAIN ); ?></strong>
|
370 |
-
<span><?php echo esc_html( $module['last_entry_time'] ); ?></span>
|
371 |
-
</li>
|
372 |
-
|
373 |
-
<li data-col="small">
|
374 |
-
<strong><?php esc_html_e( 'Views', Forminator::DOMAIN ); ?></strong>
|
375 |
-
<span><?php echo esc_html( $module['views'] ); ?></span>
|
376 |
-
</li>
|
377 |
-
|
378 |
-
<li>
|
379 |
-
<strong><?php esc_html_e( 'Submissions', Forminator::DOMAIN ); ?></strong>
|
380 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-cform-view&form_id=' . $module['id'] ); // phpcs:ignore ?>"><?php echo esc_html( $module['entries'] ); ?></a>
|
381 |
-
</li>
|
382 |
-
|
383 |
-
<li>
|
384 |
-
<strong><?php esc_html_e( 'Conversion Rate', Forminator::DOMAIN ); ?></strong>
|
385 |
-
<span><?php echo esc_html( $this->getRate( $module ) ); ?>%</span>
|
386 |
-
</li>
|
387 |
-
|
388 |
-
</ul>
|
389 |
-
|
390 |
-
<div class="sui-chartjs sui-chartjs-animated<?php echo esc_attr( $opened_chart ); ?>" data-chart-id="<?php echo esc_attr( $module['id'] ); ?>">
|
391 |
-
|
392 |
-
<div class="sui-chartjs-message sui-chartjs-message--loading">
|
393 |
-
<p><i class="sui-icon-loader sui-loading" aria-hidden="true"></i> <?php esc_html_e( 'Loading data...', Forminator::DOMAIN ); ?></p>
|
394 |
-
</div>
|
395 |
-
|
396 |
-
<?php if ( 0 === $module['entries'] ) { ?>
|
397 |
-
|
398 |
-
<div class="sui-chartjs-message sui-chartjs-message--empty">
|
399 |
-
<p><i class="sui-icon-info" aria-hidden="true"></i> <?php esc_html_e( "Your form doesn't have any submissions yet. Try again in a moment.", Forminator::DOMAIN ); ?></p>
|
400 |
-
</div>
|
401 |
-
|
402 |
-
<?php } else { ?>
|
403 |
-
|
404 |
-
<?php if ( 0 === $module_entries_from_last_month ) { ?>
|
405 |
-
|
406 |
-
<?php
|
407 |
-
if ( 'draft' === $module['status'] ) {
|
408 |
-
$message = esc_html__( "This form is in draft state, so we've paused collecting data until you publish it live.", Forminator::DOMAIN );
|
409 |
-
} else {
|
410 |
-
$message = esc_html__( "Your form didn't collect submissions the past 30 days.", Forminator::DOMAIN );
|
411 |
-
}
|
412 |
-
?>
|
413 |
-
|
414 |
-
<div class="sui-chartjs-message sui-chartjs-message--empty">
|
415 |
-
<p><i class="sui-icon-info" aria-hidden="true"></i> <?php echo esc_html( $message ); ?></p>
|
416 |
-
</div>
|
417 |
-
|
418 |
-
<?php } else { ?>
|
419 |
-
|
420 |
-
<?php if ( 'draft' === $module['status'] ) { ?>
|
421 |
-
|
422 |
-
<div class="sui-chartjs-message">
|
423 |
-
<p><i class="sui-icon-info" aria-hidden="true"></i> <?php esc_html_e( "This form is in draft state, so we've paused collecting data until you publish it live.", Forminator::DOMAIN ); ?></p>
|
424 |
-
</div>
|
425 |
-
|
426 |
-
<?php } ?>
|
427 |
-
|
428 |
-
<?php } ?>
|
429 |
-
|
430 |
-
<?php } ?>
|
431 |
-
|
432 |
-
<div class="sui-chartjs-canvas">
|
433 |
-
|
434 |
-
<?php if ( ( 0 !== $module['entries'] ) || ( 0 !== $module_entries_from_last_month ) ) { ?>
|
435 |
-
<canvas id="forminator-form-<?php echo $module['id']; // phpcs:ignore ?>-stats"></canvas>
|
436 |
-
<?php } ?>
|
437 |
-
|
438 |
-
</div>
|
439 |
-
|
440 |
-
</div>
|
441 |
-
|
442 |
-
</div>
|
443 |
-
|
444 |
-
</div>
|
445 |
-
|
446 |
-
<?php } ?>
|
447 |
-
|
448 |
-
</div>
|
449 |
-
|
450 |
-
<?php } else { ?>
|
451 |
-
|
452 |
-
<div class="sui-box sui-message sui-message-lg">
|
453 |
-
|
454 |
-
<?php if ( forminator_is_show_branding() ) : ?>
|
455 |
-
<?php if ( ! $is_search ) : ?>
|
456 |
-
|
457 |
-
<img src="<?php echo esc_url( $image_empty ); ?>"
|
458 |
-
srcset="<?php echo esc_url( $image_empty2x ); ?> 1x, <?php echo esc_url( $image_empty2x ); ?> 2x"
|
459 |
-
alt="<?php esc_html_e( 'Empty forms', Forminator::DOMAIN ); ?>"
|
460 |
-
class="sui-image sui-image-center"
|
461 |
-
aria-hidden="true"/>
|
462 |
-
|
463 |
-
<?php else: ?>
|
464 |
-
|
465 |
-
<img src="<?php echo esc_url( $search_empty ); ?>"
|
466 |
-
srcset="<?php echo esc_url( $search_empty2x ); ?> 1x, <?php echo esc_url( $search_empty2x ); ?> 2x"
|
467 |
-
alt="<?php esc_html_e( 'No results', Forminator::DOMAIN ); ?>"
|
468 |
-
class="sui-image sui-image-center"
|
469 |
-
aria-hidden="true"/>
|
470 |
-
|
471 |
-
<?php endif; ?>
|
472 |
-
<?php endif; ?>
|
473 |
-
|
474 |
-
<div class="sui-message-content">
|
475 |
-
|
476 |
-
<?php if ( ! $is_search ) : ?>
|
477 |
-
|
478 |
-
<p><?php esc_html_e( 'Create custom forms for all your needs with as many fields as you like. From contact forms to quote requests and everything in between.', Forminator::DOMAIN ); ?></p>
|
479 |
-
|
480 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
481 |
-
|
482 |
-
<p>
|
483 |
-
<button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="custom_forms"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?></button>
|
484 |
-
|
485 |
-
<a href="#"
|
486 |
-
class="sui-button wpmudev-open-modal"
|
487 |
-
data-modal="import_cform"
|
488 |
-
data-modal-title=""
|
489 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_import_cform' ) ); ?>"><i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Import', Forminator::DOMAIN ); ?></a>
|
490 |
-
</p>
|
491 |
-
|
492 |
-
<?php else : ?>
|
493 |
-
|
494 |
-
<p><button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="custom_forms">
|
495 |
-
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?>
|
496 |
-
</button></p>
|
497 |
-
|
498 |
-
<?php endif; ?>
|
499 |
-
|
500 |
-
<?php else: // Search no-result message ?>
|
501 |
-
|
502 |
-
<h2><?php
|
503 |
-
echo sprintf(
|
504 |
-
'%s "%s"',
|
505 |
-
esc_html__( 'No results for', Forminator::DOMAIN ),
|
506 |
-
esc_html( $search_keyword )
|
507 |
-
);
|
508 |
-
?></h2>
|
509 |
-
|
510 |
-
<p><?php esc_html_e( "We couldn't find any forms matching your search keyword. Perhaps try again?", Forminator::DOMAIN ); ?></p>
|
511 |
-
|
512 |
-
<?php endif; ?>
|
513 |
-
|
514 |
-
</div>
|
515 |
-
|
516 |
-
</div>
|
517 |
-
|
518 |
-
<?php } ?>
|
519 |
-
|
520 |
-
<?php
|
521 |
-
$days_array = array();
|
522 |
-
$default_array = array();
|
523 |
-
|
524 |
-
for ( $h = 30; $h >= 0; $h-- ) {
|
525 |
-
$time = strtotime( '-' . $h . ' days' );
|
526 |
-
$date = date( 'Y-m-d', $time );// phpcs:ignore
|
527 |
-
$default_array[ $date ] = 0;
|
528 |
-
$days_array[] = date( 'M j, Y', $time );// phpcs:ignore
|
529 |
}
|
530 |
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
} else {
|
536 |
-
$submissions = Forminator_Form_Entry_Model::get_form_latest_entries_count_grouped_by_day( $module['id'], $sql_month_start_date );
|
537 |
-
$submissions_array = wp_list_pluck( $submissions, 'entries_amount', 'date_created' );
|
538 |
-
$submissions_data = array_merge( $default_array, array_intersect_key( $submissions_array, $default_array ) );
|
539 |
-
}
|
540 |
-
|
541 |
-
// Get highest value
|
542 |
-
$highest_submission = max( $submissions_data );
|
543 |
-
|
544 |
-
// Calculate canvas top spacing
|
545 |
-
$canvas_top_spacing = $highest_submission + 8;
|
546 |
-
?>
|
547 |
-
|
548 |
-
<script>
|
549 |
-
|
550 |
-
var ctx = document.getElementById( 'forminator-form-<?php echo $module['id']; // phpcs:ignore ?>-stats' );
|
551 |
-
|
552 |
-
var monthDays = [ '<?php echo implode( "', '", $days_array ); // phpcs:ignore ?>' ],
|
553 |
-
submissions = [ <?php echo implode( ', ', $submissions_data ); // phpcs:ignore ?> ]
|
554 |
-
;
|
555 |
-
|
556 |
-
var chartData = {
|
557 |
-
labels: monthDays,
|
558 |
-
datasets: [{
|
559 |
-
label: '<?php esc_html_e( 'Submissions', Forminator::DOMAIN ); ?>',
|
560 |
-
data: submissions,
|
561 |
-
backgroundColor: [
|
562 |
-
'#E1F6FF'
|
563 |
-
],
|
564 |
-
borderColor: [
|
565 |
-
'#17A8E3'
|
566 |
-
],
|
567 |
-
borderWidth: 2,
|
568 |
-
pointRadius: 0,
|
569 |
-
pointHitRadius: 20,
|
570 |
-
pointHoverRadius: 5,
|
571 |
-
pointHoverBorderColor: '#17A8E3',
|
572 |
-
pointHoverBackgroundColor: '#17A8E3'
|
573 |
-
}]
|
574 |
-
};
|
575 |
-
|
576 |
-
var chartOptions = {
|
577 |
-
maintainAspectRatio: false,
|
578 |
-
legend: {
|
579 |
-
display: false
|
580 |
-
},
|
581 |
-
scales: {
|
582 |
-
xAxes: [{
|
583 |
-
display: false,
|
584 |
-
gridLines: {
|
585 |
-
color: 'rgba(0, 0, 0, 0)'
|
586 |
-
}
|
587 |
-
}],
|
588 |
-
yAxes: [{
|
589 |
-
display: false,
|
590 |
-
gridLines: {
|
591 |
-
color: 'rgba(0, 0, 0, 0)'
|
592 |
-
},
|
593 |
-
ticks: {
|
594 |
-
beginAtZero: false,
|
595 |
-
min: 0,
|
596 |
-
max: <?php echo esc_attr( $canvas_top_spacing ); ?>,
|
597 |
-
stepSize: 1
|
598 |
-
}
|
599 |
-
}]
|
600 |
-
},
|
601 |
-
elements: {
|
602 |
-
line: {
|
603 |
-
tension: 0
|
604 |
-
},
|
605 |
-
point: {
|
606 |
-
radius: 0
|
607 |
-
}
|
608 |
-
},
|
609 |
-
tooltips: {
|
610 |
-
custom: function( tooltip ) {
|
611 |
-
if ( ! tooltip ) return;
|
612 |
-
// disable displaying the color box;
|
613 |
-
tooltip.displayColors = false;
|
614 |
-
},
|
615 |
-
callbacks: {
|
616 |
-
title: function( tooltipItem, data ) {
|
617 |
-
return tooltipItem[0].yLabel + " Submissions";
|
618 |
-
},
|
619 |
-
label: function( tooltipItem, data ) {
|
620 |
-
return tooltipItem.xLabel;
|
621 |
-
},
|
622 |
-
// Set label text color
|
623 |
-
labelTextColor:function( tooltipItem, chart ) {
|
624 |
-
return '#AAAAAA';
|
625 |
-
}
|
626 |
-
}
|
627 |
-
},
|
628 |
-
plugins: {
|
629 |
-
datalabels: {
|
630 |
-
display: false
|
631 |
-
}
|
632 |
-
}
|
633 |
-
};
|
634 |
-
|
635 |
-
if (ctx) {
|
636 |
-
var myChart = new Chart(ctx, {
|
637 |
-
type: 'line',
|
638 |
-
fill: 'start',
|
639 |
-
data: chartData,
|
640 |
-
plugins: [
|
641 |
-
ChartDataLabels
|
642 |
-
],
|
643 |
-
options: chartOptions
|
644 |
-
});
|
645 |
-
}
|
646 |
-
|
647 |
-
|
648 |
-
</script>
|
649 |
-
|
650 |
-
<?php } ?>
|
651 |
-
|
652 |
-
<!-- CSS temporarily placed here. Remove after transfer. -->
|
653 |
-
<style type="text/css">
|
654 |
-
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules {
|
655 |
-
padding-top: 18px;
|
656 |
-
margin-bottom: -18px;
|
657 |
-
}
|
658 |
-
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules .forminator-search-submit {
|
659 |
-
position: absolute;
|
660 |
-
top: 0;
|
661 |
-
left: 0;
|
662 |
-
width: 36px;
|
663 |
-
height: 100%;
|
664 |
-
background: transparent;
|
665 |
-
border: none;
|
666 |
-
outline: none;
|
667 |
-
cursor: pointer;
|
668 |
-
}
|
669 |
-
.wp-admin .sui-wrap .sui-summary .sui-summary-details .forminator-search-modules .forminator-search-submit .sui-icon-magnifying-glass-search {
|
670 |
-
position: relative;
|
671 |
-
top: 0;
|
672 |
-
left: 4px;
|
673 |
-
}
|
674 |
-
</style>
|
675 |
-
<!-- CSS temporarily placed here. Remove after transfer. -->
|
4 |
// Search keyword
|
5 |
$search_keyword = null;
|
6 |
$is_search = false;
|
7 |
+
$search_module_nonce = esc_attr( 'forminator-nonce-search-module' );
|
8 |
+
if ( isset( $_GET['search'] ) && strlen( trim( $_GET['search'] ) ) && check_admin_referer( $search_module_nonce, $search_module_nonce ) ) {
|
9 |
$search_keyword = sanitize_text_field( $_GET['search'] );
|
10 |
$is_search = true;
|
11 |
}
|
12 |
|
|
|
|
|
|
|
|
|
13 |
// Get modules
|
14 |
$modules = $this->getModules( $search_keyword );
|
15 |
|
|
|
|
|
|
|
|
|
16 |
// Count total forms
|
17 |
$count = ! $is_search ? $this->countModules() : count( $modules );
|
|
|
|
|
|
|
|
|
18 |
|
19 |
// Start date for retrieving the information of the last 30 days in sql format
|
20 |
$sql_month_start_date = date( 'Y-m-d H:i:s', strtotime( '-30 days midnight' ) );// phpcs:ignore
|
21 |
|
22 |
+
$entry_type = 'custom-forms';
|
23 |
+
$wizard_page = 'forminator-cform-wizard';
|
24 |
+
$create_dialog = 'custom_forms';
|
25 |
+
$preview_title = __( 'Preview Custom Form', 'forminator' );
|
26 |
+
$empty_title = __( 'Create custom forms for all your needs with as many fields as you like. From contact forms to quote requests and everything in between.', 'forminator' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
require_once forminator_plugin_dir() . 'admin/views/common/list/summary.php';
|
|
|
|
|
29 |
|
30 |
+
if ( $count > 0 ) {
|
31 |
+
require_once forminator_plugin_dir() . 'admin/views/common/list/main_content.php';
|
32 |
+
} else {
|
33 |
+
require_once forminator_plugin_dir() . 'admin/views/common/list/empty_content.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
+
$chart_args = array(
|
37 |
+
'start_date' => $sql_month_start_date,
|
38 |
+
);
|
39 |
+
$this->template( 'common/list/chart_script', $chart_args );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/list/header.php
CHANGED
@@ -1,27 +1,7 @@
|
|
1 |
-
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
<div class="sui-actions-left">
|
6 |
-
|
7 |
-
<button class="sui-button sui-button-blue wpmudev-button-open-modal" data-modal="custom_forms"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?></button>
|
8 |
-
|
9 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
10 |
-
|
11 |
-
<a href="#"
|
12 |
-
class="sui-button wpmudev-open-modal"
|
13 |
-
data-modal="import_cform"
|
14 |
-
data-modal-title=""
|
15 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_import_cform' ) ); ?>"><i class="sui-icon-upload-cloud" aria-hidden="true"></i> <?php esc_html_e( 'Import', Forminator::DOMAIN ); ?></a>
|
16 |
-
|
17 |
-
<?php endif; ?>
|
18 |
-
|
19 |
-
</div>
|
20 |
-
|
21 |
-
<div class="sui-actions-right">
|
22 |
-
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
23 |
-
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#forms" target="_blank" class="sui-button sui-button-ghost">
|
24 |
-
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', Forminator::DOMAIN ); ?>
|
25 |
-
</a>
|
26 |
-
<?php endif; ?>
|
27 |
-
</div>
|
1 |
+
<?php
|
2 |
+
$title = __( 'Forms', 'forminator' );
|
3 |
+
$create_dialog = 'custom_forms';
|
4 |
+
$import_dialog = 'import_cform';
|
5 |
+
$hash = '#forms';
|
6 |
|
7 |
+
require_once forminator_plugin_dir() . 'admin/views/common/list/header.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/popup/export.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$form_id = $_POST['id'];// phpcs:ignore -- varified on admin ajax
|
3 |
-
$nonce = wp_create_nonce( 'forminatorCustomFormRequest' );
|
4 |
-
|
5 |
-
$exportable = array();
|
6 |
-
$model = Forminator_Custom_Form_Model::model()->load( $form_id );
|
7 |
-
if ( $model instanceof Forminator_Custom_Form_Model ) {
|
8 |
-
$exportable = $model->to_exportable_data();
|
9 |
-
}
|
10 |
-
$text_area_id = uniqid( 'export-text-' );
|
11 |
-
?>
|
12 |
-
|
13 |
-
<div class="sui-box-body wpmudev-popup-form">
|
14 |
-
|
15 |
-
<div class="sui-form-field">
|
16 |
-
<textarea class="sui-form-control" readonly="readonly" rows="10" id="<?php echo esc_attr( $text_area_id ); ?>"></textarea>
|
17 |
-
<span class="sui-description"><?php esc_html_e( 'Copy ALL text above, and paste to import dialog.', Forminator::DOMAIN ); ?></span>
|
18 |
-
</div>
|
19 |
-
|
20 |
-
<div class="sui-notice sui-notice-info">
|
21 |
-
<p>
|
22 |
-
<?php
|
23 |
-
echo(
|
24 |
-
sprintf(
|
25 |
-
__( 'You can import this %1$s in Forminator %2$s%3$s%4$s or above. The %5$s may break on a version lower than your install.', Forminator::DOMAIN ), //phpcs:ignore
|
26 |
-
__( 'Form', Forminator::DOMAIN ),//phpcs:ignore
|
27 |
-
'<strong>',
|
28 |
-
FORMINATOR_VERSION,//phpcs:ignore
|
29 |
-
'</strong>',
|
30 |
-
__( 'Form', Forminator::DOMAIN )
|
31 |
-
)
|
32 |
-
);
|
33 |
-
?>
|
34 |
-
</p>
|
35 |
-
</div>
|
36 |
-
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<div class="sui-box-footer">
|
40 |
-
|
41 |
-
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup"><?php esc_html_e( 'Close', Forminator::DOMAIN ); ?></button>
|
42 |
-
|
43 |
-
<div class="sui-actions-right">
|
44 |
-
|
45 |
-
<form action="<?php echo esc_attr( admin_url( 'admin.php?page=forminator-cform' ) ); ?>" method="post">
|
46 |
-
<input type="hidden" name="forminator_action" value="export">
|
47 |
-
<input type="hidden" name="forminatorNonce" value="<?php echo esc_attr( $nonce ); ?>">
|
48 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $form_id ); ?>">
|
49 |
-
<button class="sui-button sui-button-primary"><i class="sui-icon-download" aria-hidden="true"></i> <?php esc_html_e( 'Download', Forminator::DOMAIN ); ?></button>
|
50 |
-
</form>
|
51 |
-
|
52 |
-
</div>
|
53 |
-
|
54 |
-
</div>
|
55 |
-
|
56 |
-
<?php // using jquery to avoid html escape on popup ajax load ?>
|
57 |
-
<script type="text/javascript">
|
58 |
-
jQuery('#<?php echo esc_attr( $text_area_id ); ?>').val(JSON.stringify(<?php echo wp_json_encode( $exportable ); ?>));
|
59 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/custom-form/popup/import-cf7.php
CHANGED
@@ -24,25 +24,25 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
24 |
|
25 |
<div class="sui-box-settings-col-2">
|
26 |
|
27 |
-
<h4 class="sui-settings-label sui-dark"><?php esc_html_e( 'Forms',
|
28 |
|
29 |
-
<p class="sui-description" style="margin-bottom: 10px;"><?php printf( esc_html__( "Choose the forms you'd like to import from the Contact Form 7 plugin. Note that we will strip off any %1\$sunsupported form fields and settings%2\$s during the import.",
|
30 |
|
31 |
<div class="forminator-unsupported-settings fui-dismiss-box fui-flushed" style="display: none;">
|
32 |
|
33 |
-
<p class="sui-description" style="margin-bottom: 10px; color: #333; font-weight: bold;"><?php esc_html_e( 'Unsupported form fields and settings',
|
34 |
|
35 |
<ol class="fui-dismiss-list">
|
36 |
-
<li><?php printf( esc_html__( "%1\$s1. Quiz field:%2\$s Forminator doesn't have a built-in quiz field, however, you can enable Google's reCAPTCHA v3 and Honeypot protection on your imported forms.",
|
37 |
-
<li><?php printf( esc_html__( "%1\$s2. ConstantContact:%2\$s Forminator doesn't integrate directly with ConstantContact. However, you can use %3\$sZapier integration%4\$s to send your leads to ConstantContact.",
|
38 |
-
<li><?php printf( esc_html__( "%1\$s3. reCAPTCHA v3 integration:%2\$s At this stage, Forminator can't import your existing reCAPTCHA integration. You can set this up manually on your imported forms once they are transferred.",
|
39 |
-
<li><?php printf( esc_html__( "%1\$s4. Additional settings:%2\$s Forminator doesn't support CF7’s additional form settings.",
|
40 |
-
<li><?php printf( esc_html__( "%1\$s5. Custom field IDs:%2\$s Forminator creates a unique ID for each field, and the conditional logic relies on them. However, you can provide a custom CSS class for each field.",
|
41 |
</ol>
|
42 |
|
43 |
<button role="button" class="fui-dismiss-button forminator-dismiss-unsupported">
|
44 |
<i class="sui-icon-close sui-sm" aria-hidden="true"></i>
|
45 |
-
<?php printf( esc_html__( 'Dismiss%1$s this notice%2$s',
|
46 |
</button>
|
47 |
|
48 |
</div>
|
@@ -60,7 +60,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
60 |
class="forminator-import-forms"
|
61 |
checked="checked"
|
62 |
/>
|
63 |
-
<?php esc_html_e( 'All',
|
64 |
</label>
|
65 |
|
66 |
<label for="cf7_forms_specific" class="sui-tab-item">
|
@@ -72,7 +72,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
72 |
class="forminator-import-forms"
|
73 |
data-tab-menu="cf7_forms"
|
74 |
/>
|
75 |
-
<?php esc_html_e( 'Specific Forms',
|
76 |
</label>
|
77 |
|
78 |
</div>
|
@@ -83,7 +83,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
83 |
|
84 |
<div class="sui-form-field">
|
85 |
|
86 |
-
<label class="sui-label"><?php esc_html_e( 'Choose Forms',
|
87 |
|
88 |
<select id="forminator-choose-import-form" class="sui-select" multiple="multiple" name="cf7-form-id[]">
|
89 |
|
@@ -122,9 +122,9 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
122 |
|
123 |
<div class="sui-box-settings-col-2">
|
124 |
|
125 |
-
<h4 class="sui-settings-label sui-dark"><?php esc_html_e( 'Add-ons',
|
126 |
|
127 |
-
<p class="sui-description" style="margin-bottom: 20px;"><?php printf( esc_html__( "Choose the Contact Form 7 add-ons you wish to import form data and settings from. %1\$sNote:%2\$s The importer only supports the most widely used add-ons. For less common add-ons, you'll need to manually configure the equivalent functionality in those imported forms.",
|
128 |
|
129 |
<?php if ( is_plugin_active( 'flamingo/flamingo.php' ) ) : $is_addons = true; ?>
|
130 |
|
@@ -141,10 +141,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
141 |
checked="checked"
|
142 |
/>
|
143 |
<span aria-hidden="true"></span>
|
144 |
-
<span id="listings-cf7-addon-flamingo"><?php esc_html_e( 'Flamingo',
|
145 |
</label>
|
146 |
|
147 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions from Flamingo and show them on the submissions page.',
|
148 |
|
149 |
</div>
|
150 |
|
@@ -166,10 +166,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
166 |
checked="checked"
|
167 |
/>
|
168 |
<span aria-hidden="true"></span>
|
169 |
-
<span id="listings-cf7-addon-honeypot"><?php esc_html_e( 'Honeypot for Contact Form 7',
|
170 |
</label>
|
171 |
|
172 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Enable honeypot protection on the imported forms in Forminator.',
|
173 |
|
174 |
</div>
|
175 |
|
@@ -190,10 +190,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
190 |
checked="checked"
|
191 |
/>
|
192 |
<span aria-hidden="true"></span>
|
193 |
-
<span id="listings-cf7-addon-cfdb7"><?php esc_html_e( 'Contact Form 7 Database Addon – CFDB7',
|
194 |
</label>
|
195 |
|
196 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions from CFDB7 add-on and show them on the submissions page.',
|
197 |
|
198 |
</div>
|
199 |
|
@@ -214,10 +214,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
214 |
checked="checked"
|
215 |
/>
|
216 |
<span aria-hidden="true"></span>
|
217 |
-
<span id="listings-cf7-addon-redirection"><?php esc_html_e( 'Contact Form 7 Redirection',
|
218 |
</label>
|
219 |
|
220 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import redirection URL settings and apply them on your imported forms in Forminator. Note that Forminator doesn’t support passing form fields as query parameters into redirect URL, redirection delay, and running a script after form submission.',
|
221 |
|
222 |
</div>
|
223 |
|
@@ -238,10 +238,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
238 |
checked="checked"
|
239 |
/>
|
240 |
<span aria-hidden="true"></span>
|
241 |
-
<span id="listings-cf7-addon-conditional"><?php esc_html_e( 'Contact Form 7 Conditional Fields',
|
242 |
</label>
|
243 |
|
244 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form fields conditions and apply them automatically on your imported forms.',
|
245 |
|
246 |
</div>
|
247 |
|
@@ -262,10 +262,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
262 |
checked="checked"
|
263 |
/>
|
264 |
<span aria-hidden="true"></span>
|
265 |
-
<span id="listings-cf7-addon-submissions"><?php esc_html_e( 'Contact Form Submissions',
|
266 |
</label>
|
267 |
|
268 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions and show them on the submissions page.',
|
269 |
|
270 |
</div>
|
271 |
|
@@ -286,10 +286,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
286 |
checked="checked"
|
287 |
/>
|
288 |
<span aria-hidden="true"></span>
|
289 |
-
<span id="listings-cf7-addon-recaptchav2"><?php esc_html_e( 'Contact Form 7 - reCAPTCHA v2',
|
290 |
</label>
|
291 |
|
292 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your reCaptcha v2 API keys and configure the reCaptcha v2 on your imported forms.',
|
293 |
|
294 |
</div>
|
295 |
|
@@ -310,10 +310,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
310 |
checked="checked"
|
311 |
/>
|
312 |
<span aria-hidden="true"></span>
|
313 |
-
<span id="listings-cf7-addon-advanced_cf7"><?php esc_html_e( 'Advanced Contact form 7 DB',
|
314 |
</label>
|
315 |
|
316 |
-
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions and show them on the submissions page.',
|
317 |
|
318 |
</div>
|
319 |
|
@@ -322,7 +322,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
322 |
<?php if ( ! $is_addons ) { ?>
|
323 |
|
324 |
<div class="sui-notice">
|
325 |
-
<p><?php esc_html_e( "We couldn't find any supported add-ons.",
|
326 |
</div>
|
327 |
|
328 |
<?php } ?>
|
@@ -338,7 +338,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
338 |
<div class="sui-actions-right">
|
339 |
|
340 |
<button class="sui-button sui-button-blue wpmudev-action-ajax-cf7-import">
|
341 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Begin Import',
|
342 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
343 |
</button>
|
344 |
|
@@ -357,7 +357,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
357 |
|
358 |
<div class="sui-box-settings-col-2">
|
359 |
|
360 |
-
<p><?php esc_html_e( 'Please keep this modal open while we import your Contact Form 7 forms and add-ons. It will only take a few seconds.',
|
361 |
|
362 |
<div class="sui-progress-block">
|
363 |
|
@@ -379,7 +379,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
379 |
|
380 |
</div>
|
381 |
|
382 |
-
<span class="sui-progress-state"><?php printf( esc_html__( 'Importing submissions from %s…',
|
383 |
|
384 |
</div>
|
385 |
|
@@ -403,19 +403,19 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
403 |
<div class="sui-box-body wpmudev-popup-form">
|
404 |
|
405 |
<div class="sui-notice sui-notice-success">
|
406 |
-
<p><?php esc_html_e( 'Your selected forms from Contact Form 7 and the add-ons imported successfully.',
|
407 |
</div>
|
408 |
|
409 |
<div class="fui-dismiss-box fui-flushed">
|
410 |
|
411 |
-
<p class="sui-description" style="margin-bottom: 10px; color: #333; font-weight: bold;"><?php esc_html_e( 'Recommendations',
|
412 |
|
413 |
-
<p class="sui-description" style="margin-bottom: 5px;"><?php esc_html_e( 'Following are the next recommended steps:',
|
414 |
|
415 |
<ol class="fui-dismiss-list">
|
416 |
-
<li><?php esc_html_e( '1. Visit Forminator and preview your forms to make sure everything looks perfect and adjust your forms with the additional settings Forminator offers as per your needs.',
|
417 |
-
<li><?php esc_html_e( '2. Use the Gutenberg block or shortcode to embed your forms in the required places.',
|
418 |
-
<li><?php esc_html_e( '3. Deactivate Contact Form 7 and the add-ons if you don’t wish to use them anymore.',
|
419 |
</ol>
|
420 |
|
421 |
</div>
|
@@ -425,7 +425,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
425 |
<div class="sui-box-footer" style="padding-top: 0; border-top: 0;">
|
426 |
|
427 |
<button class="sui-button sui-button-ghost forminator-popup-close" data-a11y-dialog-hide="forminator-popup">
|
428 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Close',
|
429 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
430 |
</button>
|
431 |
|
@@ -434,7 +434,7 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
434 |
<a href="<?php echo esc_url( forminator_get_disable_url( 'cf7', 'contact-form-7/wp-contact-form-7.php' ) ); ?>" class="sui-button">
|
435 |
<span class="sui-loading-text">
|
436 |
<i class="sui-icon-power-on-off" aria-hidden="true"></i>
|
437 |
-
<?php esc_html_e( 'Deactivate contact form 7',
|
438 |
</span>
|
439 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
440 |
</a>
|
@@ -458,10 +458,10 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
458 |
|
459 |
<div class="sui-box-body wpmudev-popup-form">
|
460 |
<?php $support_url = FORMINATOR_PRO ? 'https://wpmudev.com/hub/support/' :'https://wordpress.org/support/plugin/forminator'; ?>
|
461 |
-
<p><?php printf( esc_html__( 'We have encountered an error while importing your forms from Contact Form 7 and selected add-ons. Unable to solve this? Contact our %1$ssupport%2$s team for further help.',
|
462 |
|
463 |
<div class="sui-notice sui-notice-error">
|
464 |
-
<p><?php esc_html_e( "We couldn't find any compatible data to import.",
|
465 |
</div>
|
466 |
|
467 |
</div>
|
@@ -469,14 +469,14 @@ $image_empty2x = forminator_plugin_url() . 'assets/images/forminator-summary@2x.
|
|
469 |
<div class="sui-box-footer" style="padding-top: 0; border-top: 0;">
|
470 |
|
471 |
<button class="sui-button sui-button-ghost forminator-popup-close" data-a11y-dialog-hide="forminator-popup">
|
472 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Cancel',
|
473 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
474 |
</button>
|
475 |
|
476 |
<div class="sui-actions-right">
|
477 |
|
478 |
<button class="sui-button forminator-retry-import">
|
479 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Retry Import',
|
480 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
481 |
</button>
|
482 |
|
24 |
|
25 |
<div class="sui-box-settings-col-2">
|
26 |
|
27 |
+
<h4 class="sui-settings-label sui-dark"><?php esc_html_e( 'Forms', 'forminator' ); ?></h4>
|
28 |
|
29 |
+
<p class="sui-description" style="margin-bottom: 10px;"><?php printf( esc_html__( "Choose the forms you'd like to import from the Contact Form 7 plugin. Note that we will strip off any %1\$sunsupported form fields and settings%2\$s during the import.", 'forminator' ), '<a href="#" class="forminator-toggle-unsupported-settings">', '</a>' ); ?></p>
|
30 |
|
31 |
<div class="forminator-unsupported-settings fui-dismiss-box fui-flushed" style="display: none;">
|
32 |
|
33 |
+
<p class="sui-description" style="margin-bottom: 10px; color: #333; font-weight: bold;"><?php esc_html_e( 'Unsupported form fields and settings', 'forminator' ); ?></p>
|
34 |
|
35 |
<ol class="fui-dismiss-list">
|
36 |
+
<li><?php printf( esc_html__( "%1\$s1. Quiz field:%2\$s Forminator doesn't have a built-in quiz field, however, you can enable Google's reCAPTCHA v3 and Honeypot protection on your imported forms.", 'forminator' ), '<strong>', '</strong>' ); ?></li>
|
37 |
+
<li><?php printf( esc_html__( "%1\$s2. ConstantContact:%2\$s Forminator doesn't integrate directly with ConstantContact. However, you can use %3\$sZapier integration%4\$s to send your leads to ConstantContact.", 'forminator' ), '<strong>', '</strong>', '<a href="https://wpmudev.com/blog/zapier-wordpress-form-integrations/" target="_blank">', '</a>' ); ?></li>
|
38 |
+
<li><?php printf( esc_html__( "%1\$s3. reCAPTCHA v3 integration:%2\$s At this stage, Forminator can't import your existing reCAPTCHA integration. You can set this up manually on your imported forms once they are transferred.", 'forminator' ), '<strong>', '</strong>' ); ?></li>
|
39 |
+
<li><?php printf( esc_html__( "%1\$s4. Additional settings:%2\$s Forminator doesn't support CF7’s additional form settings.", 'forminator' ), '<strong>', '</strong>' ); ?></li>
|
40 |
+
<li><?php printf( esc_html__( "%1\$s5. Custom field IDs:%2\$s Forminator creates a unique ID for each field, and the conditional logic relies on them. However, you can provide a custom CSS class for each field.", 'forminator' ), '<strong>', '</strong>' ); ?></li>
|
41 |
</ol>
|
42 |
|
43 |
<button role="button" class="fui-dismiss-button forminator-dismiss-unsupported">
|
44 |
<i class="sui-icon-close sui-sm" aria-hidden="true"></i>
|
45 |
+
<?php printf( esc_html__( 'Dismiss%1$s this notice%2$s', 'forminator' ), '<span class="sui-screen-reader-text">', '</span>' ); ?>
|
46 |
</button>
|
47 |
|
48 |
</div>
|
60 |
class="forminator-import-forms"
|
61 |
checked="checked"
|
62 |
/>
|
63 |
+
<?php esc_html_e( 'All', 'forminator' ); ?>
|
64 |
</label>
|
65 |
|
66 |
<label for="cf7_forms_specific" class="sui-tab-item">
|
72 |
class="forminator-import-forms"
|
73 |
data-tab-menu="cf7_forms"
|
74 |
/>
|
75 |
+
<?php esc_html_e( 'Specific Forms', 'forminator' ); ?>
|
76 |
</label>
|
77 |
|
78 |
</div>
|
83 |
|
84 |
<div class="sui-form-field">
|
85 |
|
86 |
+
<label class="sui-label"><?php esc_html_e( 'Choose Forms', 'forminator' ); ?></label>
|
87 |
|
88 |
<select id="forminator-choose-import-form" class="sui-select" multiple="multiple" name="cf7-form-id[]">
|
89 |
|
122 |
|
123 |
<div class="sui-box-settings-col-2">
|
124 |
|
125 |
+
<h4 class="sui-settings-label sui-dark"><?php esc_html_e( 'Add-ons', 'forminator' ); ?></h4>
|
126 |
|
127 |
+
<p class="sui-description" style="margin-bottom: 20px;"><?php printf( esc_html__( "Choose the Contact Form 7 add-ons you wish to import form data and settings from. %1\$sNote:%2\$s The importer only supports the most widely used add-ons. For less common add-ons, you'll need to manually configure the equivalent functionality in those imported forms.", 'forminator' ), '<strong>', '</strong>' ); ?></p>
|
128 |
|
129 |
<?php if ( is_plugin_active( 'flamingo/flamingo.php' ) ) : $is_addons = true; ?>
|
130 |
|
141 |
checked="checked"
|
142 |
/>
|
143 |
<span aria-hidden="true"></span>
|
144 |
+
<span id="listings-cf7-addon-flamingo"><?php esc_html_e( 'Flamingo', 'forminator' ); ?></span>
|
145 |
</label>
|
146 |
|
147 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions from Flamingo and show them on the submissions page.', 'forminator' ); ?></span>
|
148 |
|
149 |
</div>
|
150 |
|
166 |
checked="checked"
|
167 |
/>
|
168 |
<span aria-hidden="true"></span>
|
169 |
+
<span id="listings-cf7-addon-honeypot"><?php esc_html_e( 'Honeypot for Contact Form 7', 'forminator' ); ?></span>
|
170 |
</label>
|
171 |
|
172 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Enable honeypot protection on the imported forms in Forminator.', 'forminator' ); ?></span>
|
173 |
|
174 |
</div>
|
175 |
|
190 |
checked="checked"
|
191 |
/>
|
192 |
<span aria-hidden="true"></span>
|
193 |
+
<span id="listings-cf7-addon-cfdb7"><?php esc_html_e( 'Contact Form 7 Database Addon – CFDB7', 'forminator' ); ?></span>
|
194 |
</label>
|
195 |
|
196 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions from CFDB7 add-on and show them on the submissions page.', 'forminator' ); ?></span>
|
197 |
|
198 |
</div>
|
199 |
|
214 |
checked="checked"
|
215 |
/>
|
216 |
<span aria-hidden="true"></span>
|
217 |
+
<span id="listings-cf7-addon-redirection"><?php esc_html_e( 'Contact Form 7 Redirection', 'forminator' ); ?></span>
|
218 |
</label>
|
219 |
|
220 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import redirection URL settings and apply them on your imported forms in Forminator. Note that Forminator doesn’t support passing form fields as query parameters into redirect URL, redirection delay, and running a script after form submission.', 'forminator' ); ?></span>
|
221 |
|
222 |
</div>
|
223 |
|
238 |
checked="checked"
|
239 |
/>
|
240 |
<span aria-hidden="true"></span>
|
241 |
+
<span id="listings-cf7-addon-conditional"><?php esc_html_e( 'Contact Form 7 Conditional Fields', 'forminator' ); ?></span>
|
242 |
</label>
|
243 |
|
244 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form fields conditions and apply them automatically on your imported forms.', 'forminator' ); ?></span>
|
245 |
|
246 |
</div>
|
247 |
|
262 |
checked="checked"
|
263 |
/>
|
264 |
<span aria-hidden="true"></span>
|
265 |
+
<span id="listings-cf7-addon-submissions"><?php esc_html_e( 'Contact Form Submissions', 'forminator' ); ?></span>
|
266 |
</label>
|
267 |
|
268 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions and show them on the submissions page.', 'forminator' ); ?></span>
|
269 |
|
270 |
</div>
|
271 |
|
286 |
checked="checked"
|
287 |
/>
|
288 |
<span aria-hidden="true"></span>
|
289 |
+
<span id="listings-cf7-addon-recaptchav2"><?php esc_html_e( 'Contact Form 7 - reCAPTCHA v2', 'forminator' ); ?></span>
|
290 |
</label>
|
291 |
|
292 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your reCaptcha v2 API keys and configure the reCaptcha v2 on your imported forms.', 'forminator' ); ?></span>
|
293 |
|
294 |
</div>
|
295 |
|
310 |
checked="checked"
|
311 |
/>
|
312 |
<span aria-hidden="true"></span>
|
313 |
+
<span id="listings-cf7-addon-advanced_cf7"><?php esc_html_e( 'Advanced Contact form 7 DB', 'forminator' ); ?></span>
|
314 |
</label>
|
315 |
|
316 |
+
<span class="sui-description sui-checkbox-description"><?php esc_html_e( 'Import your form submissions and show them on the submissions page.', 'forminator' ); ?></span>
|
317 |
|
318 |
</div>
|
319 |
|
322 |
<?php if ( ! $is_addons ) { ?>
|
323 |
|
324 |
<div class="sui-notice">
|
325 |
+
<p><?php esc_html_e( "We couldn't find any supported add-ons.", 'forminator' ); ?></p>
|
326 |
</div>
|
327 |
|
328 |
<?php } ?>
|
338 |
<div class="sui-actions-right">
|
339 |
|
340 |
<button class="sui-button sui-button-blue wpmudev-action-ajax-cf7-import">
|
341 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Begin Import', 'forminator' ); ?></span>
|
342 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
343 |
</button>
|
344 |
|
357 |
|
358 |
<div class="sui-box-settings-col-2">
|
359 |
|
360 |
+
<p><?php esc_html_e( 'Please keep this modal open while we import your Contact Form 7 forms and add-ons. It will only take a few seconds.', 'forminator' ); ?></p>
|
361 |
|
362 |
<div class="sui-progress-block">
|
363 |
|
379 |
|
380 |
</div>
|
381 |
|
382 |
+
<span class="sui-progress-state"><?php printf( esc_html__( 'Importing submissions from %s…', 'forminator' ), 'Flamingo' ); ?></span>
|
383 |
|
384 |
</div>
|
385 |
|
403 |
<div class="sui-box-body wpmudev-popup-form">
|
404 |
|
405 |
<div class="sui-notice sui-notice-success">
|
406 |
+
<p><?php esc_html_e( 'Your selected forms from Contact Form 7 and the add-ons imported successfully.', 'forminator' ); ?></p>
|
407 |
</div>
|
408 |
|
409 |
<div class="fui-dismiss-box fui-flushed">
|
410 |
|
411 |
+
<p class="sui-description" style="margin-bottom: 10px; color: #333; font-weight: bold;"><?php esc_html_e( 'Recommendations', 'forminator' ); ?></p>
|
412 |
|
413 |
+
<p class="sui-description" style="margin-bottom: 5px;"><?php esc_html_e( 'Following are the next recommended steps:', 'forminator' ); ?></p>
|
414 |
|
415 |
<ol class="fui-dismiss-list">
|
416 |
+
<li><?php esc_html_e( '1. Visit Forminator and preview your forms to make sure everything looks perfect and adjust your forms with the additional settings Forminator offers as per your needs.', 'forminator' ); ?></li>
|
417 |
+
<li><?php esc_html_e( '2. Use the Gutenberg block or shortcode to embed your forms in the required places.', 'forminator' ); ?></li>
|
418 |
+
<li><?php esc_html_e( '3. Deactivate Contact Form 7 and the add-ons if you don’t wish to use them anymore.', 'forminator' ); ?></li>
|
419 |
</ol>
|
420 |
|
421 |
</div>
|
425 |
<div class="sui-box-footer" style="padding-top: 0; border-top: 0;">
|
426 |
|
427 |
<button class="sui-button sui-button-ghost forminator-popup-close" data-a11y-dialog-hide="forminator-popup">
|
428 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Close', 'forminator' ); ?></span>
|
429 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
430 |
</button>
|
431 |
|
434 |
<a href="<?php echo esc_url( forminator_get_disable_url( 'cf7', 'contact-form-7/wp-contact-form-7.php' ) ); ?>" class="sui-button">
|
435 |
<span class="sui-loading-text">
|
436 |
<i class="sui-icon-power-on-off" aria-hidden="true"></i>
|
437 |
+
<?php esc_html_e( 'Deactivate contact form 7', 'forminator' ); ?>
|
438 |
</span>
|
439 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
440 |
</a>
|
458 |
|
459 |
<div class="sui-box-body wpmudev-popup-form">
|
460 |
<?php $support_url = FORMINATOR_PRO ? 'https://wpmudev.com/hub/support/' :'https://wordpress.org/support/plugin/forminator'; ?>
|
461 |
+
<p><?php printf( esc_html__( 'We have encountered an error while importing your forms from Contact Form 7 and selected add-ons. Unable to solve this? Contact our %1$ssupport%2$s team for further help.', 'forminator' ), '<a href="' . $support_url . '" target="_blank">', '</a>' ); ?></p>
|
462 |
|
463 |
<div class="sui-notice sui-notice-error">
|
464 |
+
<p><?php esc_html_e( "We couldn't find any compatible data to import.", 'forminator' ); ?></p>
|
465 |
</div>
|
466 |
|
467 |
</div>
|
469 |
<div class="sui-box-footer" style="padding-top: 0; border-top: 0;">
|
470 |
|
471 |
<button class="sui-button sui-button-ghost forminator-popup-close" data-a11y-dialog-hide="forminator-popup">
|
472 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Cancel', 'forminator' ); ?></span>
|
473 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
474 |
</button>
|
475 |
|
476 |
<div class="sui-actions-right">
|
477 |
|
478 |
<button class="sui-button forminator-retry-import">
|
479 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Retry Import', 'forminator' ); ?></span>
|
480 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
481 |
</button>
|
482 |
|
admin/views/custom-form/popup/import-gravityforms.php
CHANGED
@@ -9,7 +9,7 @@ $forms = forminator_list_thirdparty_contact_forms( 'gravityforms' );
|
|
9 |
|
10 |
<div class="sui-form-field">
|
11 |
<select class="sui-form-dropdown" name="gravityforms">
|
12 |
-
<option value="all"><?php esc_html_e('All Forms',
|
13 |
<?php
|
14 |
if ( ! empty( $forms ) ):
|
15 |
foreach ($forms as $key => $value) {
|
@@ -23,7 +23,7 @@ $forms = forminator_list_thirdparty_contact_forms( 'gravityforms' );
|
|
23 |
?>
|
24 |
</select>
|
25 |
|
26 |
-
<span class="sui-description"><?php esc_html_e( 'Select the form.',
|
27 |
|
28 |
</div>
|
29 |
|
@@ -32,14 +32,14 @@ $forms = forminator_list_thirdparty_contact_forms( 'gravityforms' );
|
|
32 |
<div class="sui-box-footer">
|
33 |
|
34 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
35 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Cancel',
|
36 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
37 |
</button>
|
38 |
|
39 |
<div class="sui-actions-right">
|
40 |
|
41 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
42 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Import',
|
43 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
44 |
</button>
|
45 |
|
9 |
|
10 |
<div class="sui-form-field">
|
11 |
<select class="sui-form-dropdown" name="gravityforms">
|
12 |
+
<option value="all"><?php esc_html_e('All Forms', 'forminator'); ?></option>
|
13 |
<?php
|
14 |
if ( ! empty( $forms ) ):
|
15 |
foreach ($forms as $key => $value) {
|
23 |
?>
|
24 |
</select>
|
25 |
|
26 |
+
<span class="sui-description"><?php esc_html_e( 'Select the form.', 'forminator' ); ?></span>
|
27 |
|
28 |
</div>
|
29 |
|
32 |
<div class="sui-box-footer">
|
33 |
|
34 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
35 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Cancel', 'forminator' ); ?></span>
|
36 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
37 |
</button>
|
38 |
|
39 |
<div class="sui-actions-right">
|
40 |
|
41 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
42 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Import', 'forminator' ); ?></span>
|
43 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
44 |
</button>
|
45 |
|
admin/views/custom-form/popup/import-ninjaforms.php
CHANGED
@@ -9,7 +9,7 @@ $forms = forminator_list_thirdparty_contact_forms( 'ninjaforms' );
|
|
9 |
|
10 |
<div class="sui-form-field">
|
11 |
<select class="sui-form-dropdown" name="ninjaforms">
|
12 |
-
<option value="all"><?php esc_html_e('All Forms',
|
13 |
<?php
|
14 |
if ( ! empty( $forms ) ):
|
15 |
foreach ($forms as $key => $value) {
|
@@ -22,7 +22,7 @@ $forms = forminator_list_thirdparty_contact_forms( 'ninjaforms' );
|
|
22 |
?>
|
23 |
</select>
|
24 |
|
25 |
-
<span class="sui-description"><?php esc_html_e( 'Select the form.',
|
26 |
|
27 |
</div>
|
28 |
|
@@ -31,14 +31,14 @@ $forms = forminator_list_thirdparty_contact_forms( 'ninjaforms' );
|
|
31 |
<div class="sui-box-footer">
|
32 |
|
33 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
34 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Cancel',
|
35 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
36 |
</button>
|
37 |
|
38 |
<div class="sui-actions-right">
|
39 |
|
40 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
41 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Import',
|
42 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
43 |
</button>
|
44 |
|
9 |
|
10 |
<div class="sui-form-field">
|
11 |
<select class="sui-form-dropdown" name="ninjaforms">
|
12 |
+
<option value="all"><?php esc_html_e('All Forms', 'forminator'); ?></option>
|
13 |
<?php
|
14 |
if ( ! empty( $forms ) ):
|
15 |
foreach ($forms as $key => $value) {
|
22 |
?>
|
23 |
</select>
|
24 |
|
25 |
+
<span class="sui-description"><?php esc_html_e( 'Select the form.', 'forminator' ); ?></span>
|
26 |
|
27 |
</div>
|
28 |
|
31 |
<div class="sui-box-footer">
|
32 |
|
33 |
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
34 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Cancel', 'forminator' ); ?></span>
|
35 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
36 |
</button>
|
37 |
|
38 |
<div class="sui-actions-right">
|
39 |
|
40 |
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
41 |
+
<span class="sui-loading-text"><?php esc_html_e( 'Import', 'forminator' ); ?></span>
|
42 |
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
43 |
</button>
|
44 |
|
admin/views/custom-form/popup/import.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$nonce = wp_create_nonce( 'forminator_save_import_custom_form' );
|
3 |
-
?>
|
4 |
-
|
5 |
-
<div class="sui-box-body wpmudev-popup-form">
|
6 |
-
|
7 |
-
<div class="sui-notice sui-notice-error wpmudev-ajax-error-placeholder sui-hidden"><p></p></div>
|
8 |
-
|
9 |
-
<div class="sui-form-field">
|
10 |
-
|
11 |
-
<textarea class="sui-form-control" rows="10" name="importable"></textarea>
|
12 |
-
|
13 |
-
<span class="sui-description"><?php esc_html_e( 'Paste exported form above.', Forminator::DOMAIN ); ?></span>
|
14 |
-
|
15 |
-
</div>
|
16 |
-
|
17 |
-
</div>
|
18 |
-
|
19 |
-
<div class="sui-box-footer">
|
20 |
-
|
21 |
-
<button class="sui-button forminator-popup-cancel" data-a11y-dialog-hide="forminator-popup">
|
22 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Cancel', Forminator::DOMAIN ); ?></span>
|
23 |
-
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
24 |
-
</button>
|
25 |
-
|
26 |
-
<div class="sui-actions-right">
|
27 |
-
|
28 |
-
<button class="sui-button sui-button-primary wpmudev-action-ajax-done" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
29 |
-
<span class="sui-loading-text"><?php esc_html_e( 'Import', Forminator::DOMAIN ); ?></span>
|
30 |
-
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>
|
31 |
-
</button>
|
32 |
-
|
33 |
-
</div>
|
34 |
-
|
35 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/dashboard/footer-free.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="sui-row" id="sui-cross-sell-footer">
|
2 |
<div><span class="sui-icon-plugin-2"></span></div>
|
3 |
-
<h3><?php esc_html_e( 'Check out our other free wordpress.org plugins!',
|
4 |
</div>
|
5 |
|
6 |
<div class="sui-row sui-cross-sell-modules">
|
@@ -9,12 +9,12 @@
|
|
9 |
<div class="sui-cross-1"><span></span></div>
|
10 |
<div class="sui-box">
|
11 |
<div class="sui-box-body">
|
12 |
-
<h3><?php esc_html_e( 'Hummingbird Page Speed Optimization',
|
13 |
-
<p><?php esc_html_e( 'Performance Tests, File Optimization & Compression, Page, Browser & Gravatar Caching, GZIP Compression, CloudFlare Integration & more.',
|
14 |
<a href="https://wordpress.org/plugins/hummingbird-performance/"
|
15 |
target="_blank"
|
16 |
class="sui-button sui-button-ghost">
|
17 |
-
<?php esc_html_e( 'View features',
|
18 |
</a>
|
19 |
</div>
|
20 |
</div>
|
@@ -24,12 +24,12 @@
|
|
24 |
<div class="sui-cross-2"><span></span></div>
|
25 |
<div class="sui-box">
|
26 |
<div class="sui-box-body">
|
27 |
-
<h3><?php esc_html_e( 'Defender Security, Monitoring, and Hack Protection',
|
28 |
-
<p><?php esc_html_e( 'Security Tweaks & Recommendations, File & Malware Scanning, Login & 404 Lockout Protection, Two-Factor Authentication & more.',
|
29 |
<a href="https://wordpress.org/plugins/defender-security/"
|
30 |
target="_blank"
|
31 |
class="sui-button sui-button-ghost">
|
32 |
-
<?php esc_html_e( 'View features',
|
33 |
</a>
|
34 |
</div>
|
35 |
</div>
|
@@ -39,12 +39,12 @@
|
|
39 |
<div class="sui-cross-3"><span></span></div>
|
40 |
<div class="sui-box">
|
41 |
<div class="sui-box-body">
|
42 |
-
<h3><?php esc_html_e( 'SmartCrawl Search Engine Optimization',
|
43 |
-
<p><?php esc_html_e( 'Customize Titles & Meta Data, OpenGraph, Twitter & Pinterest Support, Auto-Keyword Linking, SEO & Readability Analysis, Sitemaps, URL Crawler & more.',
|
44 |
<a href="https://wordpress.org/plugins/smartcrawl-seo/"
|
45 |
target="_blank"
|
46 |
class="sui-button sui-button-ghost">
|
47 |
-
<?php esc_html_e( 'View features',
|
48 |
</a>
|
49 |
</div>
|
50 |
</div>
|
@@ -54,18 +54,18 @@
|
|
54 |
|
55 |
<div class="sui-cross-sell-bottom">
|
56 |
|
57 |
-
<h3><?php esc_html_e( 'Your All-in-One WordPress Platform',
|
58 |
|
59 |
-
<p><?php esc_html_e( 'Pretty much everything you need for developing and managing WordPress based websites, and then some.',
|
60 |
|
61 |
<a href="https://wpmudev.com/?utm_source=forminator&utm_medium=plugin&utm_campaign=forminator_footer_upsell_notice"
|
62 |
target="_blank"
|
63 |
class="sui-button sui-button-green">
|
64 |
-
<?php esc_html_e( 'Learn more',
|
65 |
</a>
|
66 |
|
67 |
<img class="sui-image"
|
68 |
src="<?php echo forminator_plugin_url(); // phpcs:ignore ?>assets/images/dev-team.png"
|
69 |
srcset="<?php echo forminator_plugin_url(); // phpcs:ignore ?>assets/images/dev-team@2x.png 2x"
|
70 |
-
alt="<?php esc_html_e( 'Try pro features for free!',
|
71 |
</div>
|
1 |
<div class="sui-row" id="sui-cross-sell-footer">
|
2 |
<div><span class="sui-icon-plugin-2"></span></div>
|
3 |
+
<h3><?php esc_html_e( 'Check out our other free wordpress.org plugins!', 'forminator' ); ?></h3>
|
4 |
</div>
|
5 |
|
6 |
<div class="sui-row sui-cross-sell-modules">
|
9 |
<div class="sui-cross-1"><span></span></div>
|
10 |
<div class="sui-box">
|
11 |
<div class="sui-box-body">
|
12 |
+
<h3><?php esc_html_e( 'Hummingbird Page Speed Optimization', 'forminator' ); ?></h3>
|
13 |
+
<p><?php esc_html_e( 'Performance Tests, File Optimization & Compression, Page, Browser & Gravatar Caching, GZIP Compression, CloudFlare Integration & more.', 'forminator' ); ?></p>
|
14 |
<a href="https://wordpress.org/plugins/hummingbird-performance/"
|
15 |
target="_blank"
|
16 |
class="sui-button sui-button-ghost">
|
17 |
+
<?php esc_html_e( 'View features', 'forminator' ); ?> <i class="sui-icon-arrow-right"></i>
|
18 |
</a>
|
19 |
</div>
|
20 |
</div>
|
24 |
<div class="sui-cross-2"><span></span></div>
|
25 |
<div class="sui-box">
|
26 |
<div class="sui-box-body">
|
27 |
+
<h3><?php esc_html_e( 'Defender Security, Monitoring, and Hack Protection', 'forminator' ); ?></h3>
|
28 |
+
<p><?php esc_html_e( 'Security Tweaks & Recommendations, File & Malware Scanning, Login & 404 Lockout Protection, Two-Factor Authentication & more.', 'forminator' ); ?></p>
|
29 |
<a href="https://wordpress.org/plugins/defender-security/"
|
30 |
target="_blank"
|
31 |
class="sui-button sui-button-ghost">
|
32 |
+
<?php esc_html_e( 'View features', 'forminator' ); ?> <i class="sui-icon-arrow-right"></i>
|
33 |
</a>
|
34 |
</div>
|
35 |
</div>
|
39 |
<div class="sui-cross-3"><span></span></div>
|
40 |
<div class="sui-box">
|
41 |
<div class="sui-box-body">
|
42 |
+
<h3><?php esc_html_e( 'SmartCrawl Search Engine Optimization', 'forminator' ); ?></h3>
|
43 |
+
<p><?php esc_html_e( 'Customize Titles & Meta Data, OpenGraph, Twitter & Pinterest Support, Auto-Keyword Linking, SEO & Readability Analysis, Sitemaps, URL Crawler & more.', 'forminator' ); ?></p>
|
44 |
<a href="https://wordpress.org/plugins/smartcrawl-seo/"
|
45 |
target="_blank"
|
46 |
class="sui-button sui-button-ghost">
|
47 |
+
<?php esc_html_e( 'View features', 'forminator' ); ?> <i class="sui-icon-arrow-right"></i>
|
48 |
</a>
|
49 |
</div>
|
50 |
</div>
|
54 |
|
55 |
<div class="sui-cross-sell-bottom">
|
56 |
|
57 |
+
<h3><?php esc_html_e( 'Your All-in-One WordPress Platform', 'forminator' ); ?></h3>
|
58 |
|
59 |
+
<p><?php esc_html_e( 'Pretty much everything you need for developing and managing WordPress based websites, and then some.', 'forminator' ); ?></p>
|
60 |
|
61 |
<a href="https://wpmudev.com/?utm_source=forminator&utm_medium=plugin&utm_campaign=forminator_footer_upsell_notice"
|
62 |
target="_blank"
|
63 |
class="sui-button sui-button-green">
|
64 |
+
<?php esc_html_e( 'Learn more', 'forminator' ); ?>
|
65 |
</a>
|
66 |
|
67 |
<img class="sui-image"
|
68 |
src="<?php echo forminator_plugin_url(); // phpcs:ignore ?>assets/images/dev-team.png"
|
69 |
srcset="<?php echo forminator_plugin_url(); // phpcs:ignore ?>assets/images/dev-team@2x.png 2x"
|
70 |
+
alt="<?php esc_html_e( 'Try pro features for free!', 'forminator' ); ?>">
|
71 |
</div>
|
admin/views/dashboard/header.php
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
-
<
|
|
|
2 |
|
3 |
<div class="sui-actions-right">
|
4 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
5 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#dashboard" target="_blank" class="sui-button sui-button-ghost">
|
6 |
-
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation',
|
7 |
</a>
|
8 |
<?php endif; ?>
|
9 |
</div>
|
|
1 |
+
<header class="sui-header">
|
2 |
+
<h1 class="sui-header-title"><?php esc_html_e( 'Dashboard', 'forminator' ); ?></h1>
|
3 |
|
4 |
<div class="sui-actions-right">
|
5 |
<?php if ( forminator_is_show_documentation_link() ) : ?>
|
6 |
<a href="https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#dashboard" target="_blank" class="sui-button sui-button-ghost">
|
7 |
+
<i class="sui-icon-academy"></i> <?php esc_html_e( 'View Documentation', 'forminator' ); ?>
|
8 |
</a>
|
9 |
<?php endif; ?>
|
10 |
</div>
|
11 |
+
</header>
|
admin/views/dashboard/new-feature-notice.php
CHANGED
@@ -37,15 +37,15 @@ if ( ! FORMINATOR_PRO ) {
|
|
37 |
|
38 |
<div class="sui-box-header sui-block-content-center">
|
39 |
|
40 |
-
<button data-a11y-dialog-hide="forminator-new-feature" style="z-index: 2" class="sui-dialog-close forminator-dismiss-new-feature" aria-label="<?php esc_html_e( 'Close this dialog window',
|
41 |
|
42 |
<?php //if ( FORMINATOR_PRO ) { ?>
|
43 |
|
44 |
-
<h2 class="sui-box-title"><?php esc_html_e( 'New! Capture leads on quizzes',
|
45 |
|
46 |
-
<p class="sui-description"><?php printf( esc_html__( 'That\'s right! You can %scapture participants data%s (such as name, email, etc.) on your quizzes with this release.',
|
47 |
|
48 |
-
<p class="sui-description"><?php printf( esc_html__( 'While creating a quiz, you\'ll see a new option to collect leads and enabling that will add a new tab called "Leads" into the quiz editor where you can configure your lead generation from settings.',
|
49 |
|
50 |
<?php //} else { ?>
|
51 |
|
@@ -57,7 +57,7 @@ if ( ! FORMINATOR_PRO ) {
|
|
57 |
|
58 |
<div class="sui-box-footer sui-block-content-center" sui-space-bottom="60">
|
59 |
|
60 |
-
<button class="sui-button forminator-dismiss-new-feature" type="button" data-a11y-dialog-hide="forminator-new-feature"><?php esc_html_e( 'Got It',
|
61 |
|
62 |
</div>
|
63 |
|
@@ -65,7 +65,7 @@ if ( ! FORMINATOR_PRO ) {
|
|
65 |
|
66 |
<div class="sui-box-footer sui-block-content-center" sui-space-bottom="60">
|
67 |
|
68 |
-
<button class="sui-button forminator-dismiss-new-feature" type="button" data-a11y-dialog-hide="forminator-new-feature"><?php esc_html_e( 'Got It',
|
69 |
|
70 |
</div>
|
71 |
|
37 |
|
38 |
<div class="sui-box-header sui-block-content-center">
|
39 |
|
40 |
+
<button data-a11y-dialog-hide="forminator-new-feature" style="z-index: 2" class="sui-dialog-close forminator-dismiss-new-feature" aria-label="<?php esc_html_e( 'Close this dialog window', 'forminator' ); ?>"></button>
|
41 |
|
42 |
<?php //if ( FORMINATOR_PRO ) { ?>
|
43 |
|
44 |
+
<h2 class="sui-box-title"><?php esc_html_e( 'New! Capture leads on quizzes', 'forminator' ); ?></h2>
|
45 |
|
46 |
+
<p class="sui-description"><?php printf( esc_html__( 'That\'s right! You can %scapture participants data%s (such as name, email, etc.) on your quizzes with this release.', 'forminator' ), '<strong>', '</strong>' ); ?></p>
|
47 |
|
48 |
+
<p class="sui-description"><?php printf( esc_html__( 'While creating a quiz, you\'ll see a new option to collect leads and enabling that will add a new tab called "Leads" into the quiz editor where you can configure your lead generation from settings.', 'forminator' ), '<strong>', '</strong>' ); ?></p>
|
49 |
|
50 |
<?php //} else { ?>
|
51 |
|
57 |
|
58 |
<div class="sui-box-footer sui-block-content-center" sui-space-bottom="60">
|
59 |
|
60 |
+
<button class="sui-button forminator-dismiss-new-feature" type="button" data-a11y-dialog-hide="forminator-new-feature"><?php esc_html_e( 'Got It', 'forminator' ); ?></button>
|
61 |
|
62 |
</div>
|
63 |
|
65 |
|
66 |
<div class="sui-box-footer sui-block-content-center" sui-space-bottom="60">
|
67 |
|
68 |
+
<button class="sui-button forminator-dismiss-new-feature" type="button" data-a11y-dialog-hide="forminator-new-feature"><?php esc_html_e( 'Got It', 'forminator' ); ?></button>
|
69 |
|
70 |
</div>
|
71 |
|
admin/views/dashboard/widgets/widget-cform.php
CHANGED
@@ -1,190 +1,12 @@
|
|
1 |
<?php
|
2 |
-
$
|
3 |
-
$
|
4 |
-
$
|
5 |
-
$
|
6 |
-
$
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
$statuses[] = Forminator_Base_Form_Model::STATUS_DRAFT;
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( 0 === $num_recent ) {
|
17 |
-
return;
|
18 |
-
};
|
19 |
-
?>
|
20 |
-
|
21 |
-
<div class="sui-box">
|
22 |
-
|
23 |
-
<div class="sui-box-header">
|
24 |
-
|
25 |
-
<h3 class="sui-box-title"><i class="sui-icon-clipboard-notes" aria-hidden="true"></i><?php esc_html_e( 'Forms', Forminator::DOMAIN ); ?></h3>
|
26 |
-
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<div class="sui-box-body">
|
30 |
-
|
31 |
-
<p><?php esc_html_e( 'Create any type of form from one of our pre-made templates, or build your own from scratch.', Forminator::DOMAIN ); ?></p>
|
32 |
-
|
33 |
-
<?php // Strict comparison is removed for a reason! ?>
|
34 |
-
<?php if ( 0 == forminator_cforms_total() ) { // WPCS: loose comparison ok ?>
|
35 |
-
|
36 |
-
<p><button href="/" class="sui-button sui-button-blue wpmudev-open-modal" data-modal="custom_forms"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?></button></p>
|
37 |
-
|
38 |
-
<?php } ?>
|
39 |
-
|
40 |
-
</div>
|
41 |
-
|
42 |
-
<?php if ( 0 < forminator_cforms_total() ) { ?>
|
43 |
-
|
44 |
-
<table class="sui-table sui-table-flushed">
|
45 |
-
|
46 |
-
<thead>
|
47 |
-
|
48 |
-
<tr>
|
49 |
-
|
50 |
-
<th><?php esc_html_e( 'Name', Forminator::DOMAIN ); ?></th>
|
51 |
-
|
52 |
-
<th class="fui-col-status"><?php esc_html_e( 'Status', Forminator::DOMAIN ); ?></th>
|
53 |
-
|
54 |
-
</tr>
|
55 |
-
|
56 |
-
</thead>
|
57 |
-
|
58 |
-
<tbody>
|
59 |
-
|
60 |
-
<?php
|
61 |
-
$per_page = forminator_form_view_per_page();
|
62 |
-
foreach ( forminator_cform_modules( $num_recent, $statuses ) as $index => $module ) {
|
63 |
-
$page = ceil( ( $index + 1 ) / $per_page );
|
64 |
-
?>
|
65 |
-
|
66 |
-
<tr>
|
67 |
-
|
68 |
-
<td class="sui-table-item-title"><?php echo htmlspecialchars( forminator_get_form_name( $module['id'], 'custom_form' ) ); // phpcs:ignore ?></td>
|
69 |
-
|
70 |
-
<td class="fui-col-status">
|
71 |
-
|
72 |
-
<?php
|
73 |
-
if ( 'publish' === $module['status'] ) {
|
74 |
-
$status_class = 'published';
|
75 |
-
$status_text = esc_html__( 'Published', Forminator::DOMAIN );
|
76 |
-
} else {
|
77 |
-
$status_class = 'draft';
|
78 |
-
$status_text = esc_html__( 'Draft', Forminator::DOMAIN );
|
79 |
-
}
|
80 |
-
?>
|
81 |
-
|
82 |
-
<span
|
83 |
-
class="sui-status-dot sui-<?php echo esc_html( $status_class ); ?> sui-tooltip"
|
84 |
-
data-tooltip="<?php echo esc_html( $status_text ); ?>"
|
85 |
-
>
|
86 |
-
<span aria-hidden="true"></span>
|
87 |
-
</span>
|
88 |
-
|
89 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-cform&view-stats=' . esc_attr( $module['id'] ) . '&paged=' . $page ); // phpcs:ignore ?>"
|
90 |
-
class="sui-button-icon sui-tooltip sui-tooltip-top-right-mobile"
|
91 |
-
data-tooltip="<?php esc_html_e( 'View Stats', Forminator::DOMAIN ); ?>">
|
92 |
-
<span class="sui-icon-graph-line" aria-hidden="true"></span>
|
93 |
-
</a>
|
94 |
-
|
95 |
-
<div class="sui-dropdown">
|
96 |
-
|
97 |
-
<button class="sui-button-icon sui-dropdown-anchor"
|
98 |
-
aria-expanded="false"
|
99 |
-
aria-label="<?php esc_html_e( 'More options', Forminator::DOMAIN ); ?>">
|
100 |
-
<span class="sui-icon-widget-settings-config" aria-hidden="true"></span>
|
101 |
-
</button>
|
102 |
-
|
103 |
-
<ul>
|
104 |
-
<li>
|
105 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-cform-wizard&id=' . $module['id'] ); // phpcs:ignore ?>">
|
106 |
-
<span class="sui-icon-pencil" aria-hidden="true"></span> <?php esc_html_e( 'Edit', Forminator::DOMAIN ); ?>
|
107 |
-
</a>
|
108 |
-
</li>
|
109 |
-
<li><button class="wpmudev-open-modal"
|
110 |
-
data-modal="preview_cforms"
|
111 |
-
data-modal-title="<?php echo sprintf( '%s - %s', esc_html__( 'Preview Custom Form', Forminator::DOMAIN ), htmlspecialchars( htmlspecialchars( forminator_get_form_name( $module['id'], 'custom_form' ) ) ) ); // phpcs:ignore ?>"
|
112 |
-
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
113 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
114 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_preview_cforms' ) ); ?>">
|
115 |
-
<span class="sui-icon-eye" aria-hidden="true"></span> <?php esc_html_e( 'Preview', Forminator::DOMAIN ); ?>
|
116 |
-
</button></li>
|
117 |
-
|
118 |
-
<li>
|
119 |
-
<button class="copy-clipboard" data-shortcode='[forminator_form id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', Forminator::DOMAIN ); ?></button>
|
120 |
-
</li>
|
121 |
-
|
122 |
-
<li><a href="<?php echo admin_url( 'admin.php?page=forminator-entries&form_type=forminator_forms&form_id=' . $module['id'] ); // phpcs:ignore ?>"><i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', Forminator::DOMAIN ); ?></a></li>
|
123 |
-
|
124 |
-
<li><form method="post">
|
125 |
-
<input type="hidden" name="forminator_action" value="clone">
|
126 |
-
<input type="hidden" name="form_type" value="custom-form">
|
127 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
128 |
-
<?php
|
129 |
-
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
130 |
-
wp_nonce_field( $clone_nonce, $clone_nonce );
|
131 |
-
?>
|
132 |
-
<button type="submit">
|
133 |
-
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', Forminator::DOMAIN ); ?>
|
134 |
-
</button>
|
135 |
-
</form></li>
|
136 |
-
|
137 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
138 |
-
|
139 |
-
<li><a href="#"
|
140 |
-
class="wpmudev-open-modal"
|
141 |
-
data-modal="export_cform"
|
142 |
-
data-modal-title=""
|
143 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
144 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_cform' ) ); ?>">
|
145 |
-
<span class="sui-icon-cloud-migration" aria-hidden="true"></span> <?php esc_html_e( 'Export', Forminator::DOMAIN ); ?>
|
146 |
-
</a></li>
|
147 |
-
|
148 |
-
<?php endif; ?>
|
149 |
-
|
150 |
-
<li>
|
151 |
-
<button class="wpmudev-open-modal"
|
152 |
-
data-modal="delete-module"
|
153 |
-
data-modal-title="<?php esc_attr_e( 'Delete Form', Forminator::DOMAIN ); ?>"
|
154 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this form?', Forminator::DOMAIN ); ?>"
|
155 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
156 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminatorCustomFormRequest' ) ); ?>">
|
157 |
-
<span class="sui-icon-trash" aria-hidden="true"></span> <?php esc_html_e( 'Delete', Forminator::DOMAIN ); ?>
|
158 |
-
</button>
|
159 |
-
</li>
|
160 |
-
|
161 |
-
</ul>
|
162 |
-
|
163 |
-
</div>
|
164 |
-
|
165 |
-
</td>
|
166 |
-
|
167 |
-
</tr>
|
168 |
-
|
169 |
-
<?php } ?>
|
170 |
-
|
171 |
-
</tbody>
|
172 |
-
|
173 |
-
</table>
|
174 |
-
|
175 |
-
<div class="sui-box-footer">
|
176 |
-
|
177 |
-
<button class="sui-button sui-button-blue wpmudev-open-modal forminator-create-form"
|
178 |
-
data-modal="custom_forms">
|
179 |
-
<span class="sui-icon-plus" aria-hidden="true"></span> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?>
|
180 |
-
</button>
|
181 |
-
|
182 |
-
<div class="sui-actions-right">
|
183 |
-
<p class="sui-description"><a href="<?php echo admin_url( 'admin.php?page=forminator-cform' ); // phpcs:ignore ?>" class="sui-link-gray"><?php esc_html_e( 'View all forms', Forminator::DOMAIN ); ?></a></p>
|
184 |
-
</div>
|
185 |
-
|
186 |
-
</div>
|
187 |
-
|
188 |
-
<?php } ?>
|
189 |
-
|
190 |
-
</div>
|
1 |
<?php
|
2 |
+
$module_slug = 'form';
|
3 |
+
$title = __( 'Forms', 'forminator' );
|
4 |
+
$description = __( 'Create any type of form from one of our pre-made templates, or build your own from scratch.', 'forminator' );
|
5 |
+
$icon = 'sui-icon-clipboard-notes';
|
6 |
+
$preview_title = __( 'Preview Custom Form', 'forminator' );
|
7 |
+
$delete_title = __( 'Delete Form', 'forminator' );
|
8 |
+
$delete_description = __( 'Are you sure you wish to permanently delete this form?', 'forminator' );
|
9 |
+
$view_all = __( 'View all forms', 'forminator' );
|
10 |
+
$total = forminator_cforms_total();
|
11 |
+
|
12 |
+
require forminator_plugin_dir() . 'admin/views/common/dashboard/widget.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/dashboard/widgets/widget-create.php
CHANGED
@@ -13,7 +13,7 @@ $hero_sample = forminator_plugin_dir() . 'assets/icons/forminator-icons/hero-sam
|
|
13 |
|
14 |
<div class="wpmudev-header--text">
|
15 |
|
16 |
-
<h2 class="wpmudev-title"><?php esc_html_e( 'Create Modules',
|
17 |
|
18 |
</div>
|
19 |
|
@@ -21,7 +21,7 @@ $hero_sample = forminator_plugin_dir() . 'assets/icons/forminator-icons/hero-sam
|
|
21 |
|
22 |
<button class="wpmudev-box--action" aria-hidden="true"><span class="wpmudev-icon--plus"></span></button>
|
23 |
|
24 |
-
<button class="wpmudev-sr-only"><?php esc_html_e( 'Hide box',
|
25 |
|
26 |
</div>
|
27 |
|
13 |
|
14 |
<div class="wpmudev-header--text">
|
15 |
|
16 |
+
<h2 class="wpmudev-title"><?php esc_html_e( 'Create Modules', 'forminator' ); ?></h2>
|
17 |
|
18 |
</div>
|
19 |
|
21 |
|
22 |
<button class="wpmudev-box--action" aria-hidden="true"><span class="wpmudev-icon--plus"></span></button>
|
23 |
|
24 |
+
<button class="wpmudev-sr-only"><?php esc_html_e( 'Hide box', 'forminator' ); ?></button>
|
25 |
|
26 |
</div>
|
27 |
|
admin/views/dashboard/widgets/widget-poll.php
CHANGED
@@ -1,185 +1,12 @@
|
|
1 |
<?php
|
2 |
-
$
|
3 |
-
$
|
4 |
-
$
|
5 |
-
$
|
6 |
-
$
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
if ( 0 === $num_recent ) {
|
15 |
-
return;
|
16 |
-
}
|
17 |
-
?>
|
18 |
-
|
19 |
-
<div class="sui-box">
|
20 |
-
|
21 |
-
<div class="sui-box-header">
|
22 |
-
|
23 |
-
<h3 class="sui-box-title"><i class="sui-icon-graph-bar" aria-hidden="true"></i><?php esc_html_e( 'Polls', Forminator::DOMAIN ); ?></h3>
|
24 |
-
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<div class="sui-box-body">
|
28 |
-
|
29 |
-
<p><?php esc_html_e( 'Create interactive polls to collect users\' opinions, with lots of dynamic options and settings.', Forminator::DOMAIN ); ?></p>
|
30 |
-
|
31 |
-
<?php if ( 0 === forminator_polls_total() ) { ?>
|
32 |
-
|
33 |
-
<p><button href="/" class="sui-button sui-button-blue wpmudev-open-modal" data-modal="polls"><i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?></button></p>
|
34 |
-
|
35 |
-
<?php } ?>
|
36 |
-
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<?php if ( forminator_polls_total() > 0 ) { ?>
|
40 |
-
|
41 |
-
<table class="sui-table sui-table-flushed">
|
42 |
-
|
43 |
-
<thead>
|
44 |
-
|
45 |
-
<tr>
|
46 |
-
|
47 |
-
<th><?php esc_html_e( 'Name', Forminator::DOMAIN ); ?></th>
|
48 |
-
<th class="fui-col-status"></th>
|
49 |
-
|
50 |
-
</tr>
|
51 |
-
|
52 |
-
</thead>
|
53 |
-
|
54 |
-
<tbody>
|
55 |
-
|
56 |
-
<?php
|
57 |
-
$per_page = forminator_form_view_per_page();
|
58 |
-
foreach ( forminator_polls_modules( $num_recent, $statuses ) as $index => $module ) {
|
59 |
-
$page = ceil( ( $index + 1 ) / $per_page );
|
60 |
-
?>
|
61 |
-
|
62 |
-
<tr>
|
63 |
-
|
64 |
-
<td class="sui-table-item-title"><?php echo esc_html( htmlspecialchars( $module['name'] ) ); ?></td>
|
65 |
-
|
66 |
-
<td class="fui-col-status">
|
67 |
-
|
68 |
-
<?php
|
69 |
-
if ( 'publish' === $module['status'] ) {
|
70 |
-
$status_class = 'published';
|
71 |
-
$status_text = esc_html__( 'Published', Forminator::DOMAIN );
|
72 |
-
} else {
|
73 |
-
$status_class = 'draft';
|
74 |
-
$status_text = esc_html__( 'Draft', Forminator::DOMAIN );
|
75 |
-
}
|
76 |
-
?>
|
77 |
-
|
78 |
-
<span
|
79 |
-
class="sui-status-dot sui-<?php echo esc_html( $status_class ); ?> sui-tooltip"
|
80 |
-
data-tooltip="<?php echo esc_html( $status_text ); ?>"
|
81 |
-
>
|
82 |
-
<span aria-hidden="true"></span>
|
83 |
-
</span>
|
84 |
-
|
85 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-poll&view-stats=' . esc_attr( $module['id'] ) . '&paged=' . $page ); // phpcs:ignore ?>"
|
86 |
-
class="sui-button-icon sui-tooltip"
|
87 |
-
data-tooltip="<?php esc_html_e( 'View Status', Forminator::DOMAIN ); ?>">
|
88 |
-
<i class="sui-icon-graph-line" aria-hidden="true"></i>
|
89 |
-
</a>
|
90 |
-
|
91 |
-
<div class="sui-dropdown">
|
92 |
-
|
93 |
-
<button class="sui-button-icon sui-dropdown-anchor"
|
94 |
-
aria-expanded="false"
|
95 |
-
aria-label="<?php esc_html_e( 'More options', Forminator::DOMAIN ); ?>">
|
96 |
-
<i class="sui-icon-widget-settings-config" aria-hidden="true"></i>
|
97 |
-
</button>
|
98 |
-
|
99 |
-
<ul>
|
100 |
-
<li>
|
101 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-poll-wizard&id=' . $module['id'] ); // phpcs:ignore ?>">
|
102 |
-
<i class="sui-icon-pencil" aria-hidden="true"></i> <?php esc_html_e( 'Edit', Forminator::DOMAIN ); ?>
|
103 |
-
</a>
|
104 |
-
</li>
|
105 |
-
<li><button class="wpmudev-open-modal"
|
106 |
-
data-modal="preview_polls"
|
107 |
-
data-modal-title="<?php echo sprintf( '%s - %s', __( 'Preview Poll', Forminator::DOMAIN ), htmlspecialchars( htmlspecialchars( forminator_get_form_name( $module['id'], 'poll' ) ) ) ); // phpcs:ignore ?>"
|
108 |
-
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
109 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
110 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_preview_polls' ) ); ?>">
|
111 |
-
<i class="sui-icon-eye" aria-hidden="true"></i> <?php esc_html_e( 'Preview', Forminator::DOMAIN ); ?>
|
112 |
-
</button></li>
|
113 |
-
|
114 |
-
<li>
|
115 |
-
<button class="copy-clipboard" data-shortcode='[forminator_poll id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', Forminator::DOMAIN ); ?></button>
|
116 |
-
</li>
|
117 |
-
|
118 |
-
<li><a href="<?php echo admin_url( 'admin.php?page=forminator-entries&form_type=forminator_polls&form_id=' . $module['id'] ); // phpcs:ignore ?>"><i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', Forminator::DOMAIN ); ?></a></li>
|
119 |
-
|
120 |
-
<li><form method="post">
|
121 |
-
<input type="hidden" name="forminator_action" value="clone">
|
122 |
-
<input type="hidden" name="form_type" value="poll">
|
123 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
124 |
-
<?php
|
125 |
-
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
126 |
-
wp_nonce_field( $clone_nonce, $clone_nonce );
|
127 |
-
?>
|
128 |
-
<button type="submit">
|
129 |
-
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', Forminator::DOMAIN ); ?>
|
130 |
-
</button>
|
131 |
-
</form></li>
|
132 |
-
|
133 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
134 |
-
|
135 |
-
<li><a href="#"
|
136 |
-
class="wpmudev-open-modal"
|
137 |
-
data-modal="export_poll"
|
138 |
-
data-modal-title=""
|
139 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
140 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_poll' ) ); ?>">
|
141 |
-
<i class="sui-icon-cloud-migration" aria-hidden="true"></i> <?php esc_html_e( 'Export', Forminator::DOMAIN ); ?>
|
142 |
-
</a></li>
|
143 |
-
|
144 |
-
<?php endif; ?>
|
145 |
-
|
146 |
-
<li><a href="#"
|
147 |
-
class="wpmudev-open-modal"
|
148 |
-
data-modal="delete-module"
|
149 |
-
data-modal-title="<?php esc_attr_e( 'Delete Poll', Forminator::DOMAIN ); ?>"
|
150 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this poll?', Forminator::DOMAIN ); ?>"
|
151 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
152 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminatorPollFormRequest' ) ); ?>">
|
153 |
-
<i class="sui-icon-trash" aria-hidden="true"></i> <?php esc_html_e( 'Delete', Forminator::DOMAIN ); ?>
|
154 |
-
</a></li>
|
155 |
-
|
156 |
-
</ul>
|
157 |
-
|
158 |
-
</div>
|
159 |
-
|
160 |
-
</td>
|
161 |
-
|
162 |
-
</tr>
|
163 |
-
|
164 |
-
<?php } ?>
|
165 |
-
|
166 |
-
</tbody>
|
167 |
-
|
168 |
-
</table>
|
169 |
-
|
170 |
-
<div class="sui-box-footer">
|
171 |
-
|
172 |
-
<button class="sui-button sui-button-blue wpmudev-open-modal forminator-create-poll"
|
173 |
-
data-modal="polls">
|
174 |
-
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?>
|
175 |
-
</button>
|
176 |
-
|
177 |
-
<div class="sui-actions-right">
|
178 |
-
<p class="sui-description"><a href="<?php echo admin_url( 'admin.php?page=forminator-poll' ); // phpcs:ignore ?>" class="sui-link-gray"><?php esc_html_e( 'View all polls', Forminator::DOMAIN ); ?></a></p>
|
179 |
-
</div>
|
180 |
-
|
181 |
-
</div>
|
182 |
-
|
183 |
-
<?php } ?>
|
184 |
-
|
185 |
-
</div>
|
1 |
<?php
|
2 |
+
$module_slug = 'poll';
|
3 |
+
$title = __( 'Polls', 'forminator' );
|
4 |
+
$description = __( 'Create interactive polls to collect users\' opinions, with lots of dynamic options and settings.', 'forminator' );
|
5 |
+
$icon = 'sui-icon-graph-bar';
|
6 |
+
$preview_title = __( 'Preview Poll', 'forminator' );
|
7 |
+
$delete_title = __( 'Delete Poll', 'forminator' );
|
8 |
+
$delete_description = __( 'Are you sure you wish to permanently delete this poll?', 'forminator' );
|
9 |
+
$view_all = __( 'View all polls', 'forminator' );
|
10 |
+
$total = forminator_polls_total();
|
11 |
+
|
12 |
+
require forminator_plugin_dir() . 'admin/views/common/dashboard/widget.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/dashboard/widgets/widget-quiz.php
CHANGED
@@ -1,211 +1,12 @@
|
|
1 |
<?php
|
2 |
-
$
|
3 |
-
$
|
4 |
-
$
|
5 |
-
$
|
6 |
-
$
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
$statuses[] = Forminator_Base_Form_Model::STATUS_DRAFT;
|
14 |
-
}
|
15 |
-
|
16 |
-
if ( 0 === $num_recent ) {
|
17 |
-
return;
|
18 |
-
}
|
19 |
-
?>
|
20 |
-
|
21 |
-
<div class="sui-box">
|
22 |
-
|
23 |
-
<div class="sui-box-header">
|
24 |
-
|
25 |
-
<h3 class="sui-box-title"><i class="sui-icon-academy" aria-hidden="true"></i><?php esc_html_e( 'Quizzes', Forminator::DOMAIN ); ?></h3>
|
26 |
-
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<div class="sui-box-body">
|
30 |
-
|
31 |
-
<p><?php esc_html_e( 'Create fun or challenging quizzes for your visitors to take and share on social media.', Forminator::DOMAIN ); ?></p>
|
32 |
-
|
33 |
-
<?php if ( 0 === forminator_quizzes_total() ) { ?>
|
34 |
-
|
35 |
-
<p><button class="sui-button sui-button-blue wpmudev-open-modal"
|
36 |
-
data-modal="quizzes">
|
37 |
-
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?>
|
38 |
-
</button></p>
|
39 |
-
|
40 |
-
<?php } ?>
|
41 |
-
|
42 |
-
</div>
|
43 |
-
|
44 |
-
<?php if ( forminator_quizzes_total() > 0 ) { ?>
|
45 |
-
|
46 |
-
<table class="sui-table sui-table-flushed">
|
47 |
-
|
48 |
-
<thead>
|
49 |
-
|
50 |
-
<tr>
|
51 |
-
|
52 |
-
<th><?php esc_html_e( 'Name', Forminator::DOMAIN ); ?></th>
|
53 |
-
<th class="fui-col-status"></th>
|
54 |
-
|
55 |
-
</tr>
|
56 |
-
|
57 |
-
</thead>
|
58 |
-
|
59 |
-
<tbody>
|
60 |
-
|
61 |
-
<?php
|
62 |
-
$per_page = forminator_form_view_per_page();
|
63 |
-
foreach ( forminator_quizzes_modules( $num_recent, $statuses ) as $index => $module ) {
|
64 |
-
$page = ceil( ( $index + 1 ) / $per_page );
|
65 |
-
?>
|
66 |
-
|
67 |
-
<tr>
|
68 |
-
|
69 |
-
<td class="sui-table-item-title"><?php echo esc_html( htmlspecialchars( $module['name'] ) ); ?></td>
|
70 |
-
|
71 |
-
<td class="fui-col-status">
|
72 |
-
|
73 |
-
<?php
|
74 |
-
if ( 'publish' === $module['status'] ) {
|
75 |
-
$status_class = 'published';
|
76 |
-
$status_text = esc_html__( 'Published', Forminator::DOMAIN );
|
77 |
-
} else {
|
78 |
-
$status_class = 'draft';
|
79 |
-
$status_text = esc_html__( 'Draft', Forminator::DOMAIN );
|
80 |
-
}
|
81 |
-
$has_leads = isset( $module['has_leads'] ) ? $module['has_leads'] : false;
|
82 |
-
$leads_id = isset( $module['leads_id'] ) ? $module['leads_id'] : 0;
|
83 |
-
?>
|
84 |
-
|
85 |
-
<span
|
86 |
-
class="sui-status-dot sui-<?php echo esc_html( $status_class ); ?> sui-tooltip"
|
87 |
-
data-tooltip="<?php echo esc_html( $status_text ); ?>"
|
88 |
-
>
|
89 |
-
<span aria-hidden="true"></span>
|
90 |
-
</span>
|
91 |
-
|
92 |
-
<a href="<?php echo admin_url( 'admin.php?page=forminator-quiz&view-stats=' . esc_attr( $module['id'] ) . '&paged=' . $page ); // phpcs:ignore ?>"
|
93 |
-
class="sui-button-icon sui-tooltip"
|
94 |
-
data-tooltip="<?php esc_html_e( 'View Status', Forminator::DOMAIN ); ?>">
|
95 |
-
<i class="sui-icon-graph-line" aria-hidden="true"></i>
|
96 |
-
</a>
|
97 |
-
|
98 |
-
<div class="sui-dropdown">
|
99 |
-
|
100 |
-
<button class="sui-button-icon sui-dropdown-anchor"
|
101 |
-
aria-expanded="false"
|
102 |
-
aria-label="<?php esc_html_e( 'More options', Forminator::DOMAIN ); ?>">
|
103 |
-
<i class="sui-icon-widget-settings-config" aria-hidden="true"></i>
|
104 |
-
</button>
|
105 |
-
|
106 |
-
<ul>
|
107 |
-
<li>
|
108 |
-
<a href="<?php echo $this->getAdminEditUrl( $module['type'], $module['id'] ); // phpcs:ignore ?>">
|
109 |
-
<i class="sui-icon-pencil" aria-hidden="true"></i> <?php esc_html_e( 'Edit', Forminator::DOMAIN ); ?>
|
110 |
-
</a>
|
111 |
-
</li>
|
112 |
-
|
113 |
-
<li><button class="wpmudev-open-modal"
|
114 |
-
data-modal="preview_quizzes"
|
115 |
-
data-modal-title="<?php echo sprintf( '%s - %s', __( 'Preview Quiz', Forminator::DOMAIN ), htmlspecialchars( htmlspecialchars( forminator_get_form_name( $module['id'], 'quiz' ) ) ) ); // phpcs:ignore ?>"
|
116 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
117 |
-
data-has-leads="<?php echo esc_attr( $has_leads ); ?>"
|
118 |
-
data-leads-id="<?php echo esc_attr( $leads_id ); ?>"
|
119 |
-
data-nonce-preview="<?php echo esc_attr( wp_create_nonce( 'forminator_load_module' ) ); ?>"
|
120 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_preview_quizzes' ) ); ?>">
|
121 |
-
<i class="sui-icon-eye" aria-hidden="true"></i> <?php esc_html_e( 'Preview', Forminator::DOMAIN ); ?>
|
122 |
-
</button></li>
|
123 |
-
|
124 |
-
<li>
|
125 |
-
<button class="copy-clipboard" data-shortcode='[forminator_quiz id="<?php echo esc_attr( $module['id'] ); ?>"]'><i class="sui-icon-code" aria-hidden="true"></i> <?php esc_html_e( 'Copy Shortcode', Forminator::DOMAIN ); ?></button>
|
126 |
-
</li>
|
127 |
-
|
128 |
-
<li><a href="<?php echo admin_url( 'admin.php?page=forminator-entries&form_type=forminator_quizzes&form_id=' . $module['id'] ); // phpcs:ignore ?>"><i class="sui-icon-community-people" aria-hidden="true"></i> <?php esc_html_e( 'View Submissions', Forminator::DOMAIN ); ?></a></li>
|
129 |
-
|
130 |
-
<li <?php echo ( $module['has_leads'] ) ? 'aria-hidden="true"' : ''; ?>><form method="post">
|
131 |
-
<input type="hidden" name="forminator_action" value="clone">
|
132 |
-
<input type="hidden" name="form_type" value="quiz">
|
133 |
-
<input type="hidden" name="id" value="<?php echo esc_attr( $module['id'] ); ?>"/>
|
134 |
-
<?php
|
135 |
-
$clone_nonce = esc_attr( 'forminator-nonce-clone-' . $module['id'] );
|
136 |
-
wp_nonce_field( $clone_nonce, $clone_nonce );
|
137 |
-
?>
|
138 |
-
<?php if ( $module['has_leads'] ): ?>
|
139 |
-
<button type="submit" disabled="disabled" class="fui-button-with-tag sui-tooltip sui-tooltip-left sui-constrained" data-tooltip="<?php esc_html_e( 'Duplicate isn\'t supported at the moment for the quizzes with lead capturing enabled.', Forminator::DOMAIN ); ?>">
|
140 |
-
<span class="sui-icon-page-multiple" aria-hidden="true"></span>
|
141 |
-
<span class="fui-button-label"><?php esc_html_e( 'Duplicate', Forminator::DOMAIN ); ?></span>
|
142 |
-
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', Forminator::DOMAIN ); ?></span>
|
143 |
-
</button>
|
144 |
-
<?php else: ?>
|
145 |
-
<button type="submit">
|
146 |
-
<i class="sui-icon-page-multiple" aria-hidden="true"></i> <?php esc_html_e( 'Duplicate', Forminator::DOMAIN ); ?>
|
147 |
-
</button>
|
148 |
-
<?php endif; ?>
|
149 |
-
</form></li>
|
150 |
-
|
151 |
-
<?php if ( Forminator::is_import_export_feature_enabled() ) : ?>
|
152 |
-
<?php if ( $module['has_leads'] ): ?>
|
153 |
-
<li aria-hidden="true"><a href="#" class="fui-button-with-tag sui-tooltip sui-tooltip-left"
|
154 |
-
data-tooltip="<?php esc_html_e( 'Export isn\'t supported at the moment for the quizzes with lead capturing enabled.', Forminator::DOMAIN ); ?>">
|
155 |
-
<span class="sui-icon-cloud-migration" aria-hidden="true"></span>
|
156 |
-
<span class="fui-button-label"><?php esc_html_e( 'Export', Forminator::DOMAIN ); ?></span>
|
157 |
-
<span class="sui-tag sui-tag-blue sui-tag-sm"><?php echo esc_html__( 'Coming soon', Forminator::DOMAIN ); ?></span>
|
158 |
-
</a></li>
|
159 |
-
<?php else: ?>
|
160 |
-
<li><a href="#"
|
161 |
-
class="wpmudev-open-modal"
|
162 |
-
data-modal="export_quiz"
|
163 |
-
data-modal-title=""
|
164 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
165 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_popup_export_quiz' ) ); ?>">
|
166 |
-
<i class="sui-icon-cloud-migration" aria-hidden="true"></i> <?php esc_html_e( 'Export', Forminator::DOMAIN ); ?>
|
167 |
-
</a></li>
|
168 |
-
<?php endif; ?>
|
169 |
-
|
170 |
-
<?php endif; ?>
|
171 |
-
|
172 |
-
<li><a href="#"
|
173 |
-
class="wpmudev-open-modal"
|
174 |
-
data-modal="delete-module"
|
175 |
-
data-modal-title="<?php esc_attr_e( 'Delete Quiz', Forminator::DOMAIN ); ?>"
|
176 |
-
data-modal-content="<?php esc_attr_e( 'Are you sure you wish to permanently delete this quiz?', Forminator::DOMAIN ); ?>"
|
177 |
-
data-form-id="<?php echo esc_attr( $module['id'] ); ?>"
|
178 |
-
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminatorQuizFormRequest' ) ); ?>">
|
179 |
-
<i class="sui-icon-trash" aria-hidden="true"></i> <?php esc_html_e( 'Delete', Forminator::DOMAIN ); ?>
|
180 |
-
</a></li>
|
181 |
-
|
182 |
-
</ul>
|
183 |
-
|
184 |
-
</div>
|
185 |
-
|
186 |
-
</td>
|
187 |
-
|
188 |
-
</tr>
|
189 |
-
|
190 |
-
<?php } ?>
|
191 |
-
|
192 |
-
</tbody>
|
193 |
-
|
194 |
-
</table>
|
195 |
-
|
196 |
-
<div class="sui-box-footer">
|
197 |
-
|
198 |
-
<button class="sui-button sui-button-blue wpmudev-open-modal forminator-create-quiz"
|
199 |
-
data-modal="quizzes">
|
200 |
-
<i class="sui-icon-plus" aria-hidden="true"></i> <?php esc_html_e( 'Create', Forminator::DOMAIN ); ?>
|
201 |
-
</button>
|
202 |
-
|
203 |
-
<div class="sui-actions-right">
|
204 |
-
<p class="sui-description"><a href="<?php echo admin_url( 'admin.php?page=forminator-quiz' ); // phpcs:ignore ?>" class="sui-link-gray"><?php esc_html_e( 'View all quizzes', Forminator::DOMAIN ); ?></a></p>
|
205 |
-
</div>
|
206 |
-
|
207 |
-
</div>
|
208 |
-
|
209 |
-
<?php } ?>
|
210 |
-
|
211 |
-
</div>
|
1 |
<?php
|
2 |
+
$module_slug = 'quiz';
|
3 |
+
$title = __( 'Quizzes', 'forminator' );
|
4 |
+
$description = __( 'Create fun or challenging quizzes for your visitors to take and share on social media.', 'forminator' );
|
5 |
+
$icon = 'sui-icon-academy';
|
6 |
+
$preview_title = __( 'Preview Quiz', 'forminator' );
|
7 |
+
$delete_title = __( 'Delete Quiz', 'forminator' );
|
8 |
+
$delete_description = __( 'Are you sure you wish to permanently delete this quiz?', 'forminator' );
|
9 |
+
$view_all = __( 'View all quizzes', 'forminator' );
|
10 |
+
$total = forminator_quizzes_total();
|
11 |
+
|
12 |
+
require forminator_plugin_dir() . 'admin/views/common/dashboard/widget.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/dashboard/widgets/widget-resume.php
CHANGED
@@ -22,18 +22,18 @@ $last_submission = forminator_get_latest_entry_time( 'custom-forms' );
|
|
22 |
<?php } ?>
|
23 |
|
24 |
<?php if ( 1 === $total_modules ) { ?>
|
25 |
-
<span class="sui-summary-sub"><?php esc_html_e( 'Active Module',
|
26 |
<?php } else { ?>
|
27 |
-
<span class="sui-summary-sub"><?php esc_html_e( 'Active Modules',
|
28 |
<?php } ?>
|
29 |
|
30 |
<?php if ( $total_modules > 0 ) { ?>
|
31 |
<span class="sui-summary-detail"><strong><?php echo esc_html( $last_submission ); ?></strong></span>
|
32 |
<?php } else { ?>
|
33 |
-
<span class="sui-summary-detail"><strong><?php esc_html_e( 'Never',
|
34 |
<?php } ?>
|
35 |
|
36 |
-
<span class="sui-summary-sub"><?php esc_html_e( 'Last Submission',
|
37 |
|
38 |
</div>
|
39 |
|
@@ -44,7 +44,7 @@ $last_submission = forminator_get_latest_entry_time( 'custom-forms' );
|
|
44 |
<ul class="sui-list">
|
45 |
|
46 |
<li>
|
47 |
-
<span class="sui-list-label"><?php esc_html_e( 'Form Submissions',
|
48 |
<?php if ( $forms_total_submissions > 0 ) { ?>
|
49 |
<span class="sui-list-detail"><?php echo esc_html( $forms_total_submissions ); ?></span>
|
50 |
<?php } else { ?>
|
@@ -53,7 +53,7 @@ $last_submission = forminator_get_latest_entry_time( 'custom-forms' );
|
|
53 |
</li>
|
54 |
|
55 |
<li>
|
56 |
-
<span class="sui-list-label"><?php esc_html_e( 'Poll Submissions',
|
57 |
<?php if ( $poll_total_submissions > 0 ) { ?>
|
58 |
<span class="sui-list-detail"><?php echo esc_html( $poll_total_submissions ); ?></span>
|
59 |
<?php } else { ?>
|
@@ -62,7 +62,7 @@ $last_submission = forminator_get_latest_entry_time( 'custom-forms' );
|
|
62 |
</li>
|
63 |
|
64 |
<li>
|
65 |
-
<span class="sui-list-label"><?php esc_html_e( 'Quiz Submissions',
|
66 |
<?php if ( $quiz_total_submissions > 0 ) { ?>
|
67 |
<span class="sui-list-detail"><?php echo esc_html( $quiz_total_submissions ); ?></span>
|
68 |
<?php } else { ?>
|
22 |
<?php } ?>
|
23 |
|
24 |
<?php if ( 1 === $total_modules ) { ?>
|
25 |
+
<span class="sui-summary-sub"><?php esc_html_e( 'Active Module', 'forminator' ); ?></span>
|
26 |
<?php } else { ?>
|
27 |
+
<span class="sui-summary-sub"><?php esc_html_e( 'Active Modules', 'forminator' ); ?></span>
|
28 |
<?php } ?>
|
29 |
|
30 |
<?php if ( $total_modules > 0 ) { ?>
|
31 |
<span class="sui-summary-detail"><strong><?php echo esc_html( $last_submission ); ?></strong></span>
|
32 |
<?php } else { ?>
|
33 |
+
<span class="sui-summary-detail"><strong><?php esc_html_e( 'Never', 'forminator' ); ?></strong></span>
|
34 |
<?php } ?>
|
35 |
|
36 |
+
<span class="sui-summary-sub"><?php esc_html_e( 'Last Submission', 'forminator' ); ?></span>
|
37 |
|
38 |
</div>
|
39 |
|
44 |
<ul class="sui-list">
|
45 |
|
46 |
<li>
|
47 |
+
<span class="sui-list-label"><?php esc_html_e( 'Form Submissions', 'forminator' ); ?></span>
|
48 |
<?php if ( $forms_total_submissions > 0 ) { ?>
|
49 |
<span class="sui-list-detail"><?php echo esc_html( $forms_total_submissions ); ?></span>
|
50 |
<?php } else { ?>
|
53 |
</li>
|
54 |
|
55 |
<li>
|
56 |
+
<span class="sui-list-label"><?php esc_html_e( 'Poll Submissions', 'forminator' ); ?></span>
|
57 |
<?php if ( $poll_total_submissions > 0 ) { ?>
|
58 |
<span class="sui-list-detail"><?php echo esc_html( $poll_total_submissions ); ?></span>
|
59 |
<?php } else { ?>
|
62 |
</li>
|
63 |
|
64 |
<li>
|
65 |
+
<span class="sui-list-label"><?php esc_html_e( 'Quiz Submissions', 'forminator' ); ?></span>
|
66 |
<?php if ( $quiz_total_submissions > 0 ) { ?>
|
67 |
<span class="sui-list-detail"><?php echo esc_html( $quiz_total_submissions ); ?></span>
|
68 |
<?php } else { ?>
|
admin/views/dashboard/widgets/widget-upgrade.php
CHANGED
@@ -2,32 +2,31 @@
|
|
2 |
|
3 |
<div class="sui-box-header">
|
4 |
|
5 |
-
<h2 class="sui-box-title"><span class="sui-icon-forminator" aria-hidden="true"></span> <?php esc_html_e( 'Forminator Pro',
|
6 |
|
7 |
<div class="sui-actions-left" aria-hidden="true">
|
8 |
-
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro',
|
9 |
</div>
|
10 |
|
11 |
</div>
|
12 |
|
13 |
<div class="sui-box-body">
|
14 |
|
15 |
-
<p style="margin-bottom: 34px;"><?php esc_html_e( 'Get Forminator Pro, our full lineup of WordPress marketing tools and more for free when you start your WPMU DEV membership.',
|
16 |
|
17 |
<ul class="sui-list-pro">
|
18 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Premium form fields and E-Signature integration',
|
19 |
-
|
20 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
21 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
22 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
23 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
24 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
25 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '
|
26 |
-
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'The WPMU DEV Guarantee', Forminator::DOMAIN ); ?></li>
|
27 |
</ul>
|
28 |
|
29 |
<p><a href="https://wpmudev.com/project/forminator-pro/?utm_source=forminator&utm_medium=plugin&utm_campaign=forminator_dashboard_upsellwidget_button" class="sui-button sui-button-purple" target="_blank">
|
30 |
-
<?php esc_html_e( 'Try Pro for FREE today!',
|
31 |
</a></p>
|
32 |
|
33 |
</div>
|
2 |
|
3 |
<div class="sui-box-header">
|
4 |
|
5 |
+
<h2 class="sui-box-title"><span class="sui-icon-forminator" aria-hidden="true"></span> <?php esc_html_e( 'Forminator Pro', 'forminator' ); ?></h2>
|
6 |
|
7 |
<div class="sui-actions-left" aria-hidden="true">
|
8 |
+
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro', 'forminator' ); ?></span>
|
9 |
</div>
|
10 |
|
11 |
</div>
|
12 |
|
13 |
<div class="sui-box-body">
|
14 |
|
15 |
+
<p style="margin-bottom: 34px;"><?php esc_html_e( 'Get Forminator Pro, our full lineup of WordPress marketing tools and more for free when you start your WPMU DEV membership.', 'forminator' ); ?></p>
|
16 |
|
17 |
<ul class="sui-list-pro">
|
18 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Premium form fields and E-Signature integration', 'forminator' ); ?></li>
|
19 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Early access to the newest from features', 'forminator' ); ?></li>
|
20 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Smush and Hummingbird Pro performance pack', 'forminator' ); ?></li>
|
21 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Complete marketing suite - pop-ups, email, and more', 'forminator' ); ?></li>
|
22 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Customizable Google analytic dashboard', 'forminator' ); ?></li>
|
23 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'Manage unlimited WordPress sites from the Hub', 'forminator' ); ?></li>
|
24 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( '24/7 live WordPress support', 'forminator' ); ?></li>
|
25 |
+
<li><span class="sui-icon-check sui-lg" aria-hidden="true"></span><?php esc_html_e( 'The WPMU DEV Guarantee', 'forminator' ); ?></li>
|
|
|
26 |
</ul>
|
27 |
|
28 |
<p><a href="https://wpmudev.com/project/forminator-pro/?utm_source=forminator&utm_medium=plugin&utm_campaign=forminator_dashboard_upsellwidget_button" class="sui-button sui-button-purple" target="_blank">
|
29 |
+
<?php esc_html_e( 'Try Pro for FREE today!', 'forminator' ); ?>
|
30 |
</a></p>
|
31 |
|
32 |
</div>
|
admin/views/integrations/addon.php
CHANGED
@@ -1,35 +1,28 @@
|
|
1 |
<?php
|
2 |
$empty_icon = forminator_plugin_url() . 'assets/images/forminator-noicon.png';
|
3 |
$empty_icon2x = forminator_plugin_url() . 'assets/images/forminator-noicon@2x.png';
|
4 |
-
|
5 |
-
|
6 |
-
$form_id = 0;
|
7 |
}
|
8 |
|
9 |
$show_action = false;
|
10 |
|
11 |
$icon_class_action = 'sui-icon-plus';
|
12 |
-
$tooltip = __( 'Configure Integration',
|
13 |
-
$
|
14 |
|
15 |
$multi_id = 0;
|
16 |
$multi_name = false;
|
17 |
|
18 |
-
if ( ! empty( $
|
19 |
-
|
20 |
-
$action_addon = 'forminator_addon_form_settings';
|
21 |
-
$show_action = false;
|
22 |
$icon_class_action = 'sui-icon-plus';
|
23 |
-
|
24 |
-
if ( isset( $addon['is_form_settings_available'] ) && ! empty( $addon['is_form_settings_available'] ) && true === $addon['is_form_settings_available'] ) {
|
25 |
-
|
26 |
$show_action = true;
|
27 |
-
|
28 |
-
if ( $addon['is_allow_multi_on_form'] ) {
|
29 |
-
|
30 |
if ( isset( $addon['multi_name'] ) ) {
|
31 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
32 |
-
$tooltip = __( 'Configure App',
|
33 |
$multi_id = $addon['multi_id'];
|
34 |
$multi_name = $addon['multi_name'];
|
35 |
} else {
|
@@ -39,17 +32,16 @@ if ( ! empty( $form_id ) ) {
|
|
39 |
}
|
40 |
|
41 |
$icon_class_action = 'sui-icon-plus';
|
42 |
-
$tooltip = __( 'Activate App',
|
43 |
|
44 |
}
|
45 |
} else {
|
46 |
-
|
47 |
-
if ( $addon['is_form_connected'] ) {
|
48 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
49 |
-
$tooltip = __( 'Configure App',
|
50 |
} else {
|
51 |
$icon_class_action = 'sui-icon-plus';
|
52 |
-
$tooltip = __( 'Activate App',
|
53 |
}
|
54 |
}
|
55 |
}
|
@@ -62,10 +54,10 @@ if ( ! empty( $form_id ) ) {
|
|
62 |
|
63 |
if ( $addon['is_connected'] ) {
|
64 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
65 |
-
$tooltip = __( 'Configure App',
|
66 |
} else {
|
67 |
$icon_class_action = 'sui-icon-plus';
|
68 |
-
$tooltip = __( 'Connect App',
|
69 |
}
|
70 |
}
|
71 |
}
|
@@ -101,11 +93,11 @@ $pro_url_target = '_blank';
|
|
101 |
*/ ?>
|
102 |
|
103 |
<tr class="
|
104 |
-
<?php
|
105 |
-
if ( ! $is_active && true === $advertising ) {
|
106 |
-
|
107 |
-
?>
|
108 |
-
<?php echo( $is_active ? 'fui-integration-enabled' : '' ); ?>">
|
109 |
|
110 |
<td class="sui-table-item-title">
|
111 |
|
@@ -116,17 +108,17 @@ if ( ! $is_active && true === $advertising ) {
|
|
116 |
<?php if ( isset( $addon['banner'] ) && ! empty( $addon['banner'] ) ) { ?>
|
117 |
|
118 |
<div
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
>
|
124 |
|
125 |
<img
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
/>
|
131 |
|
132 |
</div>
|
@@ -138,28 +130,28 @@ if ( ! $is_active && true === $advertising ) {
|
|
138 |
<div class="fui-app--title">
|
139 |
|
140 |
<span><?php echo esc_html( $addon['title'] ); ?><?php if ( $show_pro_info && $addon['is_pro'] ) : ?>
|
141 |
-
|
142 |
-
<?php esc_html_e( 'PRO',
|
143 |
</span>
|
144 |
-
|
145 |
|
146 |
-
<?php if ( ! $is_active &&
|
147 |
-
<a href="<?php echo esc_url( $addon['documentation'] ); ?>" target="_blank"><?php esc_html_e( 'View Docs',
|
148 |
<?php } ?>
|
149 |
|
150 |
<?php if ( $show_action ) : ?>
|
151 |
<button class="sui-button-icon sui-tooltip sui-tooltip-top-right connect-integration"
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
<i class="<?php echo esc_attr( $icon_class_action ); ?>" aria-hidden="true"></i>
|
162 |
-
<span class="sui-screen-reader-text"><?php esc_html_e( 'Connect this integration',
|
163 |
</button>
|
164 |
<?php endif; ?>
|
165 |
|
@@ -175,42 +167,42 @@ if ( ! $is_active && true === $advertising ) {
|
|
175 |
|
176 |
<?php if ( isset( $addon['icon'] ) && ! empty( $addon['icon'] ) ) { ?>
|
177 |
<img
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
/>
|
184 |
<?php } else { ?>
|
185 |
<img
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
/>
|
192 |
<?php } ?>
|
193 |
|
194 |
<span><?php echo esc_html( $addon['title'] ); ?><?php if ( $show_pro_info && $addon['is_pro'] ) : ?>
|
195 |
-
|
196 |
-
<?php esc_html_e( 'PRO',
|
197 |
</span>
|
198 |
-
|
199 |
|
200 |
<?php if ( $show_action ) : ?>
|
201 |
-
|
202 |
data-tooltip="<?php echo esc_attr( $tooltip ); ?>"
|
203 |
data-slug="<?php echo esc_attr( $addon['slug'] ); ?>"
|
204 |
data-title="<?php echo esc_attr( $addon['title'] ); ?>"
|
205 |
data-image="<?php echo esc_attr( $addon['image'] ); ?>"
|
206 |
data-imagex2="<?php echo esc_attr( $addon['image_x2'] ); ?>"
|
207 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_addon_action' ) ); ?>"
|
208 |
-
data-action="<?php echo esc_attr( $
|
209 |
-
data
|
210 |
data-multi-id="<?php echo esc_attr( $multi_id ); ?>">
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
<?php endif; ?>
|
215 |
|
216 |
<?php } ?>
|
1 |
<?php
|
2 |
$empty_icon = forminator_plugin_url() . 'assets/images/forminator-noicon.png';
|
3 |
$empty_icon2x = forminator_plugin_url() . 'assets/images/forminator-noicon@2x.png';
|
4 |
+
if ( empty( $module_id ) ) {
|
5 |
+
$module_id = 0;
|
|
|
6 |
}
|
7 |
|
8 |
$show_action = false;
|
9 |
|
10 |
$icon_class_action = 'sui-icon-plus';
|
11 |
+
$tooltip = __( 'Configure Integration', 'forminator' );
|
12 |
+
$action = 'forminator_addon_settings';
|
13 |
|
14 |
$multi_id = 0;
|
15 |
$multi_name = false;
|
16 |
|
17 |
+
if ( ! empty( $module_id ) ) {
|
18 |
+
$action = 'forminator_addon_module_settings';
|
|
|
|
|
19 |
$icon_class_action = 'sui-icon-plus';
|
20 |
+
if ( ! empty( $addon['is_' . $module_slug . '_settings_available'] ) && true === $addon['is_' . $module_slug . '_settings_available'] ) {
|
|
|
|
|
21 |
$show_action = true;
|
22 |
+
if ( $addon['is_allow_multi_on_' . $module_slug ] ) {
|
|
|
|
|
23 |
if ( isset( $addon['multi_name'] ) ) {
|
24 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
25 |
+
$tooltip = __( 'Configure App', 'forminator' );
|
26 |
$multi_id = $addon['multi_id'];
|
27 |
$multi_name = $addon['multi_name'];
|
28 |
} else {
|
32 |
}
|
33 |
|
34 |
$icon_class_action = 'sui-icon-plus';
|
35 |
+
$tooltip = __( 'Activate App', 'forminator' );
|
36 |
|
37 |
}
|
38 |
} else {
|
39 |
+
if ( $addon['is_' . $module_slug . '_connected'] ) {
|
|
|
40 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
41 |
+
$tooltip = __( 'Configure App', 'forminator' );
|
42 |
} else {
|
43 |
$icon_class_action = 'sui-icon-plus';
|
44 |
+
$tooltip = __( 'Activate App', 'forminator' );
|
45 |
}
|
46 |
}
|
47 |
}
|
54 |
|
55 |
if ( $addon['is_connected'] ) {
|
56 |
$icon_class_action = 'sui-icon-widget-settings-config';
|
57 |
+
$tooltip = __( 'Configure App', 'forminator' );
|
58 |
} else {
|
59 |
$icon_class_action = 'sui-icon-plus';
|
60 |
+
$tooltip = __( 'Connect App', 'forminator' );
|
61 |
}
|
62 |
}
|
63 |
}
|
93 |
*/ ?>
|
94 |
|
95 |
<tr class="
|
96 |
+
<?php
|
97 |
+
if ( ! $is_active && true === $advertising ) {
|
98 |
+
echo 'fui-app--promote '; }
|
99 |
+
?>
|
100 |
+
<?php echo( $is_active ? 'fui-integration-enabled' : '' ); ?>">
|
101 |
|
102 |
<td class="sui-table-item-title">
|
103 |
|
108 |
<?php if ( isset( $addon['banner'] ) && ! empty( $addon['banner'] ) ) { ?>
|
109 |
|
110 |
<div
|
111 |
+
role="banner"
|
112 |
+
class="fui-app--banner"
|
113 |
+
data-app="<?php echo esc_attr( $addon['slug'] ); ?>"
|
114 |
+
aria-hidden="true"
|
115 |
>
|
116 |
|
117 |
<img
|
118 |
+
src="<?php echo esc_url( $addon['banner'] ); ?>"
|
119 |
+
srcset="<?php echo esc_url( $addon['banner'] ); ?> 1x, <?php echo esc_url( $addon['banner_x2'] ); ?> 2x"
|
120 |
+
alt="<?php echo esc_attr( $addon['short_title'] ); ?>"
|
121 |
+
class="sui-image"
|
122 |
/>
|
123 |
|
124 |
</div>
|
130 |
<div class="fui-app--title">
|
131 |
|
132 |
<span><?php echo esc_html( $addon['title'] ); ?><?php if ( $show_pro_info && $addon['is_pro'] ) : ?>
|
133 |
+
<span class="sui-tag sui-tag-pro">
|
134 |
+
<?php esc_html_e( 'PRO', 'forminator' ); ?>
|
135 |
</span>
|
136 |
+
<?php endif; ?></span>
|
137 |
|
138 |
+
<?php if ( ! $is_active && ! empty( $addon['documentation'] ) && forminator_is_show_documentation_link() ) { ?>
|
139 |
+
<a href="<?php echo esc_url( $addon['documentation'] ); ?>" target="_blank"><?php esc_html_e( 'View Docs', 'forminator' ); ?></a>
|
140 |
<?php } ?>
|
141 |
|
142 |
<?php if ( $show_action ) : ?>
|
143 |
<button class="sui-button-icon sui-tooltip sui-tooltip-top-right connect-integration"
|
144 |
+
data-tooltip="<?php echo esc_attr( $tooltip ); ?>"
|
145 |
+
data-slug="<?php echo esc_attr( $addon['slug'] ); ?>"
|
146 |
+
data-title="<?php echo esc_attr( $addon['title'] ); ?>"
|
147 |
+
data-image="<?php echo esc_attr( $addon['image'] ); ?>"
|
148 |
+
data-imagex2="<?php echo esc_attr( $addon['image_x2'] ); ?>"
|
149 |
+
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_addon_action' ) ); ?>"
|
150 |
+
data-action="<?php echo esc_attr( $action ); ?>"
|
151 |
+
data-<?php echo esc_attr( $module_slug ); ?>-id="<?php echo esc_attr( $module_id ); ?>"
|
152 |
+
data-multi-id="<?php echo esc_attr( $multi_id ); ?>">
|
153 |
<i class="<?php echo esc_attr( $icon_class_action ); ?>" aria-hidden="true"></i>
|
154 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Connect this integration', 'forminator' ); ?></span>
|
155 |
</button>
|
156 |
<?php endif; ?>
|
157 |
|
167 |
|
168 |
<?php if ( isset( $addon['icon'] ) && ! empty( $addon['icon'] ) ) { ?>
|
169 |
<img
|
170 |
+
src="<?php echo esc_url( $addon['icon'] ); ?>"
|
171 |
+
srcset="<?php echo esc_url( $addon['icon'] ); ?> 1x, <?php echo esc_url( $addon['icon_x2'] ); ?> 2x"
|
172 |
+
alt="<?php echo esc_attr( $addon['short_title'] ); ?>"
|
173 |
+
class="sui-image"
|
174 |
+
aria-hidden="true"
|
175 |
/>
|
176 |
<?php } else { ?>
|
177 |
<img
|
178 |
+
src="<?php echo esc_url( $empty_icon ); ?>"
|
179 |
+
srcset="<?php echo esc_url( $empty_icon ); ?> 1x, <?php echo esc_url( $empty_icon2x ); ?> 2x"
|
180 |
+
alt="<?php echo esc_attr( $addon['short_title'] ); ?>"
|
181 |
+
class="sui-image"
|
182 |
+
aria-hidden="true"
|
183 |
/>
|
184 |
<?php } ?>
|
185 |
|
186 |
<span><?php echo esc_html( $addon['title'] ); ?><?php if ( $show_pro_info && $addon['is_pro'] ) : ?>
|
187 |
+
<span class="sui-tag sui-tag-pro">
|
188 |
+
<?php esc_html_e( 'PRO', 'forminator' ); ?>
|
189 |
</span>
|
190 |
+
<?php endif; ?></span>
|
191 |
|
192 |
<?php if ( $show_action ) : ?>
|
193 |
+
<button class="sui-button-icon sui-tooltip sui-tooltip-top-right connect-integration"
|
194 |
data-tooltip="<?php echo esc_attr( $tooltip ); ?>"
|
195 |
data-slug="<?php echo esc_attr( $addon['slug'] ); ?>"
|
196 |
data-title="<?php echo esc_attr( $addon['title'] ); ?>"
|
197 |
data-image="<?php echo esc_attr( $addon['image'] ); ?>"
|
198 |
data-imagex2="<?php echo esc_attr( $addon['image_x2'] ); ?>"
|
199 |
data-nonce="<?php echo esc_attr( wp_create_nonce( 'forminator_addon_action' ) ); ?>"
|
200 |
+
data-action="<?php echo esc_attr( $action ); ?>"
|
201 |
+
data-<?php echo esc_attr( $module_slug ); ?>-id="<?php echo esc_attr( $module_id ); ?>"
|
202 |
data-multi-id="<?php echo esc_attr( $multi_id ); ?>">
|
203 |
+
<i class="<?php echo esc_attr( $icon_class_action ); ?>" aria-hidden="true"></i>
|
204 |
+
<span class="sui-screen-reader-text"><?php esc_html_e( 'Connect this integration', 'forminator' ); ?></span>
|
205 |
+
</button>
|
206 |
<?php endif; ?>
|
207 |
|
208 |
<?php } ?>
|
admin/views/integrations/content.php
CHANGED
@@ -7,19 +7,19 @@
|
|
7 |
<ul class="sui-vertical-tabs sui-sidenav-hide-md">
|
8 |
|
9 |
<li class="sui-vertical-tab forminator-integrations" data-tab-id="forminator-integrations">
|
10 |
-
<a href="#forminator-integrations" role="button"><?php esc_html_e( 'Applications',
|
11 |
</li>
|
12 |
<?php if ( forminator_is_show_documentation_link() ) { ?>
|
13 |
<li class="sui-vertical-tab forminator-api" data-tab-id="forminator-api">
|
14 |
-
<a href="#forminator-api" role="button"><?php esc_html_e( 'API',
|
15 |
</li>
|
16 |
<?php } ?>
|
17 |
</ul>
|
18 |
|
19 |
<select class="sui-mobile-nav sui-sidenav-hide-lg">
|
20 |
-
<option value="forminator-integrations"><?php esc_html_e(
|
7 |
<ul class="sui-vertical-tabs sui-sidenav-hide-md">
|
8 |
|
9 |
<li class="sui-vertical-tab forminator-integrations" data-tab-id="forminator-integrations">
|
10 |
+
<a href="#forminator-integrations" role="button"><?php esc_html_e( 'Applications', 'forminator' ); ?></a>
|
11 |
</li>
|
12 |
<?php if ( forminator_is_show_documentation_link() ) { ?>
|
13 |
<li class="sui-vertical-tab forminator-api" data-tab-id="forminator-api">
|
14 |
+
<a href="#forminator-api" role="button"><?php esc_html_e( 'API', 'forminator' ); ?></a>
|
15 |
</li>
|
16 |
<?php } ?>
|
17 |
</ul>
|
18 |
|
19 |
<select class="sui-mobile-nav sui-sidenav-hide-lg">
|
|