PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.4
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.4
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 / abstracts / legacy / class-evf-admin-form-panel.php
everest-forms / includes / abstracts / legacy Last commit date
class-evf-admin-form-panel.php 6 years ago
class-evf-admin-form-panel.php
191 lines
1 <?php
2 /**
3 * Abstract form panel
4 *
5 * @package EverestForms\Abstracts
6 * @deprecated 1.2.0
7 * @since 1.0.0
8 */
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * Abstract EVF_Admin_Form_Panel Class
14 *
15 * @deprecated 1.2.0
16 */
17 abstract class EVF_Admin_Form_Panel {
18
19 /**
20 * Full name of the panel.
21 *
22 * @var string
23 */
24 public $name;
25
26 /**
27 * Slug.
28 *
29 * @var string
30 */
31 public $slug;
32
33 /**
34 * Font Awesome Icon used for the editor button.
35 *
36 * @var mixed
37 */
38 protected $icon = false;
39
40 /**
41 * Priority order the field button should show inside the "Add Fields" tab.
42 *
43 * @var integer
44 */
45 public $order = 50;
46
47 /**
48 * If panel contains a sidebar element or is full width.
49 *
50 * @var boolean
51 */
52 protected $sidebar = false;
53
54 /**
55 * Contains form object if we have one.
56 *
57 * @var object
58 */
59 protected $form;
60
61 /**
62 * Contains array of the form data (post_content).
63 *
64 * @var array
65 */
66 protected $form_data;
67
68 /**
69 * Form Settings.
70 *
71 * @var array
72 */
73 public $form_setting;
74
75 /**
76 * Class constructor.
77 */
78 public function __construct() {
79 // Load form if found.
80 $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0;
81 $this->form = evf()->form->get( $form_id );
82 $this->form_data = is_object( $this->form ) ? evf_decode( $this->form->post_content ) : array();
83 $this->form_setting = isset( $this->form_data['settings'] ) ? $this->form_data['settings'] : array();
84 $this->init();
85
86 // Hooks.
87 add_action( 'admin_enqueue_scripts', array( $this, 'enqueues' ), 15 );
88 add_action( 'everest_forms_builder_tabs', array( $this, 'button' ), $this->order );
89 add_action( 'everest_forms_builder_output', array( $this, 'panel_output' ), $this->order );
90 }
91
92 /**
93 * Hook in tabs.
94 */
95 public function init() {}
96
97 /**
98 * Enqueue assets
99 */
100 public function enqueues() {}
101
102 /**
103 * Primary panel button in the left panel navigation.
104 */
105 public function button() {
106 global $current_tab;
107
108 $active = $current_tab === $this->slug ? 'nav-tab-active' : '';
109
110 printf( '<a href="#" class="evf-panel-%1$s-button nav-tab %2$s" data-panel="%1$s">', $this->slug, $active );
111 printf( '<span class="%s"></span>', $this->icon );
112 printf( '%s</a>', $this->name );
113 }
114
115 /**
116 * Outputs the contents of the panel.
117 *
118 * @param object $form
119 * @param string $view
120 */
121 public function panel_output() {
122 global $current_tab;
123
124 $active = $current_tab == $this->slug ? 'active' : '';
125
126 $wrap = $this->sidebar ? 'everest-forms-panel-sidebar-content' : 'everest-forms-panel-full-content';
127
128 printf( '<div id="everest-forms-panel-%s" class="everest-forms-panel %s">', $this->slug, $active );
129
130 printf( '<div class="%s">', $wrap );
131
132 if ( true == $this->sidebar ) {
133
134 echo '<div class="everest-forms-panel-sidebar">';
135
136 do_action( 'everest_forms_builder_before_panel_sidebar', $this->form, $this->slug );
137
138 $this->panel_sidebar();
139
140 do_action( 'everest_forms_builder_after_panel_sidebar', $this->form, $this->slug );
141
142 echo '</div>';
143 }
144
145 echo '<div class="everest-forms-panel-content-wrap">';
146 echo '<div class="everest-forms-panel-content">';
147
148 do_action( 'everest_forms_builder_before_panel_content', $this->form, $this->slug );
149
150 $this->panel_content();
151
152 do_action( 'everest_forms_builder_after_panel_content', $this->form, $this->slug );
153
154 echo '</div></div></div></div>';
155 }
156
157 /**
158 * Outputs the panel's sidebar if we have one.
159 */
160 public function panel_sidebar() {}
161
162 /**
163 * Outputs panel sidebar sections.
164 */
165 public function panel_sidebar_section( $name, $slug, $icon = '' ) {
166
167 $class = '';
168 $class .= $slug == 'default' ? ' default' : '';
169 $class .= ! empty( $icon ) ? ' icon' : '';
170
171 echo '<a href="#" class="evf-panel-tab evf-setting-panel everest-forms-panel-sidebar-section everest-forms-panel-sidebar-section-' . esc_attr( $slug ) . $class . '" data-section="' . esc_attr( $slug ) . '">';
172
173 if ( ! empty( $icon ) ) {
174 echo '<img src="' . esc_url( $icon ) . '">';
175 }
176
177 echo esc_html( $name );
178
179 echo '<i class="dashicons dashicons-arrow-right-alt2 everest-forms-toggle-arrow"></i>';
180
181 echo '</a>';
182 }
183
184 /**
185 * Outputs the panel's primary content.
186 *
187 * @since 1.0.0
188 */
189 public function panel_content() {}
190 }
191