AddEventTicketsToDonationConfirmationPageDonationTotal.php
1 year ago
AddEventTicketsToDonationConfirmationPageEventTicketDetails.php
2 years ago
AttachAttendeeDataToTicketData.php
2 years ago
ConvertEventTicketsBlockToFieldsApi.php
11 months ago
EnqueueDonationFormScripts.php
2 years ago
EnqueueEventDetailsScripts.php
1 year ago
EnqueueFormBuilderScripts.php
1 year ago
EnqueueListTableScripts.php
1 year ago
GenerateTicketsFromPurchaseData.php
11 months ago
RegisterEventsMenuItem.php
5 months ago
RenderDonationFormBlock.php
2 years ago
UpdateDonationConfirmationPageReceiptDonationAmount.php
2 years ago
EnqueueEventDetailsScripts.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\EventTickets\Actions; |
| 4 | |
| 5 | use Give\EventTickets\Models\Event; |
| 6 | use Give\EventTickets\ViewModels\EventDetails; |
| 7 | use Give\Helpers\EnqueueScript; |
| 8 | |
| 9 | class EnqueueEventDetailsScripts |
| 10 | { |
| 11 | public function __invoke(Event $event) |
| 12 | { |
| 13 | $data = [ |
| 14 | 'apiRoot' => esc_url_raw(rest_url('give-api/v2/events-tickets')), |
| 15 | 'apiNonce' => wp_create_nonce('wp_rest'), |
| 16 | 'adminUrl' => admin_url(), |
| 17 | 'pluginUrl' => GIVE_PLUGIN_URL, |
| 18 | 'currencyCode' => give_get_currency(), |
| 19 | 'event' => (new EventDetails($event))->exports(), |
| 20 | ]; |
| 21 | |
| 22 | EnqueueScript::make('give-admin-event-tickets-details', 'build/assets/dist/js/give-admin-event-tickets-details.js') |
| 23 | ->loadInFooter() |
| 24 | ->registerTranslations() |
| 25 | ->registerLocalizeData('GiveEventTicketsDetails', $data)->enqueue(); |
| 26 | |
| 27 | wp_enqueue_style( |
| 28 | 'give-admin-ui-font', |
| 29 | 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400..700&display=swap', |
| 30 | [], |
| 31 | null |
| 32 | ); |
| 33 | |
| 34 | wp_enqueue_style('givewp-design-system-foundation'); |
| 35 | } |
| 36 | } |
| 37 |