PluginProbe
Document Embedder – let visitors read files without downloading / 1.8.6
Document Embedder – let visitors read files without downloading v1.8.6
2.3.1 2.3.0 2.2.1 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.3 1.7.4 1.7.6 1.7.9 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 2.0.0 2.0.1 2.0.2 All 30 releases
document-emberdder / admin / framework / fields / icon / icon.php

icon.php in Document Embedder – let visitors read files without downloading 1.8.6, at admin/framework/fields/icon/icon.php

72 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 /**
3 *
4 * Field: icon
5 *
6 * @since 1.0.0
7 * @version 1.0.0
8 *
9 */
10 if ( ! class_exists( 'CSF_Field_icon' ) ) {
11 class CSF_Field_icon extends CSF_Fields {
12
13 public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
14 parent::__construct( $field, $value, $unique, $where, $parent );
15 }
16
17 public function render() {
18
19 $args = wp_parse_args( $this->field, array(
20 'button_title' => esc_html__( 'Add Icon', 'csf' ),
21 'remove_title' => esc_html__( 'Remove Icon', 'csf' ),
22 ) );
23
24 echo $this->field_before();
25
26 $nonce = wp_create_nonce( 'csf_icon_nonce' );
27 $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28
29 echo '<div class="csf-icon-select">';
30 echo '<span class="csf-icon-preview'. esc_attr( $hidden ) .'"><i class="'. esc_attr( $this->value ) .'"></i></span>';
31 echo '<a href="#" class="button button-primary csf-icon-add" data-nonce="'. esc_attr( $nonce ) .'">'. $args['button_title'] .'</a>';
32 echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. esc_attr( $hidden ) .'">'. $args['remove_title'] .'</a>';
33 echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-icon-value"'. $this->field_attributes() .' />';
34 echo '</div>';
35
36 echo $this->field_after();
37
38 }
39
40 public function enqueue() {
41 add_action( 'admin_footer', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
42 add_action( 'customize_controls_print_footer_scripts', array( 'CSF_Field_icon', 'add_footer_modal_icon' ) );
43 }
44
45 public static function add_footer_modal_icon() {
46 ?>
47 <div id="csf-modal-icon" class="csf-modal csf-modal-icon hidden">
48 <div class="csf-modal-table">
49 <div class="csf-modal-table-cell">
50 <div class="csf-modal-overlay"></div>
51 <div class="csf-modal-inner">
52 <div class="csf-modal-title">
53 <?php esc_html_e( 'Add Icon', 'csf' ); ?>
54 <div class="csf-modal-close csf-icon-close"></div>
55 </div>
56 <div class="csf-modal-header">
57 <input type="text" placeholder="<?php esc_html_e( 'Search...', 'csf' ); ?>" class="csf-icon-search" />
58 </div>
59 <div class="csf-modal-content">
60 <div class="csf-modal-loading"><div class="csf-loading"></div></div>
61 <div class="csf-modal-load"></div>
62 </div>
63 </div>
64 </div>
65 </div>
66 </div>
67 <?php
68 }
69
70 }
71 }
72