PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.0
JetFormBuilder — Dynamic Blocks Form Builder v3.5.0
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 / components / admin / page / traits / admin-dashboard-page-trait.php
jetformbuilder / components / admin / page / traits Last commit date
action-page-trait.php 2 years ago admin-dashboard-page-trait.php 1 year ago table-advanced-record-prepare-trait.php 2 years ago table-record-prepare-trait.php 2 years ago
admin-dashboard-page-trait.php
84 lines
1 <?php
2
3
4 namespace JFB_Components\Admin\Page\Traits;
5
6 use Jet_Form_Builder\Admin\Pages\Actions\Base_Page_Action;
7 use Jet_Form_Builder\Plugin;
8
9 // If this file is called directly, abort.
10 if ( ! defined( 'WPINC' ) ) {
11 die;
12 }
13
14 trait Admin_Dashboard_Page_Trait {
15
16 protected $config = array();
17
18 /**
19 * Page specific assets
20 */
21 public function assets() {
22 wp_enqueue_script( $this->slug() );
23 }
24
25 /**
26 * Page render function
27 */
28 public function render_page() {
29 printf( '<div id="%s"></div>', esc_attr( 'jet-form-builder_page_' . $this->slug() ) );
30 }
31
32 /**
33 * @return Base_Page_Action[]
34 */
35 public function get_actions(): array {
36 return array();
37 }
38
39 public function query_config(): array {
40 if ( ! empty( $this->config ) ) {
41 return $this->config;
42 }
43 $this->config = apply_filters(
44 "jet-form-builder/page-config/{$this->slug()}",
45 $this->page_config(),
46 $this
47 );
48
49 return $this->config;
50 }
51
52 public function base_script_url(): string {
53 return Plugin::instance()->plugin_url( "assets/build/admin/pages/{$this->slug()}.js" );
54 }
55
56 public function render_config() {
57 $config = $this->query_config();
58
59 if ( ! empty( $config ) ) {
60 wp_localize_script( 'cx-vue', 'JetFBPageConfig', $config );
61 }
62 }
63
64 /**
65 * Returns current page url
66 *
67 * @param array $query_args
68 *
69 * @return string
70 */
71 public function admin_url( $query_args = array() ): string {
72 return add_query_arg(
73 array_merge(
74 array(
75 'post_type' => jet_form_builder()->post_type->slug(),
76 ),
77 $query_args
78 ),
79 esc_url_raw( admin_url( 'edit.php' ) )
80 );
81 }
82
83 }
84