PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / trunk
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder vtrunk
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Report / ReportHandler.php

ReportHandler.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder trunk, at app/Modules/Report/ReportHandler.php

63 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Report;
4
5 if (!defined('ABSPATH')) {
6 exit; // Exit if accessed directly.
7 }
8
9 use FluentForm\App\Helpers\Helper;
10 use FluentForm\App\Modules\Registerer\TranslationString;
11 use FluentForm\Framework\Helpers\ArrayHelper;
12 use FluentForm\App\Modules\Payments\PaymentHelper;
13
14 class ReportHandler
15 {
16 protected $app;
17
18 public function register($app)
19 {
20 $this->app = $app;
21 $app->addAction('fluentform/render_report', [$this, 'renderReport']);
22 }
23
24 public function renderReport()
25 {
26 wp_enqueue_script('fluentform_reports');
27 wp_enqueue_style('fluentform_reports');
28
29
30 // Maybe load intl-tel-input flags
31 if (Helper::hasPro() && defined('FLUENTFORMPRO_DIR_URL')) {
32 $file = is_rtl() ? 'intlTelInput-rtl.min.css' : 'intlTelInput.min.css';
33 wp_enqueue_style(
34 'intlTelInput',
35 FLUENTFORMPRO_DIR_URL . 'public/libs/intl-tel-input/css/' . $file,
36 [],
37 '24.2.0'
38 );
39 }
40
41
42 $hasPayment = false;
43 $paymentSettings = get_option('__fluentform_payment_module_settings');
44 if ($paymentSettings && ArrayHelper::get($paymentSettings, 'status') === 'yes') {
45 $hasPayment = true;
46 }
47
48 wp_localize_script('fluentform_reports', 'FluentFormApp', [
49 'has_payment' => $hasPayment,
50 'has_pro' => Helper::hasPro(),
51 'upgrade_url' => fluentform_upgrade_url(),
52 'has_pdf' => defined('FLUENTFORM_PDF_VERSION'),
53 'reports_i18n' => TranslationString::getReportsI18n(),
54 'payment_statuses' => PaymentHelper::getPaymentStatuses(),
55 'payment_methods' => apply_filters('fluentform/available_payment_methods', [])
56 ]);
57
58 $this->app->view->render('admin.reports.index', [
59 'logo' => fluentformMix('img/fluentform-logo.svg'),
60 ]);
61 }
62 }
63