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 / tabbed / tabbed.php

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

65 lines 1.9 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: 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 }
65