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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / views / metabox / settings-tabs.php
tutor / views / metabox Last commit date
course 3 years ago course-add-edd-product-metabox.php 3 years ago course-add-product-metabox.php 3 years ago course-additional-data.php 3 years ago course-contents.php 3 years ago course-level-metabox.php 3 years ago course-topics.php 3 years ago instructors-metabox.php 3 years ago lesson-attachments-metabox.php 3 years ago lesson-metabox.php 3 years ago product-selection.php 3 years ago settings-tabs.php 3 years ago user-profile-fields.php 3 years ago video-metabox.php 3 years ago
settings-tabs.php
214 lines
1 <?php
2 /**
3 * Settings meta box template
4 *
5 * @package Tutor\Views
6 * @subpackage Tutor\MetaBox
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.0.0
10 */
11
12 $args = $this->args;
13
14 ?>
15
16 <div id="tutor-metabox-course-settings-tabs" class="tutor-course-settings-tabs">
17 <div class="course-settings-tabs-container">
18 <div class="settings-tabs-navs-wrap">
19 <ul class="settings-tabs-navs">
20 <?php
21 $i = 0;
22 foreach ( $args as $key => $arg ) {
23 $i++;
24
25 $active = 1 === $i ? 'active' : '';
26
27 $label = tutor_utils()->array_get( 'label', $arg );
28 $icon_class = tutor_utils()->array_get( 'icon_class', $arg );
29 $url = add_query_arg( array( 'settings_tab' => $key ) );
30
31 $icon = '';
32 if ( $icon_class ) {
33 $icon = $icon_class;
34 }
35 ?>
36 <li class="<?php echo esc_attr( $active ); ?>">
37 <a href="<?php echo esc_url( $url ); ?>" data-target="#settings-tab-<?php echo esc_attr( $key ); ?>">
38 <i class="<?php echo esc_attr( $icon ); ?>"></i> <?php echo esc_html( $label ); ?>
39 </a>
40 </li>
41 <?php
42 }
43 ?>
44 </ul>
45 </div>
46
47 <div class="settings-tabs-container">
48 <?php
49
50 $i = 0;
51
52 foreach ( $args as $key => $tab ) {
53 $i++;
54
55 $label = tutor_utils()->array_get( 'label', $tab );
56 $callback = tutor_utils()->array_get( 'callback', $tab );
57 $fields = tutor_utils()->array_get( 'fields', $tab );
58
59 // Set first tab as active.
60 $active = 1 === $i ? 'active' : '';
61 $display = 1 === $i ? 'block' : 'none';
62 ?>
63
64 <div id="settings-tab-<?php echo esc_attr( $key ); ?>" class="settings-tab-wrap <?php echo esc_attr( $active ); ?>" style="display: <?php echo esc_attr( $display ); ?>;">
65 <?php
66 do_action( 'tutor_course/settings_tab_content/before', $key, $tab );
67 do_action( "tutor_course/settings_tab_content/before/{$key}", $tab );
68
69
70 if ( tutor_utils()->count( $fields ) ) {
71 foreach ( $fields as $field_key => $field ) {
72 $type = tutor_utils()->array_get( 'type', $field );
73 $value = tutor_utils()->array_get( 'value', $field );
74
75 if ( 'line_break' == $type ) {
76 echo '<hr class="tutor-mb-32"/>';
77 continue;
78 }
79 ?>
80 <div class="tutor-row tutor-mb-32 <?php if( 'Content Drip Type' === $field['label'] ): echo esc_attr( 'content-drip-options-wrapper' ); endif; ?>">
81 <?php
82 $second_class = 'tutor-col-12';
83 $_vertical = isset( $field['is_vertical'] ) ? $field['is_vertical'] : false;
84
85 if ( ! empty( $field['label'] ) ) {
86 $second_class = 'tutor-col-12 ' . ( $_vertical ? '' : 'tutor-col-md-7' );
87 ?>
88 <div class="tutor-col-12 <?php echo esc_attr( $_vertical ? '' : 'tutor-col-md-5' ); ?>">
89 <label class="tutor-course-setting-label">
90 <?php echo esc_html( $field['label'] ); ?>
91 </label>
92 <?php if ( isset( $field['desc'] ) && 'Content Drip Type' === $field['label'] ) { ?>
93 <p class="tutor-form-feedback">
94 <?php echo esc_html( $field['desc'] ); ?>
95 </p>
96 <?php } ?>
97 </div>
98 <?php
99 }
100 ?>
101 <div class="<?php echo esc_attr( $second_class ); ?>">
102 <?php
103 switch ( $field['type'] ) {
104 case 'number':
105 echo '<input class="tutor-form-control" type="number" name="' . esc_attr( $field_key ) . '" value="' . esc_attr( $value ) . '" min="0">';
106 break;
107
108 case 'radio':
109 foreach ( $field['options'] as $value => $label ) {
110 $id_string = 'course_setting_radio_' . ( ! empty( $field['id'] ) ? $field['id'] : $value );
111 ?>
112 <div class="tutor-my-20 tutor-align-center">
113 <div class="tutor-form-check">
114 <input type="radio" id="<?php echo esc_attr( $id_string ); ?>" class="tutor-form-check-input tutor-flex-shrink-0" name="<?php echo esc_attr( $field_key ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php echo $value == $field['value'] ? 'checked="checked"' : ''; ?>/>
115 <label for="<?php echo esc_attr( $id_string ); ?>" class="tutor-fs-7 tutor-fw-medium tutor-fs-6">
116 <?php echo esc_attr( $label ); ?>
117 </label>
118 </div>
119 </div>
120 <?php
121 }
122 break;
123
124 case 'checkbox':
125 case 'toggle_switch':
126 foreach ( $field['options'] as $option ) {
127 $fragment = ( ! empty( $field['id'] ) ? $field['id'] : $field['type'] . '_' . $field_key );
128 $id_string = 'course_setting_' . $fragment;
129
130 if ( $field['type'] == 'checkbox' ) {
131 ?>
132 <div class="tutor-form-check tutor-mb-12">
133 <input id="<?php echo esc_attr( $id_string ); ?>" type="checkbox" class="tutor-form-check-input" value="<?php echo isset( $option['value'] ) ? esc_attr( $option['value'] ) : ''; ?>" name="<?php echo esc_attr( $field_key ); ?>" <?php echo $option['checked'] ? 'checked="checked"' : ''; ?>/>
134 <label for="<?php echo esc_attr( $id_string ); ?>" class="tutor-fs-7 tutor-fw-medium">
135 <?php echo esc_html( $option['label_title'] ); ?>
136 <?php
137 if ( ! empty( $option['hint'] ) ) {
138 echo '<span class="tutor-d-block tutor-fs-7">' . esc_html( $option['hint'] ) . '</span>';
139 }
140 ?>
141 </label>
142 </div>
143 <?php
144 } elseif ( 'toggle_switch' == $field['type'] ) {
145 ?>
146 <label class="tutor-form-toggle">
147 <input id="<?php echo esc_attr( $id_string ); ?>" type="checkbox" class="tutor-form-toggle-input" name="<?php echo esc_attr( $field_key ); ?>" <?php echo $option['checked'] ? 'checked="checked"' : ''; ?>/>
148 <span class="tutor-form-toggle-control"></span> <?php echo isset( $option['label_title'] ) ? esc_attr( $option['label_title'] ) : ''; ?>
149 </label>
150 <?php
151
152 if ( ! empty( $option['hint'] ) ) {
153 ?>
154 <div class="tutor-fs-7 tutor-has-icon tutor-color-muted tutor-d-flex tutor-mt-12">
155 <i class="tutor-icon-circle-info-o tutor-mt-4 tutor-mr-8"></i>
156 <?php echo esc_html( $option['hint'] ); ?>
157 </div>
158 <?php
159 }
160 }
161 }
162 break;
163
164 case 'select':
165 ?>
166 <select class="tutor-form-select" name="<?php echo esc_attr( $field_key ); ?>" class="tutor_select2">
167 <?php
168 if ( ! empty( $field['options'] ) ) {
169 foreach ( $field['options'] as $option_key => $option ) {
170 ?>
171 <option value="<?php echo esc_attr( $option_key ); ?>" <?php selected( $field['value'], $option_key ); ?> >
172 <?php echo esc_html( $option ); ?>
173 </option>
174 <?php
175 }
176 }
177 ?>
178 </select>
179 <?php
180 break;
181 }
182
183 if ( isset( $field['desc'] ) && 'Content Drip Type' !== $field['label'] ) {
184 ?>
185 <div class="tutor-fs-7 tutor-has-icon tutor-color-muted tutor-d-flex tutor-mt-12">
186 <i class="tutor-icon-circle-info-o tutor-mt-4 tutor-mr-8"></i>
187 <?php echo esc_html( $field['desc'] ); ?>
188 </div>
189 <?php
190 }
191 ?>
192 </div>
193 </div>
194 <?php
195 }
196 }
197
198 /**
199 * Handling Callback
200 */
201 if ( $callback && is_callable( $callback ) ) {
202 call_user_func( $callback, $key, $tab );
203 }
204
205 do_action( 'tutor_course/settings_tab_content/after', $key, $tab );
206 do_action( "tutor_course/settings_tab_content/after/{$key}", $tab );
207
208 echo '</div>';
209 }
210 ?>
211 </div>
212 </div>
213 </div>
214