PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.1.5
StreamCast – bring live radio to your site with a sleek player v2.1.5
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 / admin / codestar-framework / classes / abstract.class.php

abstract.class.php in StreamCast – bring live radio to your site with a sleek player 2.1.5, at admin/codestar-framework/classes/abstract.class.php

132 lines 4.0 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 * Abstract Class
5 *
6 * @since 1.0.0
7 * @version 1.0.0
8 *
9 */
10 if ( ! class_exists( 'CSF_Abstract' ) ) {
11 abstract class CSF_Abstract {
12
13 public $abstract = '';
14 public $output_css = '';
15
16 public function __construct() {
17
18 // Collect output css and typography
19 if ( ! empty( $this->args['output_css'] ) || ! empty( $this->args['enqueue_webfont'] ) ) {
20 add_action( 'wp_enqueue_scripts', array( &$this, 'collect_output_css_and_typography' ), 10 );
21 }
22
23 }
24
25 public function collect_output_css_and_typography() {
26 $this->recursive_output_css( $this->pre_fields );
27 }
28
29 public function recursive_output_css( $fields = array(), $combine_field = array() ) {
30
31 if ( ! empty( $fields ) ) {
32
33 foreach ( $fields as $field ) {
34
35 $field_id = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
36 $field_type = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
37 $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
38 $field_check = ( $field_type === 'typography' || $field_output ) ? true : false;
39 $field_class = 'CSF_Field_' . $field_type;
40
41 if ( $field_type && $field_id ) {
42
43
44 if( $field_type === 'fieldset' ) {
45 if ( ! empty( $field['fields'] ) ) {
46 $this->recursive_output_css( $field['fields'], $field );
47 }
48 }
49
50 if( $field_type === 'accordion' ) {
51 if ( ! empty( $field['accordions'] ) ) {
52 foreach ( $field['accordions'] as $accordion ) {
53 $this->recursive_output_css( $accordion['fields'], $field );
54 }
55 }
56 }
57
58 if( $field_type === 'tabbed' ) {
59 if ( ! empty( $field['tabs'] ) ) {
60 foreach ( $field['tabs'] as $accordion ) {
61 $this->recursive_output_css( $accordion['fields'], $field );
62 }
63 }
64 }
65
66 if ( class_exists( $field_class ) ) {
67
68 if ( method_exists( $field_class, 'output' ) || method_exists( $field_class, 'enqueue_google_fonts' ) ) {
69
70 $field_value = '';
71
72 if ( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
73
74 if( ! empty( $combine_field ) ) {
75
76 $field_value = ( isset( $this->options[$combine_field['id']][$field_id] ) ) ? $this->options[$combine_field['id']][$field_id] : '';
77
78 } else {
79
80 $field_value = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
81
82 }
83
84 } else if ( $field_check && ( $this->abstract === 'metabox' && is_singular() || $this->abstract === 'taxonomy' && is_archive() ) ) {
85
86 if( ! empty( $combine_field ) ) {
87
88 $meta_value = $this->get_meta_value( $combine_field );
89 $field_value = ( isset( $meta_value[$field_id] ) ) ? $meta_value[$field_id] : '';
90
91 } else {
92
93 $meta_value = $this->get_meta_value( $field );
94 $field_value = ( isset( $meta_value ) ) ? $meta_value : '';
95
96 }
97
98 }
99
100 $instance = new $field_class( $field, $field_value, $this->unique, 'wp/enqueue', $this );
101
102 // typography enqueue and embed google web fonts
103 if ( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
104
105 $method = ( ! empty( $this->args['async_webfont'] ) ) ? 'async' : 'enqueue';
106
107 $instance->enqueue_google_fonts( $method );
108
109 }
110
111 // output css
112 if ( $field_output && $this->args['output_css'] ) {
113 CSF::$css .= $instance->output();
114 }
115
116 unset( $instance );
117
118 }
119
120 }
121
122 }
123
124 }
125
126 }
127
128 }
129
130 }
131 }
132