PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 1.6.6
Tutor LMS – eLearning and online course solution v1.6.6
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 5 years ago Admin.php 5 years ago Ajax.php 5 years ago Assets.php 5 years ago Course.php 5 years ago Course_Settings_Tabs.php 5 years ago Course_Widget.php 5 years ago Dashboard.php 5 years ago Email.php 5 years ago FormHandler.php 5 years ago Frontend.php 5 years ago Gutenberg.php 5 years ago Instructor.php 5 years ago Instructors_List.php 5 years ago Lesson.php 5 years ago Options.php 5 years ago Post_types.php 5 years ago Q_and_A.php 5 years ago Question_Answers_List.php 5 years ago Quiz.php 5 years ago Quiz_Attempts_List.php 5 years ago RestAPI.php 5 years ago Rewrite_Rules.php 5 years ago Shortcode.php 5 years ago Student.php 5 years ago Students_List.php 5 years ago Taxonomies.php 5 years ago Template.php 5 years ago Theme_Compatibility.php 5 years ago Tools.php 5 years ago Tutor.php 5 years ago TutorEDD.php 5 years ago Tutor_Base.php 5 years ago Tutor_List_Table.php 5 years ago Tutor_Setup.php 5 years ago Upgrader.php 5 years ago User.php 5 years ago Utils.php 5 years ago Video_Stream.php 5 years ago Withdraw.php 5 years ago Withdraw_Requests_List.php 5 years ago WooCommerce.php 5 years ago
Options.php
726 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 'enable_profile_completion' => array(
99 'type' => 'checkbox',
100 'label' => __('Profile Completion', 'tutor'),
101 'label_title' => __('Enable', 'tutor'),
102 'default' => '0',
103 'desc' => __('Enabling this feature will show a notification bar to students and instructors to complete their profile information', 'tutor'),
104 ),
105 'load_tutor_css' => array(
106 'type' => 'checkbox',
107 'label' => __('Load Tutor CSS', 'tutor'),
108 'label_title' => __('Enable', 'tutor'),
109 'default' => '0',
110 'desc' => __('If your theme has its own styling, then you can turn it off to load CSS from the plugin directory', 'tutor'),
111 ),
112 'load_tutor_js' => array(
113 'type' => 'checkbox',
114 'label' => __('Load Tutor JavaScript', 'tutor'),
115 'label_title' => __('Enable', 'tutor'),
116 'default' => '0',
117 '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'),
118 ),
119 'student_must_login_to_view_course' => array(
120 'type' => 'checkbox',
121 'label' => __('Course Visibility', 'tutor'),
122 'label_title' => __('Logged in only', 'tutor'),
123 'desc' => __('Students must be logged in to view course', 'tutor'),
124 ),
125 'delete_on_uninstall' => array(
126 'type' => 'checkbox',
127 'label' => __('Erase upon uninstallation', 'tutor'),
128 'label_title' => __('Enable', 'tutor'),
129 'desc' => __('Delete all data during uninstallation', 'tutor'),
130 ),
131
132 'enable_spotlight_mode' => array(
133 'type' => 'checkbox',
134 'label' => __('Spotlight mode', 'tutor'),
135 'label_title' => __('Enable', 'tutor'),
136 'default' => '0',
137 'desc' => __('This will hide the header and the footer and enable spotlight (full screen) mode when students view lessons.', 'tutor'),
138 ),
139 'disable_default_player_youtube' => array(
140 'type' => 'checkbox',
141 'label' => __('YouTube Player', 'tutor'),
142 'label_title' => __('Enable', 'tutor'),
143 'default' => '0',
144 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
145 ),
146 'disable_default_player_vimeo' => array(
147 'type' => 'checkbox',
148 'label' => __('Vimeo Player', 'tutor'),
149 'label_title' => __('Enable', 'tutor'),
150 'default' => '0',
151 'desc' => __('Disable this option to use Tutor LMS video player.', 'tutor'),
152 ),
153 'pagination_per_page' => array(
154 'type' => 'number',
155 'label' => __('Pagination', 'tutor'),
156 'default' => '20',
157 'desc' => __('Number of items you would like displayed "per page" in the pagination', 'tutor'),
158 ),
159 'enable_tutor_maintenance_mode' => array(
160 'type' => 'checkbox',
161 'label' => __('Maintenance Mode', 'tutor'),
162 'label_title' => __('Enable', 'tutor'),
163 'default' => '0',
164 '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'),
165 ),
166 'hide_admin_bar_for_users' => array(
167 'type' => 'checkbox',
168 'label' => __('Frontend Admin Bar', 'tutor'),
169 'label_title' => __('Hide', 'tutor'),
170 'default' => '0',
171 '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'),
172 ),
173 'login_error_message' => array(
174 'type' => 'text',
175 'label' => __('Error message for wrong login credentials', 'tutor'),
176 'default' => 'Incorrect username or password.',
177 'desc' => __('Login error message displayed when the user puts wrong login credentials.', 'tutor'),
178 ),
179 )
180 )
181 ),
182 ),
183 'course' => array(
184 'label' => __('Course', 'tutor'),
185 'sections' => array(
186 'general' => array(
187 'label' => __('General', 'tutor'),
188 'desc' => __('Course Settings', 'tutor'),
189 'fields' => array(
190 'enable_gutenberg_course_edit' => array(
191 'type' => 'checkbox',
192 'label' => __('Gutenberg Editor', 'tutor'),
193 'label_title' => __('Enable', 'tutor'),
194 'desc' => __('Use Gutenberg editor on course description area.', 'tutor'),
195 ),
196 'hide_course_from_shop_page' => array(
197 'type' => 'checkbox',
198 'label' => __('Enable / Disable', 'tutor'),
199 'label_title' => __('Hide course products from shop page', 'tutor'),
200 'desc' => __('Enabling this feature will be removed course products from the shop page.', 'tutor'),
201 ),
202 'course_completion_process' => array(
203 'type' => 'radio',
204 'label' => __('Course Completion Process', 'tutor'),
205 'default' => 'flexible',
206 'select_options' => false,
207 'options' => array(
208 'flexible' => __('Flexible', 'tutor'),
209 'strict' => __('Strict Mode', 'tutor'),
210 ),
211 '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'),
212 ),
213 ),
214 ),
215 'archive' => array(
216 'label' => __('Archive', 'tutor'),
217 'desc' => __('Course Archive Settings', 'tutor'),
218 'fields' => array(
219 'course_archive_page' => array(
220 'type' => 'select',
221 'label' => __('Course Archive Page', 'tutor'),
222 'default' => '0',
223 'options' => $pages,
224 'desc' => __('This page will be used to list all the published courses.', 'tutor'),
225 ),
226 'courses_col_per_row' => array(
227 'type' => 'slider',
228 'label' => __('Column Per Row', 'tutor'),
229 'default' => '4',
230 'options' => array('min'=> 1, 'max' => 6),
231 'desc' => __('Define how many column you want to use to display courses.', 'tutor'),
232 ),
233 'courses_per_page' => array(
234 'type' => 'slider',
235 'label' => __('Courses Per Page', 'tutor'),
236 'default' => '12',
237 'options' => array('min'=> 1, 'max' => 20),
238 'desc' => __('Define how many courses you want to show per page', 'tutor'),
239 ),
240 ),
241 ),
242 'enable_disable' => array(
243 'label' => __('Enable / Disable', 'tutor'),
244 'desc' => __('Course Display Settings', 'tutor'),
245 'fields' => array(
246 'display_course_instructors' => array(
247 'type' => 'checkbox',
248 'label' => __('Display Instructor Info', 'tutor'),
249 'label_title' => __('Enable', 'tutor'),
250 'desc' => __('Show instructor bio on each page', 'tutor'),
251 ),
252 'enable_q_and_a_on_course' => array(
253 'type' => 'checkbox',
254 'label' => __('Question and Answer', 'tutor'),
255 'label_title' => __('Enable','tutor'),
256 'default' => '0',
257 'desc' => __('Enabling this feature will add a Q&amp;A section on every course.', 'tutor'),
258 ),
259 'disable_course_author' => array(
260 'type' => 'checkbox',
261 'label' => __('Course Author', 'tutor'),
262 'label_title' => __('Disable','tutor'),
263 'default' => '0',
264 'desc' => __('Disabling this feature will be removed course author name from the course page.', 'tutor'),
265 ),
266 'disable_course_level' => array(
267 'type' => 'checkbox',
268 'label' => __('Course Level', 'tutor'),
269 'label_title' => __('Disable','tutor'),
270 'default' => '0',
271 'desc' => __('Disabling this feature will be removed course level from the course page.', 'tutor'),
272 ),
273 'disable_course_share' => array(
274 'type' => 'checkbox',
275 'label' => __('Course Share', 'tutor'),
276 'label_title' => __('Disable','tutor'),
277 'default' => '0',
278 'desc' => __('Disabling this feature will be removed course share option from the course page.', 'tutor'),
279 ),
280 'disable_course_duration' => array(
281 'type' => 'checkbox',
282 'label' => __('Course Duration', 'tutor'),
283 'label_title' => __('Disable','tutor'),
284 'default' => '0',
285 'desc' => __('Disabling this feature will be removed course duration from the course page.', 'tutor'),
286 ),
287 'disable_course_total_enrolled' => array(
288 'type' => 'checkbox',
289 'label' => __('Course Total Enrolled', 'tutor'),
290 'label_title' => __('Disable','tutor'),
291 'default' => '0',
292 'desc' => __('Disabling this feature will be removed course total enrolled from the course page.', 'tutor'),
293 ),
294 'disable_course_update_date' => array(
295 'type' => 'checkbox',
296 'label' => __('Course Update Date', 'tutor'),
297 'label_title' => __('Disable','tutor'),
298 'default' => '0',
299 'desc' => __('Disabling this feature will be removed course update date from the course page.', 'tutor'),
300 ),
301 'disable_course_progress_bar' => array(
302 'type' => 'checkbox',
303 'label' => __('Course Progress Bar', 'tutor'),
304 'label_title' => __('Disable','tutor'),
305 'default' => '0',
306 'desc' => __('Disabling this feature will be removed completing progress bar from the course page.', 'tutor'),
307 ),
308 'disable_course_material' => array(
309 'type' => 'checkbox',
310 'label' => __('Course Material', 'tutor'),
311 'label_title' => __('Disable','tutor'),
312 'default' => '0',
313 'desc' => __('Disabling this feature will be removed course material from the course page.', 'tutor'),
314 ),
315 'disable_course_about' => array(
316 'type' => 'checkbox',
317 'label' => __('Course About', 'tutor'),
318 'label_title' => __('Disable','tutor'),
319 'default' => '0',
320 'desc' => __('Disabling this feature will be removed course about from the course page.', 'tutor'),
321 ),
322 'disable_course_description' => array(
323 'type' => 'checkbox',
324 'label' => __('Course Description', 'tutor'),
325 'label_title' => __('Disable','tutor'),
326 'default' => '0',
327 'desc' => __('Disabling this feature will be removed course description from the course page.', 'tutor'),
328 ),
329 'disable_course_benefits' => array(
330 'type' => 'checkbox',
331 'label' => __('Course Benefits', 'tutor'),
332 'label_title' => __('Disable','tutor'),
333 'default' => '0',
334 'desc' => __('Disabling this feature will be removed course benefits from the course page.', 'tutor'),
335 ),
336 'disable_course_requirements' => array(
337 'type' => 'checkbox',
338 'label' => __('Course Requirements', 'tutor'),
339 'label_title' => __('Disable','tutor'),
340 'default' => '0',
341 'desc' => __('Disabling this feature will be removed course requirements from the course page.', 'tutor'),
342 ),
343 'disable_course_target_audience' => array(
344 'type' => 'checkbox',
345 'label' => __('Course Target Audience', 'tutor'),
346 'label_title' => __('Disable','tutor'),
347 'default' => '0',
348 'desc' => __('Disabling this feature will be removed course target audience from the course page.', 'tutor'),
349 ),
350 'disable_course_announcements' => array(
351 'type' => 'checkbox',
352 'label' => __('Course Announcements', 'tutor'),
353 'label_title' => __('Disable','tutor'),
354 'default' => '0',
355 'desc' => __('Disabling this feature will be removed course announcements from the course page.', 'tutor'),
356 ),
357 'disable_course_review' => array(
358 'type' => 'checkbox',
359 'label' => __('Course Review', 'tutor'),
360 'label_title' => __('Disable','tutor'),
361 'default' => '0',
362 'desc' => __('Disabling this feature will be removed course review system from the course page.', 'tutor'),
363 ),
364 ),
365 ),
366 ),
367 ),
368 'lesson' => array(
369 'label' => __('Lessons', 'tutor'),
370 'sections' => array(
371 'lesson_settings' => array(
372 'label' => __('Lesson Settings', 'tutor'),
373 'desc' => __('Lesson settings will be here', 'tutor'),
374 'fields' => array(
375 'enable_lesson_classic_editor' => array(
376 'type' => 'checkbox',
377 'label' => __('Classic Editor', 'tutor'),
378 'label_title' => __('Enable', 'tutor'),
379 'desc' => __('Enable classic editor to get full support of any editor/page builder.', 'tutor'),
380 ),
381 'autoload_next_course_content' => array(
382 'type' => 'checkbox',
383 'label' => __('Enable / Disable', 'tutor'),
384 'label_title' => __('Automatically load next course content.', 'tutor'),
385 'desc' => __('Enabling this feature will be load next course content automatically after finishing current video.', 'tutor'),
386 ),
387 'lesson_permalink_base' => array(
388 'type' => 'text',
389 'label' => __('Lesson Permalink Base', 'tutor'),
390 'default' => 'lessons',
391 'desc' => $lesson_url,
392 ),
393 ),
394 ),
395
396 ),
397 ),
398 'quiz' => array(
399 'label' => __('Quiz', 'tutor'),
400 'sections' => array(
401 'general' => array(
402 'label' => __('Quiz', 'tutor'),
403 'desc' => __('The values you set here define the default values that are used in the settings form when you create a new quiz.', 'tutor'),
404 'fields' => array(
405 'quiz_time_limit' => array(
406 'type' => 'group_fields',
407 'label' => __('Time Limit', 'tutor'),
408 'desc' => __('0 means unlimited time.', 'tutor'),
409 'group_fields' => array(
410 'value' => array(
411 'type' => 'text',
412 'default' => '0',
413 ),
414 'time' => array(
415 'type' => 'select',
416 'default' => 'minutes',
417 'select_options' => false,
418 'options' => array(
419 'weeks' => __('Weeks', 'tutor'),
420 'days' => __('Days', 'tutor'),
421 'hours' => __('Hours', 'tutor'),
422 'minutes' => __('Minutes', 'tutor'),
423 'seconds' => __('Seconds', 'tutor'),
424 ),
425 ),
426 ),
427 ),
428 'quiz_when_time_expires' => array(
429 'type' => 'radio',
430 'label' => __('When time expires', 'tutor'),
431 'default' => 'minutes',
432 'select_options' => false,
433 'options' => array(
434 'autosubmit' => __('The current quiz answers are submitted automatically.', 'tutor'),
435 'graceperiod' => __('The current quiz answers are submitted by students.', 'tutor'),
436 'autoabandon' => __('Attempts must be submitted before time expires, otherwise they will not be counted', 'tutor'),
437 ),
438 'desc' => __('Choose which action to follow when the quiz time expires.', 'tutor'),
439 ),
440 'quiz_attempts_allowed' => array(
441 'type' => 'number',
442 'label' => __('Attempts allowed', 'tutor'),
443 'default' => '10',
444 'desc' => __('The highest number of attempts students are allowed to take for a quiz. 0 means unlimited attempts.', 'tutor'),
445 ),
446 'quiz_grade_method' => array(
447 'type' => 'select',
448 'label' => __('Final grade calculation', 'tutor'),
449 'default' => 'minutes',
450 'select_options' => false,
451 'options' => array(
452 'highest_grade' => __('Highest Grade', 'tutor'),
453 'average_grade' => __('Average Grade', 'tutor'),
454 'first_attempt' => __('First Attempt', 'tutor'),
455 'last_attempt' => __('Last Attempt', 'tutor'),
456 ),
457 'desc' => __('When multiple attempts are allowed, which method should be used to calculate a student\'s final grade for the quiz.', 'tutor'),
458 ),
459 )
460 )
461 ),
462 ),
463 'instructors' => array(
464 'label' => __('Instructors', 'tutor'),
465 'sections' => array(
466 'general' => array(
467 'label' => __('Instructor Profile Settings', 'tutor'),
468 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
469 'fields' => array(
470 'enable_course_marketplace' => array(
471 'type' => 'checkbox',
472 'label' => __('Course Marketplace', 'tutor'),
473 'label_title' => __('Enable', 'tutor'),
474 'default' => '0',
475 'desc' => __('Allow multiple instructors to upload their courses.', 'tutor'),
476 ),
477 'instructor_register_page' => array(
478 'type' => 'select',
479 'label' => __('Instructor Registration Page', 'tutor'),
480 'default' => '0',
481 'options' => $pages,
482 'desc' => __('This page will be used to sign up new instructors.', 'tutor'),
483 ),
484 'instructor_can_publish_course' => array(
485 'type' => 'checkbox',
486 'label' => __('Allow publishing course', 'tutor'),
487 'label_title' => __('Enable', 'tutor'),
488 'default' => '0',
489 'desc' => __('Enable instructors to publish course directly. <strong>Do not select</strong> if admins want to review courses before publishing.', 'tutor'),
490 ),
491 'enable_become_instructor_btn' => array(
492 'type' => 'checkbox',
493 'label' => __('Become Instructor Button', 'tutor'),
494 'label_title' => __('Enable', 'tutor'),
495 'default' => '0',
496 'desc' => __('Uncheck this option to hide the button from student dashboard.', 'tutor'),
497 ),
498 ),
499 ),
500 ),
501 ),
502 'students' => array(
503 'label' => __('Students', 'tutor'),
504 'sections' => array(
505 'general' => array(
506 'label' => __('Student Profile settings', 'tutor'),
507 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
508 'fields' => array(
509 'student_register_page' => array(
510 'type' => 'select',
511 'label' => __('Student Registration Page', 'tutor'),
512 'default' => '0',
513 'options' => $pages,
514 'desc' => __('Choose the page for student registration page', 'tutor'),
515 ),
516 'students_own_review_show_at_profile' => array(
517 'type' => 'checkbox',
518 'label' => __('Show reviews on profile', 'tutor'),
519 'label_title' => __('Enable', 'tutor'),
520 'default' => '0',
521 'desc' => __('Enabling this will show the reviews written by each student on their profile', 'tutor')."<br />" .$student_url,
522 ),
523 'show_courses_completed_by_student' => array(
524 'type' => 'checkbox',
525 'label' => __('Show completed courses', 'tutor'),
526 'label_title' => __('Enable', 'tutor'),
527 'default' => '0',
528 'desc' => __('Completed courses will be shown on student profiles. <br/> For example, you can see this link-', 'tutor').$student_url,
529 ),
530 ),
531 ),
532 ),
533 ),
534 'tutor_earning' => array(
535 'label' => __('Earning', 'tutor'),
536 'sections' => array(
537 'general' => array(
538 'label' => __('Earning and commission allocation', 'tutor'),
539 'desc' => __('Enable Disable Option to on/off notification on various event', 'tutor'),
540 'fields' => array(
541 'enable_tutor_earning' => array(
542 'type' => 'checkbox',
543 'label' => __('Earning', 'tutor'),
544 'label_title' => __('Enable', 'tutor'),
545 'default' => '0',
546 'desc' => __('If disabled, the Admin will receive 100% of the earning', 'tutor'),
547 ),
548 'earning_admin_commission' => array(
549 'type' => 'number',
550 'label' => __('Admin Commission Percentage', 'tutor'),
551 'default' => '0',
552 'desc' => __('Define the commission of the Admin from each sale.(after deducting fees)', 'tutor'),
553 ),
554 'earning_instructor_commission' => array(
555 'type' => 'number',
556 'label' => __('Instructor Commission Percentage', 'tutor'),
557 'default' => '0',
558 'desc' => __('Define the commission for instructors from each sale.(after deducting fees)', 'tutor'),
559 ),
560 'tutor_earning_fees' => array(
561 'type' => 'group_fields',
562 'label' => __('Fee Deduction', 'tutor'),
563 'desc' => __('Fees are charged from the entire sales amount. The remaining amount will be divided among admin and instructors.', 'tutor'),
564 'group_fields' => array(
565
566 'enable_fees_deducting' => array(
567 'type' => 'checkbox',
568 'label' => __('Enable', 'tutor'),
569 'default' => '0',
570 ),
571 'fees_name' => array(
572 'type' => 'text',
573 'label' => __('Fee Name', 'tutor'),
574 'default' => '',
575 ),
576 'fees_amount' => array(
577 'type' => 'number',
578 'label' => __('Fee Amount', 'tutor'),
579 'default' => '',
580 ),
581 'fees_type' => array(
582 'type' => 'select',
583 'default' => 'minutes',
584 'select_options' => false,
585 'options' => array(
586 '' => __('Select Fees Type', 'tutor'),
587 'percent' => __('Percent', 'tutor'),
588 'fixed' => __('Fixed', 'tutor'),
589 ),
590 ),
591
592 ),
593 ),
594 'statement_show_per_page' => array(
595 'type' => 'number',
596 'label' => __('Show Statement Per Page', 'tutor'),
597 'default' => '20',
598 'desc' => __('Define the number of statements to show.', 'tutor'),
599 ),
600 ),
601 ),
602 ),
603 ),
604 'tutor_withdraw' => array(
605 'label' => __('Withdrawal', 'tutor'),
606 'sections' => array(
607 'general' => array(
608 'label' => __('Withdrawal Settings', 'tutor'),
609 'fields' => array(
610 'min_withdraw_amount' => array(
611 'type' => 'number',
612 'label' => __('Minimum Withdraw Amount', 'tutor'),
613 'default' => '80',
614 'desc' => __('Instructors should earn equal or above this amount to make a withdraw request.', 'tutor'),
615 ),
616 ),
617 ),
618
619 'withdraw_methods' => array(
620 'label' => __('Withdraw Methods', 'tutor'),
621 'desc' => __('Set withdraw settings', 'tutor'),
622 ),
623 ),
624 ),
625
626 'tutor_style' => array(
627 'label' => __('Style', 'tutor'),
628 'sections' => array(
629 'general' => array(
630 'label' => __('Color Style', 'tutor'),
631 'fields' => array(
632 'tutor_primary_color' => array(
633 'type' => 'color',
634 'label' => __('Primary Color', 'tutor'),
635 'default' => '',
636 ),
637 'tutor_primary_hover_color' => array(
638 'type' => 'color',
639 'label' => __('Primary Hover Color', 'tutor'),
640 'default' => '',
641 ),
642 'tutor_text_color' => array(
643 'type' => 'color',
644 'label' => __('Text color', 'tutor'),
645 'default' => '',
646 ),
647 'tutor_light_color' => array(
648 'type' => 'color',
649 'label' => __('Light color', 'tutor'),
650 'default' => '',
651 ),
652 ),
653 ),
654
655 ),
656 ),
657
658 'monetization' => array(
659 'label' => __('Monetization', 'tutor'),
660 'sections' => array(
661 'general' => array(
662 'label' => __('Monetization', 'tutor'),
663 'desc' => __('You can monetize your LMS website by selling courses in a various way.', 'tutor'),
664 'fields' => array(
665
666 'monetize_by' => array(
667 'type' => 'radio',
668 'label' => __('Monetize Option', 'tutor'),
669 'default' => 'free',
670 'select_options' => false,
671 'options' => apply_filters('tutor_monetization_options', array(
672 'free' => __('Disable Monetization', 'tutor'),
673 )),
674 'desc' => __('Select a monetization option to generate revenue by selling courses. Supports: WooCommerce, Easy Digital Downloads, Paid Memberships Pro', 'tutor'),
675 ),
676
677 )
678 )
679 ),
680 ),
681
682 );
683
684 $attrs = apply_filters('tutor/options/attr', $attr);
685 $extends = apply_filters('tutor/options/extend/attr', array());
686
687 if (tutils()->count($extends)){
688 foreach ($extends as $extend_key => $extend_option){
689 if (isset($attrs[$extend_key])&& tutils()->count($extend_option['sections']) ){
690 $sections = $attrs[$extend_key]['sections'];
691 $sections = array_merge($sections, $extend_option['sections']);
692 $attrs[$extend_key]['sections'] = $sections;
693 }
694 }
695 }
696
697 return $attrs;
698
699 }
700
701 /**
702 * @param array $field
703 *
704 * @return string
705 *
706 * Generate Option Field
707 */
708 public function generate_field($field = array()){
709 ob_start();
710 include tutor()->path.'views/options/option_field.php';
711 return ob_get_clean();
712 }
713
714 public function field_type($field = array()){
715 ob_start();
716 include tutor()->path."views/options/field-types/{$field['type']}.php";
717 return ob_get_clean();
718 }
719
720 public function generate(){
721 ob_start();
722 include tutor()->path.'views/options/options_generator.php';
723 return ob_get_clean();
724 }
725
726 }