PluginProbe
StreamCast – bring live radio to your site with a sleek player / trunk
StreamCast – bring live radio to your site with a sleek player vtrunk
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
streamcast / vendor / codestar-framework / fields / icon / icon.php

icon.php in StreamCast – bring live radio to your site with a sleek player trunk, at vendor/codestar-framework/fields/icon/icon.php

72 lines 3.1 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( 'STREAMCAST_STREAMCAST_CSF_Field_icon' ) ) {
11 class STREAMCAST_STREAMCAST_CSF_Field_icon extends STREAMCAST_STREAMCAST_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', 'streamcast' ),
21 'remove_title' => esc_html__( 'Remove Icon', 'streamcast' ),
22 ) );
23
24 echo wp_kses_post( $this->field_before() );
25
26 $nonce = wp_create_nonce( 'streamcast_csf_icon_nonce' );
27 $hidden = ( empty( $this->value ) ) ? ' hidden' : '';
28
29 echo '<div class="streamcast-csf-icon-select">';
30 echo '<span class="streamcast-csf-icon-preview'. esc_attr( $hidden ) .'"><i class="'. esc_attr( $this->value ) .'"></i></span>';
31 echo '<a href="#" class="button button-primary streamcast-csf-icon-add" data-nonce="'. esc_attr( $nonce ) .'">'. wp_kses_post( $args['button_title'] ) .'</a>';
32 echo '<a href="#" class="button streamcast-csf-warning-primary streamcast-csf-icon-remove'. esc_attr( $hidden ) .'">'. wp_kses_post( $args['remove_title'] ) .'</a>';
33 echo '<input type="hidden" name="'. esc_attr( $this->field_name() ) .'" value="'. esc_attr( $this->value ) .'" class="streamcast-csf-icon-value"'. $this->field_attributes() .' />'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
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( 'STREAMCAST_STREAMCAST_CSF_Field_icon', 'add_footer_modal_icon' ) );
42 add_action( 'customize_controls_print_footer_scripts', array( 'STREAMCAST_STREAMCAST_CSF_Field_icon', 'add_footer_modal_icon' ) );
43 }
44
45 public static function add_footer_modal_icon() {
46 ?>
47 <div id="streamcast-csf-modal-icon" class="streamcast-csf-modal streamcast-csf-modal-icon hidden">
48 <div class="streamcast-csf-modal-table">
49 <div class="streamcast-csf-modal-table-cell">
50 <div class="streamcast-csf-modal-overlay"></div>
51 <div class="streamcast-csf-modal-inner">
52 <div class="streamcast-csf-modal-title">
53 <?php esc_html_e( 'Add Icon', 'streamcast' ); ?>
54 <div class="streamcast-csf-modal-close streamcast-csf-icon-close"></div>
55 </div>
56 <div class="streamcast-csf-modal-header">
57 <input type="text" placeholder="<?php esc_html_e( 'Search...', 'streamcast' ); ?>" class="streamcast-csf-icon-search" />
58 </div>
59 <div class="streamcast-csf-modal-content">
60 <div class="streamcast-csf-modal-loading"><div class="streamcast-csf-loading"></div></div>
61 <div class="streamcast-csf-modal-load"></div>
62 </div>
63 </div>
64 </div>
65 </div>
66 </div>
67 <?php
68 }
69
70 }
71 }
72