PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.6
JetFormBuilder — Dynamic Blocks Form Builder v3.6.6
3.6.6.1 3.6.6 3.6.5.4 3.6.5.3 3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 134 releases
jetformbuilder / modules / gateways / pages / payments-page.php

payments-page.php in JetFormBuilder — Dynamic Blocks Form Builder 3.6.6, at modules/gateways/pages/payments-page.php

65 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Pages;
5
6 use Jet_Form_Builder\Admin\Pages\Base_Page;
7 use Jet_Form_Builder\Admin\Pages\interfaces\Page_Script_Declaration_Interface;
8 use Jet_Form_Builder\Admin\Pages\Pages_Manager;
9 use Jet_Form_Builder\Exceptions\Repository_Exception;
10 use JFB_Modules\Gateways\Module;
11 use JFB_Modules\Gateways\Table_Views\Payments;
12
13 // If this file is called directly, abort.
14 if ( ! defined( 'WPINC' ) ) {
15 die;
16 }
17
18 class Payments_Page extends Base_Page implements Page_Script_Declaration_Interface {
19
20 use Gateways_Pages_Trait;
21
22 const SLUG = 'jfb-payments';
23
24 public function slug(): string {
25 return self::SLUG;
26 }
27
28 public function title(): string {
29 return __( 'Payments', 'jet-form-builder' );
30 }
31
32 public function page_config(): array {
33 $view = new Payments();
34
35 return $view->load_view();
36 }
37
38 public function assets() {
39 wp_enqueue_script( Pages_Manager::SCRIPT_VUEX_PACKAGE );
40
41 parent::assets();
42 }
43
44 /**
45 * @throws Repository_Exception
46 */
47 public function register_scripts() {
48 /** @var Module $module */
49 /** @noinspection PhpUnhandledExceptionInspection */
50 $module = jet_form_builder()->module( 'gateways' );
51 $script_asset = require_once $module->get_dir(
52 'assets/build/admin/pages/jfb-payments.asset.php'
53 );
54
55 wp_register_script(
56 $this->slug(),
57 $this->base_script_url(),
58 $script_asset['dependencies'],
59 $script_asset['version'],
60 true
61 );
62 }
63
64 }
65