PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.5.2
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.5.2
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 4 weeks ago class-evf-builder-integrations.php 4 weeks ago class-evf-builder-page.php 2 months ago class-evf-builder-payments.php 4 weeks ago class-evf-builder-settings.php 3 months ago
class-evf-builder-page.php
229 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 if ( ! defined( 'EFP_PLUGIN_FILE' ) ) {
138 $pro_addons = array(
139 'webhook' => array(
140 'id' => '0DQPfQgrWM8',
141 'name' => esc_html__( 'WebHook', 'everest-forms' ),
142 ),
143 'form_restriction' => array(
144 'id' => 'Q1-dja7m3Sc',
145 'name' => esc_html__( 'Form Restriction', 'everest-forms' ),
146 ),
147 'multi_part' => array(
148 'id' => 'qVpDzAx-_4A',
149 'name' => esc_html__( 'Multi Part', 'everest-forms' ),
150 ),
151 'pdf_submission' => array(
152 'id' => '37CtaxJzYis',
153 'name' => esc_html__( 'PDF Submission', 'everest-forms' ),
154 ),
155 'post_submission' => array(
156 'id' => 'gTtewu4DpCo',
157 'name' => esc_html__( 'Post Submission', 'everest-forms' ),
158 ),
159 'save_and_continue' => array(
160 'id' => '4xxEi0rSB20',
161 'name' => esc_html__( 'Save and Continue', 'everest-forms' ),
162 ),
163 'survey_polls_quiz' => array(
164 'id' => 'i1vR-YmaBOg',
165 'name' => esc_html__( 'Survey,Polls,Quiz', 'everest-forms' ),
166 ),
167 'user_registration' => array(
168 'id' => 'MEyuznG2Tok',
169 'name' => esc_html__( 'User Registration', 'everest-forms' ),
170 ),
171 'conversation_forms' => array(
172 'id' => 'XO38b8Lp19s',
173 'name' => esc_html__( 'Conversation Forms', 'everest-forms' ),
174 ),
175 'sms_notifications' => array(
176 'id' => 'tz4UKBX9WxM',
177 'name' => esc_html__( 'SMS Notifications', 'everest-forms' ),
178 ),
179 'telegram' => array(
180 'id' => '',
181 'name' => esc_html__( 'Telegram', 'everest-forms' ),
182 ),
183 'qr_generator' => array(
184 'id' => '',
185 'name' => esc_html__( 'QR Generator', 'everest-forms' ),
186 ),
187 );
188
189 } else {
190 $pro_addons = array();
191 }
192
193 $is_pro_addon = array_key_exists( $slug, $pro_addons );
194 $upgrade_class = $is_pro_addon ? 'upgrade-addons-settings' : '';
195 $pro_icon = plugins_url( 'assets/images/icons/evf-pro-icon.png', EVF_PLUGIN_FILE );
196 $icon_url = $is_pro_addon ? $pro_icon : '';
197 $evf_video = $is_pro_addon ? isset( $pro_addons[ $slug ]['id'] ) ? $pro_addons[ $slug ]['id'] : '' : '';
198
199 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 ) . ' ' . esc_attr( $upgrade_class ) . '" data-section="' . esc_attr( $slug ) . '" " data-links="' . esc_attr( $evf_video ) . '" >';
200 if ( ! empty( $icon ) ) {
201 echo '<figure class="logo"><img src="' . esc_url( $icon ) . '"></figure>';
202 }
203 echo esc_html( $name );
204 if ( ! empty( $icon_url ) ) {
205 echo '<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18"><rect width="16.889" height="16.889" x=".444" y=".444" fill="#ff8c39" stroke="#ff8c39" stroke-width=".889" rx="2.222"/><path fill="#efefef" d="m8.89 4.444 2.666 7.111H6.223z"/><path fill="#fff" fill-rule="evenodd" d="m4.445 6.222.635 5.333h7.619l.635-5.333-4.445 3.666zm8.254 5.841h-7.62v1.27h7.62z" clip-rule="evenodd"/></svg>';
206 } else {
207 echo '<i class="dashicons dashicons-arrow-right-alt2 everest-forms-toggle-arrow"></i>';
208 }
209 echo '</a>';
210 }
211
212 /**
213 * Hook in tabs.
214 */
215 public function init_hooks() {}
216
217 /**
218 * Outputs the builder sidebar.
219 */
220 public function output_sidebar() {}
221
222 /**
223 * Outputs the builder content.
224 */
225 public function output_content() {}
226 }
227
228 endif;
229