diff options
| author | daniel <noreply@maennchen1.de> | 2026-10-01 13:28:23 +0200 |
|---|---|---|
| committer | daniel <noreply@maennchen1.de> | 2026-10-01 13:28:23 +0200 |
| commit | 1a90b3f0d59f8db10f90f8a3c64dde404f0767c4 (patch) | |
| tree | b035cd24cc0802a6b3498337e8fdb695385f6f3f /views/mods/mod_addressvalidation/settings_edit.phtml | |
| parent | 9de7219882c5e4298389b260a88d308f26214c70 (diff) | |
- Screenshots für Modul "Amazon" Doku
Diffstat (limited to 'views/mods/mod_addressvalidation/settings_edit.phtml')
| -rw-r--r-- | views/mods/mod_addressvalidation/settings_edit.phtml | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/views/mods/mod_addressvalidation/settings_edit.phtml b/views/mods/mod_addressvalidation/settings_edit.phtml index db047cc..76bf30b 100644 --- a/views/mods/mod_addressvalidation/settings_edit.phtml +++ b/views/mods/mod_addressvalidation/settings_edit.phtml @@ -5,8 +5,62 @@ */
?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), array('help' => 'wpsg_mod_addressvalidation_apikey')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), ['help' => 'wpsg_mod_addressvalidation_apikey']); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_addressvalidation_suspect', __('Verdächtige Adressen', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['arSuspect'], $this->view['wpsg_mod_addressvalidation']['suspect'], ['hint' => __('Der Dienst meldet eine Adresse als verdächtig, wenn sie gefunden wurde, aber einzelne Angaben abweichen, z. B. ein früherer Gemeindename. Mit "Nur Hinweis" geht die Bestellung durch und der Kunde sieht die vorgeschlagene Schreibweise.', 'wpsg')]); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_ratelimit', __('Anfragen je Besucher (10 Minuten)', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['ratelimit'], ['help' => 'wpsg_mod_addressvalidation_ratelimit']); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_daylimit', __('Anfragen je Tag (ganzer Shop)', 'wpsg'), $this->view['wpsg_mod_addressvalidation']['daylimit'], ['help' => 'wpsg_mod_addressvalidation_daylimit']); ?>
+
+<?php echo wpsg_drawForm_TextStart(); ?>
+<button type="button" class="button" id="wpsg_mod_addressvalidation_test" data-url="<?php echo esc_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_addressvalidation&do=testApiKey&noheader=1'); ?>" data-nonce="<?php echo esc_attr(wp_create_nonce('wpsg-addressvalidation-testApiKey')); ?>" data-field="#<?php echo esc_attr(wpsg_drawForm_getID('wpsg_mod_addressvalidation_apikey')); ?>">
+ <?php echo esc_html__('API-Key testen', 'wpsg'); ?>
+</button>
+<p id="wpsg_mod_addressvalidation_test_result"></p>
+<p class="description"><?php echo esc_html__('Die Testanfrage verbraucht beim Dienst ein Guthaben.', 'wpsg'); ?></p>
+<?php echo wpsg_drawForm_TextEnd(__('Verbindungstest', 'wpsg'), ['noP' => true]); ?>
<a class="button-primary" id="button-google" target="popup" href="http://www.address-validator.net/address-online-verification-api.html" onclick="window.open('', 'popup', 'width=500;height=200,resizable=yes,menubar=yes')">
- <?php echo __('Schlüssel anfordern', 'wpsg'); ?>
-</a>
\ No newline at end of file + <?php echo esc_html__('Schlüssel anfordern', 'wpsg'); ?>
+</a>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_addressvalidation_test').on('click', function() {
+
+ var oButton = jQuery(this);
+ var oResult = jQuery('#wpsg_mod_addressvalidation_test_result');
+
+ oButton.prop('disabled', true);
+ oResult.removeClass('text-success text-danger').text('<?php echo esc_js(__('Prüfe API-Key …', 'wpsg')); ?>');
+
+ jQuery.post(oButton.data('url'), {
+ apikey: jQuery(oButton.data('field')).val(),
+ wpsg_nonce: oButton.data('nonce')
+ }).done(function(response) {
+
+ oResult.addClass((response.success)?'text-success':'text-danger').text(response.data.message);
+
+ }).fail(function(xhr) {
+
+ var strMessage = '<?php echo esc_js(__('Die Prüfung ist fehlgeschlagen.', 'wpsg')); ?>';
+
+ if (xhr.responseJSON && xhr.responseJSON.data && xhr.responseJSON.data.message) {
+
+ strMessage = xhr.responseJSON.data.message;
+
+ }
+
+ oResult.addClass('text-danger').text(strMessage);
+
+ }).always(function() {
+
+ oButton.prop('disabled', false);
+
+ });
+
+ });
+
+ });
+
+/* ]]> */</script>
\ No newline at end of file |
