PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.4.0
JetFormBuilder — Dynamic Blocks Form Builder v1.4.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 / includes / admin / pages / base-page.php
jetformbuilder / includes / admin / pages Last commit date
addons-page.php 4 years ago base-page.php 4 years ago page-config.php 4 years ago pages-manager.php 4 years ago settings-page.php 4 years ago
base-page.php
96 lines
1 <?php
2
3 namespace Jet_Form_Builder\Admin\Pages;
4
5 use Jet_Form_Builder\Plugin;
6
7 /**
8 * Base dashboard page
9 */
10 abstract class Base_Page {
11
12 /**
13 * Page slug
14 */
15 abstract public function slug(): string;
16
17 /**
18 * Page title
19 */
20 abstract public function title(): string;
21
22 /**
23 * Page render function
24 */
25 public function render() {
26 printf( '<div id="%s"></div>', esc_attr( 'jet-form-builder_page_' . $this->slug() ) );
27 }
28
29 /**
30 * Return page config array
31 */
32 abstract public function page_config(): array;
33
34 /**
35 * Page specific assets
36 */
37 public function assets() {
38 wp_enqueue_script(
39 $this->slug(),
40 Plugin::instance()->plugin_url( 'assets/js/admin.js' ),
41 array(),
42 Plugin::instance()->get_version(),
43 true
44 );
45
46 wp_set_script_translations(
47 $this->slug(),
48 'jet-form-builder',
49 Plugin::instance()->plugin_dir( 'languages' )
50 );
51 }
52
53
54 /**
55 * Enqueue script
56 *
57 * @param $handle string
58 * @param $file_path string
59 */
60 public function enqueue_script( string $handle, string $file_path ) {
61 wp_enqueue_script(
62 $handle,
63 Plugin::instance()->plugin_url( "assets/js/$file_path" ),
64 array( 'wp-api-fetch' ),
65 Plugin::instance()->get_version(),
66 true
67 );
68 }
69
70 /**
71 * Enqueue style
72 *
73 * @param string $handle
74 * @param string $file_path
75 */
76 public function enqueue_style( string $handle, string $file_path ) {
77 wp_enqueue_style(
78 $handle,
79 Plugin::instance()->plugin_url( "assets/css/$file_path" ),
80 array(),
81 Plugin::instance()->get_version()
82 );
83 }
84
85
86 /**
87 * Returns current page url
88 */
89 public function get_url(): string {
90 return add_query_arg(
91 array( 'page' => $this->slug() ),
92 esc_url_raw( admin_url( 'admin.php' ) )
93 );
94 }
95
96 }