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