PluginProbe
Easy Hotel – Powerful Hotel Booking / trunk
Easy Hotel – Powerful Hotel Booking vtrunk
2.0.8 2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.9.9 1.9.8 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 All 110 releases
easy-hotel / admin / includes / framework / fields / icon / icon.php

icon.php in Easy Hotel – Powerful Hotel Booking trunk, at admin/includes/framework/fields/icon/icon.php

72 lines 2.8 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( 'ESHB_Field_icon' ) ) {
11 class ESHB_Field_icon extends ESHB_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', 'easy-hotel' ),
21 'remove_title' => esc_html__( 'Remove Icon', 'easy-hotel' ),
22 ) );
23
24 echo wp_kses_post($this->field_before());
25
26 $nonce = wp_create_nonce( 'eshb_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 ) .'">'. esc_html($args['button_title']) .'</a>';
32 echo '<a href="#" class="button csf-warning-primary csf-icon-remove'. esc_attr( $hidden ) .'">'. esc_html($args['remove_title']) .'</a>';
33 echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="csf-icon-value"'. esc_attr($this->field_attributes()) .' />';
34 echo '</div>';
35
36 echo wp_kses_post($this->field_after());
37
38 }
39
40 public function enqueue() {
41 add_action( 'admin_footer', array( 'ESHB_Field_icon', 'add_footer_modal_icon' ) );
42 add_action( 'customize_controls_print_footer_scripts', array( 'ESHB_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', 'easy-hotel' ); ?>
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...', 'easy-hotel' ); ?>" 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