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