22
33namespace Give \PaymentGateways \TheGivingBlock \Admin \CustomFields ;
44
5+ use Give \PaymentGateways \TheGivingBlock \Admin \Tabs \GetStarted \GetStartedTabContent ;
6+
57/**
68 * Custom setting field for GiveWP > Payment Gateways > The Giving Block > Get Started tab.
79 *
@@ -18,58 +20,6 @@ class GetStartedSettingField
1820 */
1921 public function handle (array $ field ): void
2022 {
21- $ classes = !empty ($ field ['wrapper_class ' ]) ? esc_attr ($ field ['wrapper_class ' ]) : '' ;
22- $ organizationTabUrl = admin_url (
23- 'edit.php?post_type=give_forms&page=give-settings&tab=gateways§ion=the-giving-block&group=organization '
24- );
25- ?>
26- <div class="give-tgb-setting-field give-tgb-get-started <?php echo $ classes ; ?> ">
27- <p class="give-tgb-get-started-welcome">
28- <?php esc_html_e ('Welcome to The Giving Block. With this integration, you can accept cryptocurrency and stock donations. The Giving Block provides its own donation form, rendered via a shortcode or block in the WordPress block editor. ' , 'give ' ); ?>
29- </p>
30-
31- <div class="give-tgb-quick-start-box" style="background: #f0f8ff; border: 1px solid #0073aa; padding: 15px; border-radius: 5px; margin: 20px 0;">
32- <h3 class="give-tgb-quick-start-title" style="margin-top: 0;">
33- <span class="dashicons dashicons-rocket"></span> <?php esc_html_e ('Quick Start ' , 'give ' ); ?>
34- </h3>
35- <p class="give-tgb-quick-start-intro">
36- <?php esc_html_e ('To get started with crypto and stock donations: ' , 'give ' ); ?>
37- </p>
38- <ol class="give-tgb-quick-start-steps">
39- <li>
40- <?php esc_html_e ('Use the Organization tab to connect your existing organization or create a new one with The Giving Block. ' , 'give ' ); ?>
41- </li>
42- <li>
43- <?php esc_html_e ('Add The Giving Block donation form to any page or post using the shortcode or block in the editor. ' , 'give ' ); ?>
44- </li>
45- <li>
46- <?php esc_html_e ('Use the Options tab to manage your data and configure additional settings. ' , 'give ' ); ?>
47- </li>
48- </ol>
49- <p class="give-tgb-quick-start-actions">
50- <a href="<?php echo esc_url ($ organizationTabUrl ); ?> " class="button button-secondary give-tgb-connect-organization-btn" data-give-tgb-switch-group="organization">
51- <?php esc_html_e ('Connect Organization ' , 'give ' ); ?>
52- </a>
53- </p>
54- </div>
55- </div>
56- <script>
57- (function() {
58- document.addEventListener('DOMContentLoaded', function() {
59- document.querySelectorAll('[data-give-tgb-switch-group]').forEach(function(btn) {
60- btn.addEventListener('click', function(e) {
61- e.preventDefault();
62- var group = btn.getAttribute('data-give-tgb-switch-group');
63- var menu = document.querySelector('.give-settings-section-content .give-settings-section-group-menu');
64- if (!menu) return;
65- var tabLink = menu.querySelector('a[data-group="' + group.replace(/["\\]/g, '\\$&') + '"]');
66- if (tabLink) tabLink.click();
67- return false;
68- });
69- });
70- });
71- })();
72- </script>
73- <?php
23+ give (GetStartedTabContent::class)->display ();
7424 }
7525}
0 commit comments