PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.4.2
Forumax – AI Powered Advanced Community Forum Plugin v2.4.2
2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 2.0.0 2.1.0 All 29 releases
bbp-core / lib / csf / fields / tabbed / tabbed.php

tabbed.php in Forumax – AI Powered Advanced Community Forum Plugin 2.4.2, at lib/csf/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