PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 1.3.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v1.3.3
3.6.0 3.5.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 7 years ago plugin-updates 8 years ago settings 7 years ago views 7 years ago class-evf-admin-addons.php 8 years ago class-evf-admin-assets.php 7 years ago class-evf-admin-builder.php 8 years ago class-evf-admin-editor.php 8 years ago class-evf-admin-entries-table-list.php 7 years ago class-evf-admin-entries.php 7 years ago class-evf-admin-forms-table-list.php 7 years ago class-evf-admin-forms.php 8 years ago class-evf-admin-menus.php 7 years ago class-evf-admin-notices.php 7 years ago class-evf-admin-settings.php 7 years ago class-evf-admin-status.php 8 years ago class-evf-admin.php 8 years ago evf-admin-functions.php 8 years ago
class-evf-admin-editor.php
113 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 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 $svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g><path fill="#82878c" d="M4.5 0v3H0v17h20V0H4.5zM9 19H1V4h8v15zm10 0h-9V3H5.5V1H19v18zM6.5 6h-4V5h4v1zm1 2v1h-5V8h5zm-5 3h3v1h-3v-1z"/></g></svg>';
39 printf(
40 '<a href="#" class="button evf-insert-form-button" data-editor="%s" title="%s"><span class="wp-media-buttons-icon">%s</span> %s</a>',
41 esc_attr( $editor_id ),
42 esc_attr__( 'Add Everest Form', 'everest-forms' ),
43 $svg_icon,
44 __( 'Add Form', 'everest-forms' )
45 );
46
47 // If we have made it, then load the JS.
48 wp_enqueue_script( 'everest-forms-editor' );
49
50 add_action( 'admin_footer', array( $this, 'shortcode_modal' ) );
51 }
52
53 /**
54 * Modal window for inserting the form shortcode into TinyMCE.
55 */
56 function shortcode_modal() {
57 ?>
58 <div id="evf-modal-backdrop" style="display: none"></div>
59 <div id="evf-modal-wrap" style="display: none">
60 <form id="evf-modal" tabindex="-1">
61 <div id="evf-modal-title">
62 <?php _e( 'Insert Form', 'everest-forms' ); ?>
63 <button type="button" id="evf-modal-close"><span class="screen-reader-text"><?php _e( 'Close', 'everest-forms' ); ?></span></button>
64 </div>
65 <div id="evf-modal-inner">
66 <div id="evf-modal-options">
67 <?php
68 $forms = evf_get_all_forms();
69
70 if ( ! empty( $forms ) ) {
71 printf( '<p><label for="evf-modal-select-form">%s</label></p>', __( 'Select a form below to insert', 'everest-forms' ) );
72 echo '<select id="evf-modal-select-form">';
73 foreach ( $forms as $form_id => $form_value ) {
74 printf( '<option value="%d">%s</option>', $form_id, esc_html( $form_value ) );
75 }
76 echo '</select>';
77 } else {
78 echo '<p>';
79 printf(
80 wp_kses(
81 /* translators: %s - Everest Builder page. */
82 __( 'Whoops, you haven\'t created a form yet. Want to <a href="%s">give it a go</a>?', 'everest-forms' ),
83 array(
84 'a' => array(
85 'href' => array(),
86 ),
87 )
88 ),
89 admin_url( 'admin.php?page=evf-builder' )
90 );
91 echo '</p>';
92 }
93 ?>
94 </div>
95 </div>
96 <div class="submitbox">
97 <div id="evf-modal-cancel">
98 <a class="submitdelete deletion" href="#"><?php _e( 'Cancel', 'everest-forms' ); ?></a>
99 </div>
100 <?php if ( ! empty( $forms ) ) : ?>
101 <div id="evf-modal-update">
102 <button class="button button-primary" id="evf-modal-submit"><?php _e( 'Add Form', 'everest-forms' ); ?></button>
103 </div>
104 <?php endif; ?>
105 </div>
106 </form>
107 </div>
108 <?php
109 }
110 }
111
112 return new EVF_Admin_Editor();
113