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 / class-evf-admin-editor.php
everest-forms / includes / admin Last commit date
builder 2 years ago plugin-updates 8 years ago settings 2 years ago views 2 years ago class-evf-admin-addons.php 4 years ago class-evf-admin-assets.php 2 years ago class-evf-admin-builder.php 7 years ago class-evf-admin-deactivation-feedback.php 3 years ago class-evf-admin-editor.php 4 years ago class-evf-admin-entries-table-list.php 3 years ago class-evf-admin-entries.php 4 years ago class-evf-admin-form-templates.php 3 years ago class-evf-admin-forms-table-list.php 3 years ago class-evf-admin-forms.php 3 years ago class-evf-admin-import-export.php 4 years ago class-evf-admin-menus.php 2 years ago class-evf-admin-notices.php 3 years ago class-evf-admin-settings.php 2 years ago class-evf-admin-tools.php 4 years ago class-evf-admin-welcome.php 2 years ago class-evf-admin.php 2 years ago evf-admin-functions.php 3 years ago
class-evf-admin-editor.php
112 lines
1 <?php
2 /**
3 * Functionality related to the admin TinyMCE editor.
4 *
5 * @package EverestForms/Admin
6 * @version 1.2.0
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 if ( ! class_exists( 'EVF_Admin_Editor', false ) ) {
12 return new EVF_Admin_Editor();
13 }
14
15 /**
16 * EVF_Admin_Editor Class.
17 */
18 class EVF_Admin_Editor {
19
20 /**
21 * Constructor.
22 */
23 public function __construct() {
24 add_action( 'media_buttons', array( $this, 'media_button' ), 15 );
25 }
26
27 /**
28 * Allow easy shortcode insertion via a custom media button.
29 *
30 * @param string $editor_id Unique editor identifier, e.g. 'content'.
31 */
32 public function media_button( $editor_id ) {
33 if ( ! apply_filters( 'everest_forms_show_media_button', is_admin(), $editor_id ) ) {
34 return;
35 }
36
37 // Setup the svg icon.
38 printf(
39 '<a href="#" class="button evf-insert-form-button" data-editor="%s" title="%s"><span class="wp-media-buttons-icon">%s</span> %s</a>',
40 esc_attr( $editor_id ),
41 esc_attr__( 'Add Everest Form', 'everest-forms' ),
42 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g><path fill="#82878c" d="M18.1 4h-3.8l1.2 2h3.9zM20.6 8h-3.9l1.2 2h3.9zM20.6 18H5.8L12 7.9l2.5 4.1H12l-1.2 2h7.3L12 4.1 2.2 20h19.6z"/></g></svg>',
43 esc_html__( 'Add Form', 'everest-forms' )
44 );
45
46 // If we have made it, then load the JS.
47 wp_enqueue_script( 'everest-forms-editor' );
48
49 add_action( 'admin_footer', array( $this, 'shortcode_modal' ) );
50 }
51
52 /**
53 * Modal window for inserting the form shortcode into TinyMCE.
54 */
55 public function shortcode_modal() {
56 ?>
57 <div id="evf-modal-backdrop" style="display: none"></div>
58 <div id="evf-modal-wrap" style="display: none">
59 <form id="evf-modal" tabindex="-1">
60 <div id="evf-modal-title">
61 <?php esc_html_e( 'Insert Form', 'everest-forms' ); ?>
62 <button type="button" id="evf-modal-close"><span class="screen-reader-text"><?php esc_html_e( 'Close', 'everest-forms' ); ?></span></button>
63 </div>
64 <div id="evf-modal-inner">
65 <div id="evf-modal-options">
66 <?php
67 $forms = evf_get_all_forms();
68
69 if ( ! empty( $forms ) ) {
70 printf( '<p><label for="evf-modal-select-form">%s</label></p>', esc_html__( 'Select a form below to insert', 'everest-forms' ) );
71 echo '<select id="evf-modal-select-form">';
72 foreach ( $forms as $form_id => $form_value ) {
73 printf( '<option value="%d">%s</option>', esc_attr( $form_id ), esc_html( $form_value ) );
74 }
75 echo '</select>';
76 } else {
77 echo '<p>';
78 printf(
79 wp_kses(
80 /* translators: %s - Everest Builder page. */
81 __( 'Whoops, you haven\'t created a form yet. Want to <a href="%s">give it a go</a>?', 'everest-forms' ),
82 array(
83 'a' => array(
84 'href' => array(),
85 ),
86 )
87 ),
88 esc_url( admin_url( 'admin.php?page=evf-builder' ) )
89 );
90 echo '</p>';
91 }
92 ?>
93 </div>
94 </div>
95 <div class="submitbox">
96 <div id="evf-modal-cancel">
97 <a class="submitdelete deletion" href="#"><?php esc_html_e( 'Cancel', 'everest-forms' ); ?></a>
98 </div>
99 <?php if ( ! empty( $forms ) ) : ?>
100 <div id="evf-modal-update">
101 <button class="button button-primary" id="evf-modal-submit"><?php esc_html_e( 'Add Form', 'everest-forms' ); ?></button>
102 </div>
103 <?php endif; ?>
104 </div>
105 </form>
106 </div>
107 <?php
108 }
109 }
110
111 return new EVF_Admin_Editor();
112