PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 1.5.1
Tutor LMS – eLearning and online course solution v1.5.1
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 1.1.0 1.1.1 1.2.0 1.2.1 1.2.11 1.2.12 1.2.13 1.2.20 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.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 / classes / Options.php
tutor / classes Last commit date
Addons.php 6 years ago Admin.php 6 years ago Ajax.php 6 years ago Assets.php 6 years ago Course.php 6 years ago Course_Settings_Tabs.php 6 years ago Course_Widget.php 6 years ago Dashboard.php 6 years ago Email.php 6 years ago FormHandler.php 6 years ago Gutenberg.php 6 years ago Instructor.php 6 years ago Instructors_List.php 6 years ago Lesson.php 6 years ago Options.php 6 years ago Post_types.php 6 years ago Q_and_A.php 6 years ago Question_Answers_List.php 6 years ago Quiz.php 6 years ago Quiz_Attempts_List.php 6 years ago RestAPI.php 6 years ago Rewrite_Rules.php 6 years ago Shortcode.php 6 years ago Student.php 6 years ago Students_List.php 6 years ago Taxonomies.php 6 years ago Template.php 6 years ago Theme_Compatibility.php 6 years ago Tools.php 6 years ago Tutor.php 6 years ago TutorEDD.php 6 years ago Tutor_Base.php 6 years ago Tutor_List_Table.php 6 years ago Upgrader.php 6 years ago User.php 6 years ago Utils.php 6 years ago Video_Stream.php 6 years ago Withdraw.php 6 years ago Withdraw_Requests_List.php 6 years ago WooCommerce.php 6 years ago
Options.php
695 lines
1 <?php
2 namespace Tutor;
3
4 if ( ! defined( 'ABSPATH' ) )
5 exit;
6
7 class Options {
8
9 public $option;
10 public $options_attr;
11
12 public function __construct() {
13 $this->option = (array) maybe_unserialize(get_option('tutor_option'));
14 $this->options_attr = $this->options_attr();
15
16 //Saving option
17 add_action('wp_ajax_tutor_option_save', array($this, 'tutor_option_save'));
18 }
19
20 private function get($key = null, $default = false){
21 $option = $this->option;
22 if (empty($option) || ! is_array($option)){
23 return $default;
24 }
25 if ( ! $key){
26 return $option;
27 }
28 if (array_key_exists($key, $option)){
29 return apply_filters($key, $option[$key]);
30 }
31 //Access array value via dot notation, such as option->get('value.subvalue')
32 if (strpos($key, '.')){
33 $option_key_array = explode('.', $key);
34 $new_option = $option;
35 foreach ($option_key_array as $dotKey){
36 if (isset($new_option[$dotKey])){
37 $new_option = $new_option[$dotKey];
38 }else{
39 return $default;
40 }
41 }
42 return apply_filters($key, $new_option);
43 }
44
45 return $default;
46 }
47
48 public function tutor_option_save(){
49 if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce( $_POST['_wpnonce'], 'tutor_option_save' ) ){
50 exit();
51 }
52
53 do_action('tutor_option_save_before');
54
55 $option = (array) isset($_POST['tutor_option']) ? $_POST['tutor_option'] : array();
56 $option = apply_filters('tutor_option_input', $option);
57 update_option('tutor_option', $option);
58
59 do_action('tutor_option_save_after');
60 //re-sync settings
61 //init::tutor_activate();
62
63 wp_send_json_success( array('msg' => __('Option Updated', 'tutor') ) );
64 }
65
66 public function options_attr(){
67 $pages = tutor_utils()->get_pages();
68
69 //$course_base = tutor_utils()->course_archive_page_url();
70 $lesson_url = site_url().'/course/'.'sample-course/<code>lessons</code>/sample-lesson/';
71 $student_url = tutor_utils()->profile_url();
72 $attempts_allowed = array();
73 $attempts_allowed['unlimited'] = __('Unlimited' , 'tutor');
74 $attempts_allowed = array_merge($attempts_allowed, array_combine(range(1,20), range(1,20)));
75
76 $attr = array(
77 'general' => array(
78 'label' => __('General', 'tutor'),
79 'sections' => array(
80 'general' => array(
81 'label' => __('General', 'tutor'),
82 'desc' => __('General Settings', 'tutor'),
83 'fields' => array(
84 'tutor_dashboard_page_id' => array(
85 'type' => 'select',
86 'label' => __('Dashboard Page', 'tutor'),
87 'default' => '0',
88 'options' => $pages,
89 'desc' => __('This page will be used for student and instructor dashboard', 'tutor'),
90 ),
91 'enable_public_profile' => array(
92 'type' => 'checkbox',
93 'label' => __('Public Profile', 'tutor'),
94 'label_title' => __('Enable', 'tutor'),
95 'default' => '0',
96 'desc' => __('Enable this to make a profile publicly visible', 'tutor')."<br />" .$student_url,
97 ),
98 'load_tutor_css' => array(
99 'type' => 'checkbox',
100 'label' => __('Load Tutor CSS', 'tutor'),
101 'label_title' => __('Enable', 'tutor'),
102 'default' => '1',
103 'desc' => __('If your theme has its own styling, then you can turn it off to load CSS from the plugin directory', 'tutor'),
104 ),
105 'load_tutor_js' => array(
106 'type' => 'checkbox',
107 'label' => __('Load Tutor JavaScript', 'tutor'),
108 'label_title' => __('Enable', 'tutor'),
109 'default' => '1',
110 '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'),
111 ),
112 'student_must_login_to_view_course' => array(
113 'type' => 'checkbox',
114 'label' => __('Course Visibility', 'tutor'),
115 'label_title' => __('Logged in only', 'tutor'),
116 'desc' => __('Students must be logged in to view course', 'tutor'),
117 ),
118 'delete_on_uninstall' => array(
119 'type' => 'checkbox',
120 'label' => __('Erase upon uninstallation', 'tutor'),
121 'label_title' => __('Enable', 'tutor'),
122 'desc' => __('Delete all data during uninstallation', 'tutor'),
123 ),
124
125 'enable_spotlight_mode' => array(
126 'type' => 'checkbox',
127 'label' => __('Spotlight mode', 'tutor'),
128 'label_title' => __('Enable', 'tutor'),
129 'default' => '0',
130 'desc' => __('This will hide the header and the footer and enable spotlight (full screen) mode when students view lessons.', 'tutor'),
131 ),
132 'disable_default_player_youtube' => array(
133 'type' => 'checkbox',
134 'label' => __('YouTube Player', 'tutor'),
135 'label_title' => __('Enable', 'tutor'),
136 'default' => '0',
137 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
138 ),
139 'disable_default_player_vimeo' => array(
140 'type' => 'checkbox',
141 'label' => __('Vimeo Player', 'tutor'),
142 'label_title' => __('Enable', 'tutor'),
143 'default' => '0',
144 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
145 ),
146 'pagination_per_page' => array(
147 'type' => 'number',
148 'label' => __('Pagination', 'tutor'),
149 'default' => '20',
150 'desc' => __('Number of items you would like displayed "per page" in the pagination', 'tutor'),
151 ),
152 'enable_tutor_maintenance_mode' => array(
153 'type' => 'checkbox',
154 'label' => __('Maintenance Mode', 'tutor'),
155 'label_title' => __('Enable', 'tutor'),
156 'default' => '0',
157 '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'),
158 ),
159 )
160 )
161 ),
162 ),
163 'course' => array(
164 'label' => __('Course', 'tutor'),
165 'sections' => array(
166 'general' => array(
167 'label' => __('General', 'tutor'),
168 'desc' => __('Course Settings', 'tutor'),
169 'fields' => array(
170 'enable_gutenberg_course_edit' => array(
171 'type' => 'checkbox',
172 'label' => __('Gutenberg Editor', 'tutor'),
173 'label_title' => __('Enable', 'tutor'),
174 'desc' => __('Use Gutenberg editor on course description area.', 'tutor'),
175 ),
176 'hide_course_from_shop_page' => array(
177 'type' => 'checkbox',
178 'label' => __('Enable / Disable', 'tutor'),
179 'label_title' => __('Hide course products from shop page', 'tutor'),
180 'desc' => __('Enabling this feature will be removed course products from the shop page.', 'tutor'),
181 ),
182 ),
183 ),
184 'archive' => array(
185 'label' => __('Archive', 'tutor'),
186 'desc' => __('Course Archive Settings', 'tutor'),
187 'fields' => array(
188 'course_archive_page' => array(
189 'type' => 'select',
190 'label' => __('Course Archive Page', 'tutor'),
191 'default' => '0',
192 'options' => $pages,
193 'desc' => __('This page will be used to list all the published courses.', 'tutor'),
194 ),
195 'courses_col_per_row' => array(
196 'type' => 'slider',
197 'label' => __('Column Per Row', 'tutor'),
198 'default' => '4',
199 'options' => array('min'=> 1, 'max' => 6),
200 'desc' => __('Define how many column you want to use to display courses.', 'tutor'),
201 ),
202 'courses_per_page' => array(
203 'type' => 'slider',
204 'label' => __('Courses Per Page', 'tutor'),
205 'default' => '12',
206 'options' => array('min'=> 1, 'max' => 20),
207 'desc' => __('Define how many courses you want to show per page', 'tutor'),
208 ),
209 ),
210 ),
211 'enable_disable' => array(
212 'label' => __('Enable / Disable', 'tutor'),
213 'desc' => __('Course Display Settings', 'tutor'),
214 'fields' => array(
215 'display_course_instructors' => array(
216 'type' => 'checkbox',
217 'label' => __('Display Instructor Info', 'tutor'),
218 'label_title' => __('Enable', 'tutor'),
219 'desc' => __('Show instructor bio on each page', 'tutor'),
220 ),
221 'enable_q_and_a_on_course' => array(
222 'type' => 'checkbox',
223 'label' => __('Question and Answer', 'tutor'),
224 'label_title' => __('Enable','tutor'),
225 'default' => '0',
226 'desc' => __('Enabling this feature will add a Q&amp;A section on every course.', 'tutor'),
227 ),
228 'disable_course_author' => array(
229 'type' => 'checkbox',
230 'label' => __('Course Author', 'tutor'),
231 'label_title' => __('Disable','tutor'),
232 'default' => '0',
233 'desc' => __('Disabling this feature will be removed course author name from the course page.', 'tutor'),
234 ),
235 'disable_course_level' => array(
236 'type' => 'checkbox',
237 'label' => __('Course Level', 'tutor'),
238 'label_title' => __('Disable','tutor'),
239 'default' => '0',
240 'desc' => __('Disabling this feature will be removed course level from the course page.', 'tutor'),
241 ),
242 'disable_course_share' => array(
243 'type' => 'checkbox',
244 'label' => __('Course Share', 'tutor'),
245 'label_title' => __('Disable','tutor'),
246 'default' => '0',
247 'desc' => __('Disabling this feature will be removed course share option from the course page.', 'tutor'),
248 ),
249 'disable_course_duration' => array(
250 'type' => 'checkbox',
251 'label' => __('Course Duration', 'tutor'),
252 'label_title' => __('Disable','tutor'),
253 'default' => '0',
254 'desc' => __('Disabling this feature will be removed course duration from the course page.', 'tutor'),
255 ),
256 'disable_course_total_enrolled' => array(
257 'type' => 'checkbox',
258 'label' => __('Course Total Enrolled', 'tutor'),
259 'label_title' => __('Disable','tutor'),
260 'default' => '0',
261 'desc' => __('Disabling this feature will be removed course total enrolled from the course page.', 'tutor'),
262 ),
263 'disable_course_update_date' => array(
264 'type' => 'checkbox',
265 'label' => __('Course Update Date', 'tutor'),
266 'label_title' => __('Disable','tutor'),
267 'default' => '0',
268 'desc' => __('Disabling this feature will be removed course update date from the course page.', 'tutor'),
269 ),
270 'disable_course_progress_bar' => array(
271 'type' => 'checkbox',
272 'label' => __('Course Progress Bar', 'tutor'),
273 'label_title' => __('Disable','tutor'),
274 'default' => '0',
275 'desc' => __('Disabling this feature will be removed completing progress bar from the course page.', 'tutor'),
276 ),
277 'disable_course_material' => array(
278 'type' => 'checkbox',
279 'label' => __('Course Material', 'tutor'),
280 'label_title' => __('Disable','tutor'),
281 'default' => '0',
282 'desc' => __('Disabling this feature will be removed course material from the course page.', 'tutor'),
283 ),
284 'disable_course_about' => array(
285 'type' => 'checkbox',
286 'label' => __('Course About', 'tutor'),
287 'label_title' => __('Disable','tutor'),
288 'default' => '0',
289 'desc' => __('Disabling this feature will be removed course about from the course page.', 'tutor'),
290 ),
291 'disable_course_description' => array(
292 'type' => 'checkbox',
293 'label' => __('Course Description', 'tutor'),
294 'label_title' => __('Disable','tutor'),
295 'default' => '0',
296 'desc' => __('Disabling this feature will be removed course description from the course page.', 'tutor'),
297 ),
298 'disable_course_benefits' => array(
299 'type' => 'checkbox',
300 'label' => __('Course Benefits', 'tutor'),
301 'label_title' => __('Disable','tutor'),
302 'default' => '0',
303 'desc' => __('Disabling this feature will be removed course benefits from the course page.', 'tutor'),
304 ),
305 'disable_course_requirements' => array(
306 'type' => 'checkbox',
307 'label' => __('Course Requirements', 'tutor'),
308 'label_title' => __('Disable','tutor'),
309 'default' => '0',
310 'desc' => __('Disabling this feature will be removed course requirements from the course page.', 'tutor'),
311 ),
312 'disable_course_target_audience' => array(
313 'type' => 'checkbox',
314 'label' => __('Course Target Audience', 'tutor'),
315 'label_title' => __('Disable','tutor'),
316 'default' => '0',
317 'desc' => __('Disabling this feature will be removed course target audience from the course page.', 'tutor'),
318 ),
319 'disable_course_announcements' => array(
320 'type' => 'checkbox',
321 'label' => __('Course Announcements', 'tutor'),
322 'label_title' => __('Disable','tutor'),
323 'default' => '0',
324 'desc' => __('Disabling this feature will be removed course announcements from the course page.', 'tutor'),
325 ),
326 'disable_course_review' => array(
327 'type' => 'checkbox',
328 'label' => __('Course Review', 'tutor'),
329 'label_title' => __('Disable','tutor'),
330 'default' => '0',
331 'desc' => __('Disabling this feature will be removed course review system from the course page.', 'tutor'),
332 ),
333 ),
334 ),
335 ),
336 ),
337 'lesson' => array(
338 'label' => __('Lessons', 'tutor'),
339 'sections' => array(
340 'lesson_settings' => array(
341 'label' => __('Lesson Settings', 'tutor'),
342 'desc' => __('Lesson settings will be here', 'tutor'),
343 'fields' => array(
344 'enable_lesson_classic_editor' => array(
345 'type' => 'checkbox',
346 'label' => __('Classic Editor', 'tutor'),
347 'label_title' => __('Enable', 'tutor'),
348 'desc' => __('Enable classic editor to get full support of any editor/page builder.', 'tutor'),
349 ),
350 'autoload_next_course_content' => array(
351 'type' => 'checkbox',
352 'label' => __('Enable / Disable', 'tutor'),
353 'label_title' => __('Automatically load next course content.', 'tutor'),
354 'desc' => __('Enabling this feature will be load next course content automatically after finishing current video.', 'tutor'),
355 ),
356 'lesson_permalink_base' => array(
357 'type' => 'text',
358 'label' => __('Lesson Permalink Base', 'tutor'),
359 'default' => 'lessons',
360 'desc' => $lesson_url,
361 ),
362 ),
363 ),
364
365 ),
366 ),
367 'quiz' => array(
368 'label' => __('Quiz', 'tutor'),
369 'sections' => array(
370 'general' => array(
371 'label' => __('Quiz', 'tutor'),
372 'desc' => __('The values you set here define the default values that are used in the settings form when you create a new quiz.', 'tutor'),
373 'fields' => array(
374 'quiz_time_limit' => array(
375 'type' => 'group_fields',
376 'label' => __('Time Limit', 'tutor'),
377 'desc' => __('0 means unlimited time.', 'tutor'),
378 'group_fields' => array(
379 'value' => array(
380 'type' => 'text',
381 'default' => '0',
382 ),
383 'time' => array(
384 'type' => 'select',
385 'default' => 'minutes',
386 'select_options' => false,
387 'options' => array(
388 'weeks' => __('Weeks', 'tutor'),
389 'days' => __('Days', 'tutor'),
390 'hours' => __('Hours', 'tutor'),
391 'minutes' => __('Minutes', 'tutor'),
392 'seconds' => __('Seconds', 'tutor'),
393 ),
394 ),
395 ),
396 ),
397 'quiz_when_time_expires' => array(
398 'type' => 'radio',
399 'label' => __('When time expires', 'tutor'),
400 'default' => 'minutes',
401 'select_options' => false,
402 'options' => array(
403 'autosubmit' => __('The current quiz answers are submitted automatically.', 'tutor'),
404 'graceperiod' => __('The current quiz answers are submitted by students.', 'tutor'),
405 'autoabandon' => __('Attempts must be submitted before time expires, otherwise they will not be counted', 'tutor'),
406 ),
407 'desc' => __('Choose which action to follow when the quiz time expires.', 'tutor'),
408 ),
409 'quiz_attempts_allowed' => array(
410 'type' => 'number',
411 'label' => __('Attempts allowed', 'tutor'),
412 'default' => '10',
413 'desc' => __('The highest number of attempts students are allowed to take for a quiz. 0 means unlimited attempts.', 'tutor'),
414 ),
415 'quiz_grade_method' => array(
416 'type' => 'select',
417 'label' => __('Final grade calculation', 'tutor'),
418 'default' => 'minutes',
419 'select_options' => false,
420 'options' => array(
421 'highest_grade' => __('Highest Grade', 'tutor'),
422 'average_grade' => __('Average Grade', 'tutor'),
423 'first_attempt' => __('First Attempt', 'tutor'),
424 'last_attempt' => __('Last Attempt', 'tutor'),
425 ),
426 'desc' => __('When multiple attempts are allowed, which method should be used to calculate a student\'s final grade for the quiz.', 'tutor'),
427 ),
428 )
429 )
430 ),
431 ),
432 'instructors' => array(
433 'label' => __('Instructors', 'tutor'),
434 'sections' => array(
435 'general' => array(
436 'label' => __('Instructor Profile Settings', 'tutor'),
437 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
438 'fields' => array(
439 'enable_course_marketplace' => array(
440 'type' => 'checkbox',
441 'label' => __('Course Marketplace', 'tutor'),
442 'label_title' => __('Enable', 'tutor'),
443 'default' => '0',
444 'desc' => __('Allow multiple instructors to upload their courses.', 'tutor'),
445 ),
446 'instructor_register_page' => array(
447 'type' => 'select',
448 'label' => __('Instructor Registration Page', 'tutor'),
449 'default' => '0',
450 'options' => $pages,
451 'desc' => __('This page will be used to sign up new instructors.', 'tutor'),
452 ),
453 'instructor_can_publish_course' => array(
454 'type' => 'checkbox',
455 'label' => __('Allow publishing course', 'tutor'),
456 'label_title' => __('Enable', 'tutor'),
457 'default' => '0',
458 'desc' => __('Enable instructors to publish course directly. <strong>Do not select</strong> if admins want to review courses before publishing.', 'tutor'),
459 ),
460 'enable_become_instructor_btn' => array(
461 'type' => 'checkbox',
462 'label' => __('Become Instructor Button', 'tutor'),
463 'label_title' => __('Enable', 'tutor'),
464 'default' => '0',
465 'desc' => __('Uncheck this option to hide the button from student dashboard.', 'tutor'),
466 ),
467 ),
468 ),
469 ),
470 ),
471 'students' => array(
472 'label' => __('Students', 'tutor'),
473 'sections' => array(
474 'general' => array(
475 'label' => __('Student Profile settings', 'tutor'),
476 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
477 'fields' => array(
478 'student_register_page' => array(
479 'type' => 'select',
480 'label' => __('Student Registration Page', 'tutor'),
481 'default' => '0',
482 'options' => $pages,
483 'desc' => __('Choose the page for student registration page', 'tutor'),
484 ),
485 'students_own_review_show_at_profile' => array(
486 'type' => 'checkbox',
487 'label' => __('Show reviews on profile', 'tutor'),
488 'label_title' => __('Enable', 'tutor'),
489 'default' => '0',
490 'desc' => __('Enabling this will show the reviews written by each student on their profile', 'tutor')."<br />" .$student_url,
491 ),
492 'show_courses_completed_by_student' => array(
493 'type' => 'checkbox',
494 'label' => __('Show completed courses', 'tutor'),
495 'label_title' => __('Enable', 'tutor'),
496 'default' => '0',
497 'desc' => __('Completed courses will be shown on student profiles. <br/> For example, you can see this link-', 'tutor').$student_url,
498 ),
499 ),
500 ),
501 ),
502 ),
503 'tutor_earning' => array(
504 'label' => __('Earning', 'tutor'),
505 'sections' => array(
506 'general' => array(
507 'label' => __('Earning and commission allocation', 'tutor'),
508 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
509 'fields' => array(
510 'enable_tutor_earning' => array(
511 'type' => 'checkbox',
512 'label' => __('Earning', 'tutor'),
513 'label_title' => __('Enable', 'tutor'),
514 'default' => '0',
515 'desc' => __('If disabled, the Admin will receive 100% of the earning', 'tutor'),
516 ),
517 'earning_admin_commission' => array(
518 'type' => 'number',
519 'label' => __('Admin Commission Percentage', 'tutor'),
520 'default' => '20',
521 'desc' => __('Define the commission of the Admin from each sale.(after deducting fees)', 'tutor'),
522 ),
523 'earning_instructor_commission' => array(
524 'type' => 'number',
525 'label' => __('Instructor Commission Percentage', 'tutor'),
526 'default' => '80',
527 'desc' => __('Define the commission for instructors from each sale.(after deducting fees)', 'tutor'),
528 ),
529 'tutor_earning_fees' => array(
530 'type' => 'group_fields',
531 'label' => __('Fee Deduction', 'tutor'),
532 'desc' => __('Fees are charged from the entire sales amount. The remaining amount will be divided among admin and instructors.', 'tutor'),
533 'group_fields' => array(
534
535 'enable_fees_deducting' => array(
536 'type' => 'checkbox',
537 'label' => __('Enable', 'tutor'),
538 'default' => '0',
539 ),
540 'fees_name' => array(
541 'type' => 'text',
542 'label' => __('Fee Name', 'tutor'),
543 'default' => '',
544 ),
545 'fees_amount' => array(
546 'type' => 'number',
547 'label' => __('Fee Amount', 'tutor'),
548 'default' => '',
549 ),
550 'fees_type' => array(
551 'type' => 'select',
552 'default' => 'minutes',
553 'select_options' => false,
554 'options' => array(
555 '' => __('Select Fees Type', 'tutor'),
556 'percent' => __('Percent', 'tutor'),
557 'fixed' => __('Fixed', 'tutor'),
558 ),
559 ),
560
561 ),
562 ),
563 'statement_show_per_page' => array(
564 'type' => 'number',
565 'label' => __('Show Statement Per Page', 'tutor'),
566 'default' => '20',
567 'desc' => __('Define the number of statements to show.', 'tutor'),
568 ),
569 ),
570 ),
571 ),
572 ),
573 'tutor_withdraw' => array(
574 'label' => __('Withdraw', 'tutor'),
575 'sections' => array(
576 'general' => array(
577 'label' => __('Withdrawal Settings', 'tutor'),
578 'fields' => array(
579 'min_withdraw_amount' => array(
580 'type' => 'number',
581 'label' => __('Minimum Withdraw Amount', 'tutor'),
582 'default' => '80',
583 'desc' => __('Instructors should earn equal or above this amount to make a withdraw request.', 'tutor'),
584 ),
585 ),
586 ),
587
588 'withdraw_methods' => array(
589 'label' => __('Withdraw Methods', 'tutor'),
590 'desc' => __('Set withdraw settings', 'tutor'),
591 ),
592 ),
593 ),
594
595 'tutor_style' => array(
596 'label' => __('Style', 'tutor'),
597 'sections' => array(
598 'general' => array(
599 'label' => __('Color Style', 'tutor'),
600 'fields' => array(
601 'tutor_primary_color' => array(
602 'type' => 'color',
603 'label' => __('Primary Color', 'tutor'),
604 'default' => '',
605 ),
606 'tutor_primary_hover_color' => array(
607 'type' => 'color',
608 'label' => __('Primary Hover Color', 'tutor'),
609 'default' => '',
610 ),
611 'tutor_text_color' => array(
612 'type' => 'color',
613 'label' => __('Text color', 'tutor'),
614 'default' => '',
615 ),
616 'tutor_light_color' => array(
617 'type' => 'color',
618 'label' => __('Light color', 'tutor'),
619 'default' => '',
620 ),
621 ),
622 ),
623
624 ),
625 ),
626
627 'monetization' => array(
628 'label' => __('Monetization', 'tutor'),
629 'sections' => array(
630 'general' => array(
631 'label' => __('Monetization', 'tutor'),
632 'desc' => __('You can monetize your LMS website by selling courses in a various way.', 'tutor'),
633 'fields' => array(
634
635 'monetize_by' => array(
636 'type' => 'radio',
637 'label' => __('Monetize Option', 'tutor'),
638 'default' => 'free',
639 'select_options' => false,
640 'options' => apply_filters('tutor_monetization_options', array(
641 'free' => __('Disable Monetization', 'tutor'),
642 )),
643 'desc' => __('Select a monetization option to generate revenue by selling courses. Supports: WooCommerce, Easy Digital Downloads, Paid Memberships Pro', 'tutor'),
644 ),
645
646 )
647 )
648 ),
649 ),
650
651 );
652
653 $attrs = apply_filters('tutor/options/attr', $attr);
654 $extends = apply_filters('tutor/options/extend/attr', array());
655
656 if (tutils()->count($extends)){
657 foreach ($extends as $extend_key => $extend_option){
658 if (isset($attrs[$extend_key])&& tutils()->count($extend_option['sections']) ){
659 $sections = $attrs[$extend_key]['sections'];
660 $sections = array_merge($sections, $extend_option['sections']);
661 $attrs[$extend_key]['sections'] = $sections;
662 }
663 }
664 }
665
666 return $attrs;
667
668 }
669
670 /**
671 * @param array $field
672 *
673 * @return string
674 *
675 * Generate Option Field
676 */
677 public function generate_field($field = array()){
678 ob_start();
679 include tutor()->path.'views/options/option_field.php';
680 return ob_get_clean();
681 }
682
683 public function field_type($field = array()){
684 ob_start();
685 include tutor()->path."views/options/field-types/{$field['type']}.php";
686 return ob_get_clean();
687 }
688
689 public function generate(){
690 ob_start();
691 include tutor()->path.'views/options/options_generator.php';
692 return ob_get_clean();
693 }
694
695 }