PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.3
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / includes / admin / builder / class-evf-builder-page.php
everest-forms / includes / admin / builder Last commit date
class-evf-builder-fields.php 2 years ago class-evf-builder-page.php 3 years ago class-evf-builder-settings.php 2 years ago
class-evf-builder-page.php
164 lines
1 <?php
2 /**
3 * EverestForms Builder Page/Tab
4 *
5 * @package EverestForms\Admin
6 * @since 1.2.0
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 if ( ! class_exists( 'EVF_Admin_Form_Panel', false ) ) {
12 include_once dirname( EVF_PLUGIN_FILE ) . '/includes/abstracts/legacy/class-evf-admin-form-panel.php';
13 }
14
15 if ( ! class_exists( 'EVF_Builder_Page', false ) ) :
16
17 /**
18 * EVF_Builder_Page Class.
19 */
20 abstract class EVF_Builder_Page extends EVF_Admin_Form_Panel {
21
22 /**
23 * Form object.
24 *
25 * @var object
26 */
27 public $form;
28
29 /**
30 * Builder page id.
31 *
32 * @var string
33 */
34 protected $id = '';
35
36 /**
37 * Builder page label.
38 *
39 * @var string
40 */
41 protected $label = '';
42
43 /**
44 * Is sidebar available?
45 *
46 * @var boolean
47 */
48 protected $sidebar = false;
49
50 /**
51 * Array of form data.
52 *
53 * @var array
54 */
55 public $form_data = array();
56
57 /**
58 * Constructor.
59 */
60 public function __construct() {
61 $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification
62 $this->form = evf()->form->get( $form_id );
63 $this->form_data = is_object( $this->form ) ? evf_decode( $this->form->post_content ) : array();
64
65 // Init hooks.
66 $this->init_hooks();
67
68 // Hooks.
69 add_filter( 'everest_forms_builder_tabs_array', array( $this, 'add_builder_page' ), 20 );
70 add_action( 'everest_forms_builder_sidebar_' . $this->id, array( $this, 'output_sidebar' ) );
71 add_action( 'everest_forms_builder_content_' . $this->id, array( $this, 'output_content' ) );
72 }
73
74 /**
75 * Get builder page ID.
76 *
77 * @return string
78 */
79 public function get_id() {
80 return $this->id;
81 }
82
83 /**
84 * Get builder page label.
85 *
86 * @return string
87 */
88 public function get_label() {
89 return $this->label;
90 }
91
92 /**
93 * Get builder page sidebar.
94 *
95 * @return string
96 */
97 public function get_sidebar() {
98 return $this->sidebar;
99 }
100
101 /**
102 * Get builder page form data.
103 *
104 * @return string
105 */
106 public function get_form_data() {
107 return $this->form_data;
108 }
109
110 /**
111 * Add this page to builder.
112 *
113 * @param array $pages Builder pages.
114 * @return mixed
115 */
116 public function add_builder_page( $pages ) {
117 $pages[ $this->id ] = array(
118 'label' => $this->label,
119 'sidebar' => $this->sidebar,
120 );
121
122 return $pages;
123 }
124
125 /**
126 * Add sidebar tab sections.
127 *
128 * @param string $name Name of the section.
129 * @param string $slug Slug of the section.
130 * @param string $icon Icon of the section.
131 * @param string $container_name Name of that container.
132 */
133 public function add_sidebar_tab( $name, $slug, $icon = '', $container_name = 'setting' ) {
134 $class = '';
135 $class .= 'default' === $slug ? ' default' : '';
136 $class .= ! empty( $icon ) ? ' icon' : '';
137
138 echo '<a href="#" class="evf-panel-tab evf-' . esc_attr( $container_name ) . '-panel everest-forms-panel-sidebar-section everest-forms-panel-sidebar-section-' . esc_attr( $slug ) . esc_attr( $class ) . '" data-section="' . esc_attr( $slug ) . '">';
139 if ( ! empty( $icon ) ) {
140 echo '<figure class="logo"><img src="' . esc_url( $icon ) . '"></figure>';
141 }
142 echo esc_html( $name );
143 echo '<i class="dashicons dashicons-arrow-right-alt2 everest-forms-toggle-arrow"></i>';
144 echo '</a>';
145 }
146
147 /**
148 * Hook in tabs.
149 */
150 public function init_hooks() {}
151
152 /**
153 * Outputs the builder sidebar.
154 */
155 public function output_sidebar() {}
156
157 /**
158 * Outputs the builder content.
159 */
160 public function output_content() {}
161 }
162
163 endif;
164