helpful-links-box.php
2 years ago
pro-notice.php
2 years ago
settings-page.php
2 years ago
useful-banner-box.php
2 years ago
settings-page.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Jet_Form_Builder\Admin\Pages\Settings; |
| 5 | |
| 6 | use Jet_Form_Builder\Admin\Pages\Base_Page; |
| 7 | use Jet_Form_Builder\Admin\Pages\Pages_Manager; |
| 8 | use Jet_Form_Builder\Classes\Arrayable\Array_Tools; |
| 9 | |
| 10 | // If this file is called directly, abort. |
| 11 | if ( ! defined( 'WPINC' ) ) { |
| 12 | die; |
| 13 | } |
| 14 | |
| 15 | class Settings_Page extends Base_Page { |
| 16 | |
| 17 | /** |
| 18 | * Page slug |
| 19 | */ |
| 20 | public function slug(): string { |
| 21 | return 'jfb-settings'; |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Page title |
| 26 | */ |
| 27 | public function title(): string { |
| 28 | return __( 'Settings', 'jet-form-builder' ); |
| 29 | } |
| 30 | |
| 31 | |
| 32 | /** |
| 33 | * Return page config array |
| 34 | */ |
| 35 | public function page_config(): array { |
| 36 | $this->boxes()->register_box( new Helpful_Links_Box() ); |
| 37 | |
| 38 | if ( ! jet_form_builder()->addons_manager->is_active() ) { |
| 39 | $this->notices()->register_notice( new Pro_Notice() ); |
| 40 | $this->boxes()->register_box( new Useful_Banner_Box() ); |
| 41 | } |
| 42 | |
| 43 | return array( |
| 44 | 'is_active' => jet_form_builder()->addons_manager->is_active(), |
| 45 | 'notices' => Array_Tools::to_array( $this->notices()->get_notices() ), |
| 46 | 'boxes' => Array_Tools::to_array( $this->boxes()->get_boxes() ), |
| 47 | 'addons' => apply_filters( |
| 48 | 'jfb-addons-page/page-localize-data', |
| 49 | array( |
| 50 | 'licenseMode' => false, |
| 51 | 'licenseKey' => '', |
| 52 | 'licenseList' => array(), |
| 53 | 'themeInfo' => jet_form_builder()->addons_manager->get_theme_info(), |
| 54 | ) |
| 55 | ), |
| 56 | ); |
| 57 | } |
| 58 | |
| 59 | public function assets() { |
| 60 | wp_enqueue_style( Pages_Manager::STYLE_ADMIN ); |
| 61 | wp_enqueue_script( Pages_Manager::SCRIPT_VUEX_PACKAGE ); |
| 62 | |
| 63 | parent::assets(); |
| 64 | } |
| 65 | } |
| 66 |