PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.4.0
StreamCast – bring live radio to your site with a sleek player v2.4.0
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
← All changes | frameworks/codestar-framework/fields/tabbed/tabbed.php +64 -64 2.3.42.4.0 View file →
@@ -1,64 +1,64 @@
1 -<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 -/**
3 - *
4 - * Field: tabbed
5 - *
6 - * @since 1.0.0
7 - * @version 1.0.0
8 - *
9 - */
10 -if ( ! class_exists( 'CSF_Field_tabbed' ) ) {
11 - class CSF_Field_tabbed 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 - $unallows = array( 'tabbed' );
20 -
21 - echo $this->field_before();
22 -
23 - echo '<div class="csf-tabbed-nav" data-depend-id="'. esc_attr( $this->field['id'] ) .'">';
24 - foreach ( $this->field['tabs'] as $key => $tab ) {
25 -
26 - $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf--icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
27 - $tabbed_active = ( empty( $key ) ) ? 'csf-tabbed-active' : '';
28 -
29 - echo '<a href="#" class="'. esc_attr( $tabbed_active ) .'"">'. $tabbed_icon . esc_attr( $tab['title'] ) .'</a>';
30 -
31 - }
32 - echo '</div>';
33 -
34 - echo '<div class="csf-tabbed-contents">';
35 - foreach ( $this->field['tabs'] as $key => $tab ) {
36 -
37 - $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
38 -
39 - echo '<div class="csf-tabbed-content'. esc_attr( $tabbed_hidden ) .'">';
40 -
41 - foreach ( $tab['fields'] as $field ) {
42 -
43 - if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
44 -
45 - $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46 - $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
47 - $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
48 - $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
49 -
50 - CSF::field( $field, $field_value, $unique_id, 'field/tabbed' );
51 -
52 - }
53 -
54 - echo '</div>';
55 -
56 - }
57 - echo '</div>';
58 -
59 - echo $this->field_after();
60 -
61 - }
62 -
63 - }
64 -}
1 +<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 +/**
3 + *
4 + * Field: tabbed
5 + *
6 + * @since 1.0.0
7 + * @version 1.0.0
8 + *
9 + */
10 +if ( ! class_exists( 'CSF_Field_tabbed' ) ) {
11 + class CSF_Field_tabbed 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 + $unallows = array( 'tabbed' );
20 +
21 + echo $this->field_before(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
22 +
23 + echo '<div class="csf-tabbed-nav" data-depend-id="'. esc_attr( $this->field['id'] ) .'">';
24 + foreach ( $this->field['tabs'] as $key => $tab ) {
25 +
26 + $tabbed_icon = ( ! empty( $tab['icon'] ) ) ? '<i class="csf--icon '. esc_attr( $tab['icon'] ) .'"></i>' : '';
27 + $tabbed_active = ( empty( $key ) ) ? 'csf-tabbed-active' : '';
28 +
29 + echo '<a href="#" class="'. esc_attr( $tabbed_active ) .'"">'. wp_kses_post( $tabbed_icon ) . esc_attr( $tab['title'] ) .'</a>';
30 +
31 + }
32 + echo '</div>';
33 +
34 + echo '<div class="csf-tabbed-contents">';
35 + foreach ( $this->field['tabs'] as $key => $tab ) {
36 +
37 + $tabbed_hidden = ( ! empty( $key ) ) ? ' hidden' : '';
38 +
39 + echo '<div class="csf-tabbed-content'. esc_attr( $tabbed_hidden ) .'">';
40 +
41 + foreach ( $tab['fields'] as $field ) {
42 +
43 + if ( in_array( $field['type'], $unallows ) ) { $field['_notice'] = true; }
44 +
45 + $field_id = ( isset( $field['id'] ) ) ? $field['id'] : '';
46 + $field_default = ( isset( $field['default'] ) ) ? $field['default'] : '';
47 + $field_value = ( isset( $this->value[$field_id] ) ) ? $this->value[$field_id] : $field_default;
48 + $unique_id = ( ! empty( $this->unique ) ) ? $this->unique .'['. $this->field['id'] .']' : $this->field['id'];
49 +
50 + CSF::field( $field, $field_value, $unique_id, 'field/tabbed' );
51 +
52 + }
53 +
54 + echo '</div>';
55 +
56 + }
57 + echo '</div>';
58 +
59 + echo $this->field_after(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
60 +
61 + }
62 +
63 + }
64 +}