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