PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.3
JetFormBuilder — Dynamic Blocks Form Builder v3.2.3
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 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / gateways / pages / export-page.php
jetformbuilder / modules / gateways / pages Last commit date
export-page.php 2 years ago gateways-pages-trait.php 2 years ago payments-page.php 2 years ago print-page.php 2 years ago single-payment-page.php 2 years ago single-payment-print-page.php 2 years ago
export-page.php
72 lines
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Pages;
5
6 use JFB_Components\Admin\Page\Interfaces\Action_Page_It;
7 use JFB_Components\Admin\Page\Traits\Action_Page_Trait;
8 use JFB_Components\Export\Export_Tools;
9 use JFB_Components\Wp_Nonce\Wp_Nonce;
10 use JFB_Components\Wp_Nonce\Wp_Nonce_It;
11 use JFB_Components\Wp_Nonce\Wp_Nonce_Trait;
12 use JFB_Modules\Gateways\Export;
13
14 // If this file is called directly, abort.
15 if ( ! defined( 'WPINC' ) ) {
16 die;
17 }
18
19 class Export_Page implements Action_Page_It, Wp_Nonce_It {
20
21 use Action_Page_Trait;
22 use Wp_Nonce_Trait;
23
24 public function __construct() {
25 $nonce = new Wp_Nonce( 'jfb-action-admin-' . $this->slug() );
26 $this->set_wp_nonce( $nonce );
27 }
28
29 public function slug(): string {
30 return 'payments-export';
31 }
32
33 public function check_permission(): bool {
34 return $this->get_wp_nonce()->verify() && current_user_can( 'manage_options' );
35 }
36
37 public function render_page() {
38 $exporter = Export_Tools::get_exporter_by_format();
39
40 //phpcs:ignore WordPress.Security.NonceVerification.Recommended
41 $controller = array_key_exists( 'id', $_GET )
42 ? new Export\Single_Controller()
43 : new Export\Multiple_Controller();
44
45 $controller->set_exporter( $exporter );
46
47 try {
48 $controller->do_export();
49 } catch ( \Exception $exception ) {
50 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
51 wp_die(
52 $exception->getMessage(),
53 __( 'Error', 'jet-form-builder' )
54 );
55 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
56 }
57 }
58
59 public function get_url( $query_args = array() ): string {
60 return $this->admin_url(
61 array_merge(
62 array(
63 'slug' => $this->slug(),
64 $this->get_wp_nonce()->get_name() => $this->get_wp_nonce()->create(),
65 ),
66 $query_args
67 )
68 );
69 }
70
71 }
72