PluginProbe
Tutor LMS – eLearning and online course solution / 1.8.10
Tutor LMS – eLearning and online course solution v1.8.10
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
← All changes | classes/Options.php +511 -61 1.0.21.8.10 View file →
@@ -45,34 +45,51 @@
45 45 return $default;
46 46 }
47 47
48 48 public function tutor_option_save(){
49 - if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce( $_POST['_wpnonce'], 'tutor_option_save' ) ){
50 - exit();
51 - }
49 + tutils()->checking_nonce();
52 50
53 - $option = (array) isset($_POST['tutor_option']) ? $_POST['tutor_option'] : array();
51 + !current_user_can( 'manage_options' ) ? wp_send_json_error( ) : 0;
52 +
53 + do_action('tutor_option_save_before');
54 +
55 + $option = (array)tutils()->array_get('tutor_option', $_POST, array());
54 56 $option = apply_filters('tutor_option_input', $option);
55 57 update_option('tutor_option', $option);
56 58
59 + do_action('tutor_option_save_after');
57 60 //re-sync settings
58 - init::tutor_activate();
61 + //init::tutor_activate();
59 62
60 63 wp_send_json_success( array('msg' => __('Option Updated', 'tutor') ) );
61 64 }
62 -
65 +
63 66 public function options_attr(){
64 67 $pages = tutor_utils()->get_pages();
65 68
66 69 //$course_base = tutor_utils()->course_archive_page_url();
67 70 $lesson_url = site_url().'/course/'.'sample-course/<code>lessons</code>/sample-lesson/';
68 -
69 71 $student_url = tutor_utils()->profile_url();
70 -
71 72 $attempts_allowed = array();
72 73 $attempts_allowed['unlimited'] = __('Unlimited' , 'tutor');
73 74 $attempts_allowed = array_merge($attempts_allowed, array_combine(range(1,20), range(1,20)));
74 75
76 + $video_sources = array(
77 + 'html5' => __('HTML 5 (mp4)', 'tutor'),
78 + 'external_url' => __('External URL', 'tutor'),
79 + 'youtube' => __('Youtube', 'tutor'),
80 + 'vimeo' => __('Vimeo', 'tutor'),
81 + 'embedded' => __('Embedded', 'tutor')
82 + );
83 +
84 + $course_filters = array(
85 + 'search' => __('Keyword Search', 'tutor'),
86 + 'category' => __('Category', 'tutor'),
87 + 'tag' => __('Tag', 'tutor'),
88 + 'difficulty_level' => __('Difficulty Level', 'tutor'),
89 + 'price_type' => __('Price Type', 'tutor')
90 + );
91 +
75 92 $attr = array(
76 93 'general' => array(
77 94 'label' => __('General', 'tutor'),
78 95 'sections' => array(
@@ -79,36 +96,110 @@
79 96 'general' => array(
80 97 'label' => __('General', 'tutor'),
81 98 'desc' => __('General Settings', 'tutor'),
82 99 'fields' => array(
100 + 'tutor_dashboard_page_id' => array(
101 + 'type' => 'select',
102 + 'label' => __('Dashboard Page', 'tutor'),
103 + 'default' => '0',
104 + 'options' => $pages,
105 + 'desc' => __('This page will be used for student and instructor dashboard', 'tutor'),
106 + ),
83 107 'enable_public_profile' => array(
84 108 'type' => 'checkbox',
85 - 'label' => __('Enable Public Profile', 'tutor'),
109 + 'label' => __('Public Profile', 'tutor'),
110 + 'label_title' => __('Enable', 'tutor'),
86 111 'default' => '0',
87 112 'desc' => __('Enable this to make a profile publicly visible', 'tutor')."<br />" .$student_url,
88 113 ),
114 + 'enable_profile_completion' => array(
115 + 'type' => 'checkbox',
116 + 'label' => __('Profile Completion', 'tutor'),
117 + 'label_title' => __('Enable', 'tutor'),
118 + 'default' => '0',
119 + 'desc' => __('Enabling this feature will show a notification bar to students and instructors to complete their profile information', 'tutor'),
120 + ),
121 + 'disable_tutor_native_login' => array(
122 + 'type' => 'checkbox',
123 + 'label' => __('Tutor Native Login', 'tutor'),
124 + 'label_title' => __('Disable', 'tutor'),
125 + 'default' => '0',
126 + 'desc' => __('Disable to use the default WordPress login page', 'tutor'),
127 + ),
89 128 'load_tutor_css' => array(
90 129 'type' => 'checkbox',
91 - 'label' => __('Load Tutor default CSS', 'tutor'),
92 - 'default' => '1',
130 + 'label' => __('Load Tutor CSS', 'tutor'),
131 + 'label_title' => __('Enable', 'tutor'),
132 + 'default' => '0',
93 133 'desc' => __('If your theme has its own styling, then you can turn it off to load CSS from the plugin directory', 'tutor'),
94 134 ),
95 135 'load_tutor_js' => array(
96 136 'type' => 'checkbox',
97 - 'label' => __('Load Tutor default JavaScript', 'tutor'),
98 - 'default' => '1',
137 + 'label' => __('Load Tutor JavaScript', 'tutor'),
138 + 'label_title' => __('Enable', 'tutor'),
139 + 'default' => '0',
99 140 'desc' => __('If you have put required script in your theme javascript file, then you can turn it off to load JavaScript from the plugin directory', 'tutor'),
100 141 ),
101 142 'student_must_login_to_view_course' => array(
102 143 'type' => 'checkbox',
103 - 'label' => __('Course Permission', 'tutor'),
144 + 'label' => __('Course Visibility', 'tutor'),
145 + 'label_title' => __('Logged in only', 'tutor'),
104 146 'desc' => __('Students must be logged in to view course', 'tutor'),
105 147 ),
106 148 'delete_on_uninstall' => array(
107 149 'type' => 'checkbox',
108 150 'label' => __('Erase upon uninstallation', 'tutor'),
109 - 'desc' => __('Delete all data during uninstall', 'tutor'),
151 + 'label_title' => __('Enable', 'tutor'),
152 + 'desc' => __('Delete all data during uninstallation', 'tutor'),
110 153 ),
154 +
155 + 'enable_spotlight_mode' => array(
156 + 'type' => 'checkbox',
157 + 'label' => __('Spotlight mode', 'tutor'),
158 + 'label_title' => __('Enable', 'tutor'),
159 + 'default' => '0',
160 + 'desc' => __('This will hide the header and the footer and enable spotlight (full screen) mode when students view lessons.', 'tutor'),
161 + ),
162 + 'disable_default_player_youtube' => array(
163 + 'type' => 'checkbox',
164 + 'label' => __('YouTube Player', 'tutor'),
165 + 'label_title' => __('Enable', 'tutor'),
166 + 'default' => '0',
167 + 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
168 + ),
169 + 'disable_default_player_vimeo' => array(
170 + 'type' => 'checkbox',
171 + 'label' => __('Vimeo Player', 'tutor'),
172 + 'label_title' => __('Enable', 'tutor'),
173 + 'default' => '0',
174 + 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
175 + ),
176 + 'pagination_per_page' => array(
177 + 'type' => 'number',
178 + 'label' => __('Pagination', 'tutor'),
179 + 'default' => '20',
180 + 'desc' => __('Number of items you would like displayed "per page" in the pagination', 'tutor'),
181 + ),
182 + 'enable_tutor_maintenance_mode' => array(
183 + 'type' => 'checkbox',
184 + 'label' => __('Maintenance Mode', 'tutor'),
185 + 'label_title' => __('Enable', 'tutor'),
186 + 'default' => '0',
187 + 'desc' => __('Enabling the maintenance mode allows you to display a custom message on the frontend. During this time, visitors can not access the site content. But the wp-admin dashboard will remain accessible.', 'tutor'),
188 + ),
189 + 'hide_admin_bar_for_users' => array(
190 + 'type' => 'checkbox',
191 + 'label' => __('Frontend Admin Bar', 'tutor'),
192 + 'label_title' => __('Hide', 'tutor'),
193 + 'default' => '0',
194 + 'desc' => __('Hide admin bar option allow you to hide WordPress admin bar entirely from the frontend. It will still show to administrator roles user', 'tutor'),
195 + ),
196 + 'login_error_message' => array(
197 + 'type' => 'text',
198 + 'label' => __('Error message for wrong login credentials', 'tutor'),
199 + 'default' => 'Incorrect username or password.',
200 + 'desc' => __('Login error message displayed when the user puts wrong login credentials.', 'tutor'),
201 + ),
111 202 )
112 203 )
113 204 ),
114 205 ),
@@ -118,19 +209,37 @@
118 209 'general' => array(
119 210 'label' => __('General', 'tutor'),
120 211 'desc' => __('Course Settings', 'tutor'),
121 212 'fields' => array(
122 - 'display_course_instructors' => array(
213 + 'enable_gutenberg_course_edit' => array(
123 214 'type' => 'checkbox',
124 - 'label' => __('Display instructors profile', 'tutor'),
125 - 'label_title' => __('Show the instructor profile on course single page.', 'tutor'),
215 + 'label' => __('Gutenberg Editor', 'tutor'),
216 + 'label_title' => __('Enable', 'tutor'),
217 + 'desc' => __('Use Gutenberg editor on course description area.', 'tutor'),
126 218 ),
127 - 'enable_q_and_a_on_course' => array(
219 + 'hide_course_from_shop_page' => array(
128 220 'type' => 'checkbox',
129 - 'label' => __('Enable Q &amp; A on course', 'tutor'),
130 - 'default' => '0',
131 - 'desc' => __('Allow student to place their questions and answers on the course page, only enrolled student can do this', 'tutor'),
221 + 'label' => __('Enable / Disable', 'tutor'),
222 + 'label_title' => __('Hide course products from shop page', 'tutor'),
223 + 'desc' => __('Enabling this feature will remove course products from the shop page.', 'tutor'),
132 224 ),
225 + 'course_content_access_for_ia' => array(
226 + 'type' => 'checkbox',
227 + 'label' => __('Enable / Disable', 'tutor'),
228 + 'label_title' => __('Course Content Access', 'tutor'),
229 + 'desc' => __('Allow instructors and admins to view the course content without enrolling', 'tutor'),
230 + ),
231 + 'course_completion_process' => array(
232 + 'type' => 'radio',
233 + 'label' => __('Course Completion Process', 'tutor'),
234 + 'default' => 'flexible',
235 + 'select_options' => false,
236 + 'options' => array(
237 + 'flexible' => __('Flexible', 'tutor'),
238 + 'strict' => __('Strict Mode', 'tutor'),
239 + ),
240 + 'desc' => __('Students can complete courses anytime in the Flexible mode. In the Strict mode, students have to complete, pass all the lessons and quizzes (if any) to mark a course as complete.', 'tutor'),
241 + )
133 242 ),
134 243 ),
135 244 'archive' => array(
136 245 'label' => __('Archive', 'tutor'),
@@ -140,16 +249,16 @@
140 249 'type' => 'select',
141 250 'label' => __('Course Archive Page', 'tutor'),
142 251 'default' => '0',
143 252 'options' => $pages,
144 - 'desc' => __('Choose the page from the dropdown list where you want to show all of the courses', 'tutor'),
253 + 'desc' => __('This page will be used to list all the published courses.', 'tutor'),
145 254 ),
146 255 'courses_col_per_row' => array(
147 256 'type' => 'slider',
148 - 'label' => __('Column per row', 'tutor'),
257 + 'label' => __('Column Per Row', 'tutor'),
149 258 'default' => '4',
150 259 'options' => array('min'=> 1, 'max' => 6),
151 - 'desc' => __('Define how many column you want to show on the course single page', 'tutor'),
260 + 'desc' => __('Define how many column you want to use to display courses.', 'tutor'),
152 261 ),
153 262 'courses_per_page' => array(
154 263 'type' => 'slider',
155 264 'label' => __('Courses Per Page', 'tutor'),
@@ -156,10 +265,159 @@
156 265 'default' => '12',
157 266 'options' => array('min'=> 1, 'max' => 20),
158 267 'desc' => __('Define how many courses you want to show per page', 'tutor'),
159 268 ),
269 + 'course_archive_filter' => array(
270 + 'type' => 'checkbox',
271 + 'label' => __('Course Filter', 'tutor'),
272 + 'label_title' => __('Enable', 'tutor'),
273 + 'desc' => __('Show sorting and filtering options on course archive page', 'tutor'),
274 + ),
275 + 'supported_course_filters' => array(
276 + 'type' => 'checkbox',
277 + 'label' => __('Preferred Course Filters', 'tutor'),
278 + 'options' => $course_filters,
279 + 'desc' => __('Choose preferred filter options you\'d like to show in course archive page.', 'tutor'),
280 + ),
160 281 ),
161 282 ),
283 + 'enable_disable' => array(
284 + 'label' => __('Enable / Disable', 'tutor'),
285 + 'desc' => __('Course Display Settings', 'tutor'),
286 + 'fields' => array(
287 + 'display_course_instructors' => array(
288 + 'type' => 'checkbox',
289 + 'label' => __('Display Instructor Info', 'tutor'),
290 + 'label_title' => __('Enable', 'tutor'),
291 + 'desc' => __('Show instructor bio on each page', 'tutor'),
292 + ),
293 + 'enable_q_and_a_on_course' => array(
294 + 'type' => 'checkbox',
295 + 'label' => __('Question and Answer', 'tutor'),
296 + 'label_title' => __('Enable','tutor'),
297 + 'default' => '0',
298 + 'desc' => __('Enabling this feature will add a Q&amp;A section on every course.', 'tutor'),
299 + ),
300 + 'disable_course_author' => array(
301 + 'type' => 'checkbox',
302 + 'label' => __('Course Author', 'tutor'),
303 + 'label_title' => __('Disable','tutor'),
304 + 'default' => '0',
305 + 'desc' => __('Disabling this feature will be removed course author name from the course page.', 'tutor'),
306 + ),
307 + 'disable_course_level' => array(
308 + 'type' => 'checkbox',
309 + 'label' => __('Course Level', 'tutor'),
310 + 'label_title' => __('Disable','tutor'),
311 + 'default' => '0',
312 + 'desc' => __('Disabling this feature will be removed course level from the course page.', 'tutor'),
313 + ),
314 + 'disable_course_share' => array(
315 + 'type' => 'checkbox',
316 + 'label' => __('Course Share', 'tutor'),
317 + 'label_title' => __('Disable','tutor'),
318 + 'default' => '0',
319 + 'desc' => __('Disabling this feature will be removed course share option from the course page.', 'tutor'),
320 + ),
321 + 'disable_course_duration' => array(
322 + 'type' => 'checkbox',
323 + 'label' => __('Course Duration', 'tutor'),
324 + 'label_title' => __('Disable','tutor'),
325 + 'default' => '0',
326 + 'desc' => __('Disabling this feature will be removed course duration from the course page.', 'tutor'),
327 + ),
328 + 'disable_course_total_enrolled' => array(
329 + 'type' => 'checkbox',
330 + 'label' => __('Course Total Enrolled', 'tutor'),
331 + 'label_title' => __('Disable','tutor'),
332 + 'default' => '0',
333 + 'desc' => __('Disabling this feature will be removed course total enrolled from the course page.', 'tutor'),
334 + ),
335 + 'disable_course_update_date' => array(
336 + 'type' => 'checkbox',
337 + 'label' => __('Course Update Date', 'tutor'),
338 + 'label_title' => __('Disable','tutor'),
339 + 'default' => '0',
340 + 'desc' => __('Disabling this feature will be removed course update date from the course page.', 'tutor'),
341 + ),
342 + 'disable_course_progress_bar' => array(
343 + 'type' => 'checkbox',
344 + 'label' => __('Course Progress Bar', 'tutor'),
345 + 'label_title' => __('Disable','tutor'),
346 + 'default' => '0',
347 + 'desc' => __('Disabling this feature will be removed completing progress bar from the course page.', 'tutor'),
348 + ),
349 + 'disable_course_material' => array(
350 + 'type' => 'checkbox',
351 + 'label' => __('Course Material', 'tutor'),
352 + 'label_title' => __('Disable','tutor'),
353 + 'default' => '0',
354 + 'desc' => __('Disabling this feature will be removed course material from the course page.', 'tutor'),
355 + ),
356 + 'disable_course_about' => array(
357 + 'type' => 'checkbox',
358 + 'label' => __('Course About', 'tutor'),
359 + 'label_title' => __('Disable','tutor'),
360 + 'default' => '0',
361 + 'desc' => __('Disabling this feature will be removed course about from the course page.', 'tutor'),
362 + ),
363 + 'disable_course_description' => array(
364 + 'type' => 'checkbox',
365 + 'label' => __('Course Description', 'tutor'),
366 + 'label_title' => __('Disable','tutor'),
367 + 'default' => '0',
368 + 'desc' => __('Disabling this feature will be removed course description from the course page.', 'tutor'),
369 + ),
370 + 'disable_course_benefits' => array(
371 + 'type' => 'checkbox',
372 + 'label' => __('Course Benefits', 'tutor'),
373 + 'label_title' => __('Disable','tutor'),
374 + 'default' => '0',
375 + 'desc' => __('Disabling this feature will be removed course benefits from the course page.', 'tutor'),
376 + ),
377 + 'disable_course_requirements' => array(
378 + 'type' => 'checkbox',
379 + 'label' => __('Course Requirements', 'tutor'),
380 + 'label_title' => __('Disable','tutor'),
381 + 'default' => '0',
382 + 'desc' => __('Disabling this feature will be removed course requirements from the course page.', 'tutor'),
383 + ),
384 + 'disable_course_target_audience' => array(
385 + 'type' => 'checkbox',
386 + 'label' => __('Course Target Audience', 'tutor'),
387 + 'label_title' => __('Disable','tutor'),
388 + 'default' => '0',
389 + 'desc' => __('Disabling this feature will be removed course target audience from the course page.', 'tutor'),
390 + ),
391 + 'disable_course_announcements' => array(
392 + 'type' => 'checkbox',
393 + 'label' => __('Course Announcements', 'tutor'),
394 + 'label_title' => __('Disable','tutor'),
395 + 'default' => '0',
396 + 'desc' => __('Disabling this feature will be removed course announcements from the course page.', 'tutor'),
397 + ),
398 + 'disable_course_review' => array(
399 + 'type' => 'checkbox',
400 + 'label' => __('Course Review', 'tutor'),
401 + 'label_title' => __('Disable','tutor'),
402 + 'default' => '0',
403 + 'desc' => __('Disabling this feature will be removed course review system from the course page.', 'tutor'),
404 + ),
405 + 'supported_video_sources' => array(
406 + 'type' => 'checkbox',
407 + 'label' => __('Preferred Video Source', 'tutor'),
408 + 'options' => $video_sources,
409 + 'desc' => __('Choose video sources you\'d like to support. Unchecking all will not disable video feature.', 'tutor'),
410 + ),
411 + 'default_video_source' => array(
412 + 'type' => 'select',
413 + 'label' => __('Default Video Source', 'tutor'),
414 + 'default' => '',
415 + 'options' => $video_sources,
416 + 'desc' => __('Choose video source to be selected by default.', 'tutor'),
417 + ),
418 + ),
419 + ),
162 420 ),
163 421 ),
164 422 'lesson' => array(
165 423 'label' => __('Lessons', 'tutor'),
@@ -167,8 +425,20 @@
167 425 'lesson_settings' => array(
168 426 'label' => __('Lesson Settings', 'tutor'),
169 427 'desc' => __('Lesson settings will be here', 'tutor'),
170 428 'fields' => array(
429 + 'enable_lesson_classic_editor' => array(
430 + 'type' => 'checkbox',
431 + 'label' => __('Classic Editor', 'tutor'),
432 + 'label_title' => __('Enable', 'tutor'),
433 + 'desc' => __('Enable classic editor to get full support of any editor/page builder.', 'tutor'),
434 + ),
435 + 'autoload_next_course_content' => array(
436 + 'type' => 'checkbox',
437 + 'label' => __('Enable / Disable', 'tutor'),
438 + 'label_title' => __('Automatically load next course content.', 'tutor'),
439 + 'desc' => __('Enabling this feature will be load next course content automatically after finishing current video.', 'tutor'),
440 + ),
171 441 'lesson_permalink_base' => array(
172 442 'type' => 'text',
173 443 'label' => __('Lesson Permalink Base', 'tutor'),
174 444 'default' => 'lessons',
@@ -173,11 +443,9 @@
173 443 'label' => __('Lesson Permalink Base', 'tutor'),
174 444 'default' => 'lessons',
175 445 'desc' => $lesson_url,
176 446 ),
177 -
178 447 ),
179 -
180 448 ),
181 449
182 450 ),
183 451 ),
@@ -190,9 +458,9 @@
190 458 'fields' => array(
191 459 'quiz_time_limit' => array(
192 460 'type' => 'group_fields',
193 461 'label' => __('Time Limit', 'tutor'),
194 - 'desc' => __('Default time limit for quizzes. 0 means no time limit.', 'tutor'),
462 + 'desc' => __('0 means unlimited time.', 'tutor'),
195 463 'group_fields' => array(
196 464 'value' => array(
197 465 'type' => 'text',
198 466 'default' => '0',
@@ -210,33 +478,29 @@
210 478 ),
211 479 ),
212 480 ),
213 481 ),
214 -
215 482 'quiz_when_time_expires' => array(
216 - 'type' => 'select',
483 + 'type' => 'radio',
217 484 'label' => __('When time expires', 'tutor'),
218 485 'default' => 'minutes',
219 486 'select_options' => false,
220 487 'options' => array(
221 - 'autosubmit' => __('Current attempts are submitted automatically', 'tutor'),
222 - 'graceperiod' => __('There is a grace period when current attempts can be submitted, but no more questions answered', 'tutor'),
488 + 'autosubmit' => __('The current quiz answers are submitted automatically.', 'tutor'),
489 + 'graceperiod' => __('The current quiz answers are submitted by students.', 'tutor'),
223 490 'autoabandon' => __('Attempts must be submitted before time expires, otherwise they will not be counted', 'tutor'),
224 491 ),
225 - 'desc' => __('What should happen by default if a student does not submit the quiz before time expires.', 'tutor'),
492 + 'desc' => __('Choose which action to follow when the quiz time expires.', 'tutor'),
226 493 ),
227 -
228 494 'quiz_attempts_allowed' => array(
229 - 'type' => 'slider',
495 + 'type' => 'number',
230 496 'label' => __('Attempts allowed', 'tutor'),
231 497 'default' => '10',
232 - 'options' => array('min'=> 0, 'max' => 20),
233 - 'desc' => __('Restriction on the number of attempts students are allowed to take for a quiz. 0 for no limit', 'tutor'),
498 + 'desc' => __('The highest number of attempts students are allowed to take for a quiz. 0 means unlimited attempts.', 'tutor'),
234 499 ),
235 -
236 500 'quiz_grade_method' => array(
237 501 'type' => 'select',
238 - 'label' => __('Grading method', 'tutor'),
502 + 'label' => __('Final grade calculation', 'tutor'),
239 503 'default' => 'minutes',
240 504 'select_options' => false,
241 505 'options' => array(
242 506 'highest_grade' => __('Highest Grade', 'tutor'),
@@ -256,26 +520,40 @@
256 520 'general' => array(
257 521 'label' => __('Instructor Profile Settings', 'tutor'),
258 522 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
259 523 'fields' => array(
524 + 'enable_course_marketplace' => array(
525 + 'type' => 'checkbox',
526 + 'label' => __('Course Marketplace', 'tutor'),
527 + 'label_title' => __('Enable', 'tutor'),
528 + 'default' => '0',
529 + 'desc' => __('Allow multiple instructors to upload their courses.', 'tutor'),
530 + ),
260 531 'instructor_register_page' => array(
261 532 'type' => 'select',
262 - 'label' => __('Instructor Register Page', 'tutor'),
533 + 'label' => __('Instructor Registration Page', 'tutor'),
263 534 'default' => '0',
264 535 'options' => $pages,
265 - 'desc' => __('This will be instructor register page', 'tutor'),
536 + 'desc' => __('This page will be used to sign up new instructors.', 'tutor'),
266 537 ),
267 538 'instructor_can_publish_course' => array(
268 539 'type' => 'checkbox',
269 - 'label' => __('Can publish course', 'tutor'),
540 + 'label' => __('Allow publishing course', 'tutor'),
541 + 'label_title' => __('Enable', 'tutor'),
270 542 'default' => '0',
271 - 'desc' => __('Define if a instructor can publish his courses directly or not, if unchecked, they can still add courses, but it will go to admin for review', 'tutor'),
543 + 'desc' => __('Enable instructors to publish course directly. <strong>Do not select</strong> if admins want to review courses before publishing.', 'tutor'),
272 544 ),
545 + 'enable_become_instructor_btn' => array(
546 + 'type' => 'checkbox',
547 + 'label' => __('Become Instructor Button', 'tutor'),
548 + 'label_title' => __('Enable', 'tutor'),
549 + 'default' => '0',
550 + 'desc' => __('Uncheck this option to hide the button from student dashboard.', 'tutor'),
551 + ),
273 552 ),
274 553 ),
275 554 ),
276 555 ),
277 -
278 556 'students' => array(
279 557 'label' => __('Students', 'tutor'),
280 558 'sections' => array(
281 559 'general' => array(
@@ -283,47 +561,221 @@
283 561 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
284 562 'fields' => array(
285 563 'student_register_page' => array(
286 564 'type' => 'select',
287 - 'label' => __('Student Register Page', 'tutor'),
565 + 'label' => __('Student Registration Page', 'tutor'),
288 566 'default' => '0',
289 567 'options' => $pages,
290 568 'desc' => __('Choose the page for student registration page', 'tutor'),
291 569 ),
292 - 'student_dashboard' => array(
293 - 'type' => 'select',
294 - 'label' => __('Student Dashboard', 'tutor'),
295 - 'default' => '0',
296 - 'options' => $pages,
297 - 'desc' => __('This page will show students related stuff, like my courses, order, etc', 'tutor'),
298 - ),
299 -
300 570 'students_own_review_show_at_profile' => array(
301 571 'type' => 'checkbox',
302 572 'label' => __('Show reviews on profile', 'tutor'),
303 - 'label_title' => __('Enable students review on their profile', 'tutor'),
573 + 'label_title' => __('Enable', 'tutor'),
304 574 'default' => '0',
305 - 'desc' => __('Enabling this will allow the reviews written by each individual students on their profile', 'tutor')."<br />" .$student_url,
575 + 'desc' => __('Enabling this will show the reviews written by each student on their profile', 'tutor')."<br />" .$student_url,
306 576 ),
307 577 'show_courses_completed_by_student' => array(
308 578 'type' => 'checkbox',
309 - 'label' => __('Show Completed Course', 'tutor'),
579 + 'label' => __('Show completed courses', 'tutor'),
580 + 'label_title' => __('Enable', 'tutor'),
310 581 'default' => '0',
311 - 'desc' => __('Completed courses will be show on student profile', 'tutor')."<br />".$student_url,
582 + 'desc' => __('Completed courses will be shown on student profiles. <br/> For example, you can see this link-', 'tutor').$student_url,
312 583 ),
584 + ),
585 + ),
586 + ),
587 + ),
588 + 'tutor_earning' => array(
589 + 'label' => __('Earning', 'tutor'),
590 + 'sections' => array(
591 + 'general' => array(
592 + 'label' => __('Earning and commission allocation', 'tutor'),
593 + 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
594 + 'fields' => array(
595 + 'enable_tutor_earning' => array(
596 + 'type' => 'checkbox',
597 + 'label' => __('Earning', 'tutor'),
598 + 'label_title' => __('Enable', 'tutor'),
599 + 'default' => '0',
600 + 'desc' => __('If disabled, the Admin will receive 100% of the earning', 'tutor'),
601 + ),
602 + 'earning_admin_commission' => array(
603 + 'type' => 'number',
604 + 'label' => __('Admin Commission Percentage', 'tutor'),
605 + 'default' => '0',
606 + 'desc' => __('Define the commission of the Admin from each sale.(after deducting fees)', 'tutor'),
607 + ),
608 + 'earning_instructor_commission' => array(
609 + 'type' => 'number',
610 + 'label' => __('Instructor Commission Percentage', 'tutor'),
611 + 'default' => '0',
612 + 'desc' => __('Define the commission for instructors from each sale.(after deducting fees)', 'tutor'),
613 + ),
614 + 'tutor_earning_fees' => array(
615 + 'type' => 'group_fields',
616 + 'label' => __('Fee Deduction', 'tutor'),
617 + 'desc' => __('Fees are charged from the entire sales amount. The remaining amount will be divided among admin and instructors.', 'tutor'),
618 + 'group_fields' => array(
313 619
620 + 'enable_fees_deducting' => array(
621 + 'type' => 'checkbox',
622 + 'label' => __('Enable', 'tutor'),
623 + 'default' => '0',
624 + ),
625 + 'fees_name' => array(
626 + 'type' => 'text',
627 + 'label' => __('Fee Name', 'tutor'),
628 + 'default' => '',
629 + ),
630 + 'fees_amount' => array(
631 + 'type' => 'number',
632 + 'label' => __('Fee Amount', 'tutor'),
633 + 'default' => '',
634 + ),
635 + 'fees_type' => array(
636 + 'type' => 'select',
637 + 'default' => 'minutes',
638 + 'select_options' => false,
639 + 'options' => array(
640 + '' => __('Select Fees Type', 'tutor'),
641 + 'percent' => __('Percent', 'tutor'),
642 + 'fixed' => __('Fixed', 'tutor'),
643 + ),
644 + ),
645 +
646 + ),
647 + ),
648 + 'statement_show_per_page' => array(
649 + 'type' => 'number',
650 + 'label' => __('Show Statement Per Page', 'tutor'),
651 + 'default' => '20',
652 + 'desc' => __('Define the number of statements to show.', 'tutor'),
653 + ),
314 654 ),
315 655 ),
316 656 ),
317 657 ),
658 + 'tutor_withdraw' => array(
659 + 'label' => __('Withdrawal', 'tutor'),
660 + 'sections' => array(
661 + 'general' => array(
662 + 'label' => __('Withdrawal Settings', 'tutor'),
663 + 'fields' => array(
664 + 'min_withdraw_amount' => array(
665 + 'type' => 'number',
666 + 'label' => __('Minimum Withdraw Amount', 'tutor'),
667 + 'default' => '80',
668 + 'desc' => __('Instructors should earn equal or above this amount to make a withdraw request.', 'tutor'),
669 + ),
670 + ),
671 + ),
318 672
673 + 'withdraw_methods' => array(
674 + 'label' => __('Withdraw Methods', 'tutor'),
675 + 'desc' => __('Set withdraw settings', 'tutor'),
676 + ),
677 + ),
678 + ),
319 679
680 + 'tutor_style' => array(
681 + 'label' => __('Style', 'tutor'),
682 + 'sections' => array(
683 + 'general' => array(
684 + 'label' => __('Color Style', 'tutor'),
685 + 'fields' => array(
686 + 'tutor_primary_color' => array(
687 + 'type' => 'color',
688 + 'label' => __('Primary Color', 'tutor'),
689 + 'default' => '',
690 + ),
691 + 'tutor_primary_hover_color' => array(
692 + 'type' => 'color',
693 + 'label' => __('Primary Hover Color', 'tutor'),
694 + 'default' => '',
695 + ),
696 + 'tutor_text_color' => array(
697 + 'type' => 'color',
698 + 'label' => __('Text color', 'tutor'),
699 + 'default' => '',
700 + ),
701 + 'tutor_light_color' => array(
702 + 'type' => 'color',
703 + 'label' => __('Light color', 'tutor'),
704 + 'default' => '',
705 + ),
706 + //tutor button style options
707 +
708 + 'tutor_button_primary' => array(
709 + 'type' => 'color',
710 + 'label' => __('Button Primary Color','tutor'),
711 + 'default' => ''
712 + ),
713 +
714 + 'tutor_button_danger' => array(
715 + 'type' => 'color',
716 + 'label' => __('Button Danger Color','tutor'),
717 + 'default' => ''
718 + ),
719 + 'tutor_button_success' => array(
720 + 'type' => 'color',
721 + 'label' => __('Button Success Color','tutor'),
722 + 'default' => ''
723 + ),
724 + 'tutor_button_warning' => array(
725 + 'type' => 'color',
726 + 'label' => __('Button Warning Color','tutor'),
727 + 'default' => ''
728 + ),
729 + ),
730 + ),
731 +
732 + ),
733 + ),
734 +
735 + 'monetization' => array(
736 + 'label' => __('Monetization', 'tutor'),
737 + 'sections' => array(
738 + 'general' => array(
739 + 'label' => __('Monetization', 'tutor'),
740 + 'desc' => __('You can monetize your LMS website by selling courses in a various way.', 'tutor'),
741 + 'fields' => array(
742 +
743 + 'monetize_by' => array(
744 + 'type' => 'radio',
745 + 'label' => __('Monetize Option', 'tutor'),
746 + 'default' => 'free',
747 + 'select_options' => false,
748 + 'options' => apply_filters('tutor_monetization_options', array(
749 + 'free' => __('Disable Monetization', 'tutor'),
750 + )),
751 + 'desc' => __('Select a monetization option to generate revenue by selling courses. Supports: WooCommerce, Easy Digital Downloads, Paid Memberships Pro', 'tutor'),
752 + ),
753 +
754 + )
755 + )
756 + ),
757 + ),
758 +
320 759 );
321 760
322 - return apply_filters('tutor/options/attr', $attr);
761 + $attrs = apply_filters('tutor/options/attr', $attr);
762 + $extends = apply_filters('tutor/options/extend/attr', array());
763 +
764 + if (tutils()->count($extends)){
765 + foreach ($extends as $extend_key => $extend_option){
766 + if (isset($attrs[$extend_key])&& tutils()->count($extend_option['sections']) ){
767 + $sections = $attrs[$extend_key]['sections'];
768 + $sections = array_merge($sections, $extend_option['sections']);
769 + $attrs[$extend_key]['sections'] = $sections;
770 + }
771 + }
772 + }
773 +
774 + return $attrs;
775 +
323 776 }
324 777
325 -
326 778 /**
327 779 * @param array $field
328 780 *
329 781 * @return string
@@ -346,8 +798,6 @@
346 798 ob_start();
347 799 include tutor()->path.'views/options/options_generator.php';
348 800 return ob_get_clean();
349 801 }
350 -
351 -
352 802
353 803 }