PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 1.3.9
Tutor LMS – eLearning and online course solution v1.3.9
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 / Tutor.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_Widget.php 6 years ago Dashboard.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.php 6 years ago Question_Answers_List.php 6 years ago Quiz.php 6 years ago Quiz_Attempts_List.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
Tutor.php
605 lines
1 <?php
2 namespace TUTOR;
3
4 if ( ! defined( 'ABSPATH' ) )
5 exit;
6
7 final class Tutor{
8 public $version = TUTOR_VERSION;
9 public $path;
10 public $url;
11 public $basename;
12
13 /**
14 * The single instance of the class.
15 *
16 * @since v.1.2.0
17 */
18 protected static $_instance = null;
19
20 //Components
21 public $utils;
22 public $admin;
23 public $ajax;
24 public $options;
25 public $shortcode;
26
27 private $addons;
28 private $post_types;
29 private $taxonomies;
30 private $assets;
31 private $course;
32 private $lesson;
33 private $rewrite_rules;
34 private $template;
35 private $instructor;
36 private $student;
37 private $q_and_a;
38 private $quiz;
39 private $question;
40 private $tools;
41 private $user;
42 private $theme_compatibility;
43 private $gutenberg;
44
45 private $woocommerce;
46 private $edd;
47 private $withdraw;
48
49 private $course_widget;
50 private $upgrader;
51 private $dashboard;
52
53 /**
54 * @return null|Tutor
55 *
56 * Run the TUTOR
57 *
58 * @since 1.2.0
59 */
60 public static function instance() {
61 if ( is_null( self::$_instance ) ) {
62 self::$_instance = new self();
63 }
64 return self::$_instance;
65 }
66
67 function __construct() {
68
69 $this->path = plugin_dir_path(TUTOR_FILE);
70 $this->url = plugin_dir_url(TUTOR_FILE);
71 $this->basename = plugin_basename(TUTOR_FILE);
72
73 add_filter('wp_doing_ajax', array($this, 'wp_doing_ajax'));
74
75 /**
76 * Include Files
77 */
78 //add_action( 'init', array( $this, 'includes' ), 11 );
79 $this->includes();
80
81 /**
82 * Loading Autoloader
83 */
84
85 if ( function_exists( '__autoload' ) ) {
86 spl_autoload_register( '__autoload' );
87 }
88 spl_autoload_register(array($this, 'loader'));
89
90 do_action('tutor_before_load');
91
92 $this->addons = new Addons();
93 $this->post_types = new Post_types();
94 $this->taxonomies = new Taxonomies();
95 $this->assets = new Assets();
96 $this->admin = new Admin();
97 $this->ajax = new Ajax();
98 $this->options = new Options();
99 $this->shortcode = new Shortcode();
100 $this->course = new Course();
101 $this->lesson = new Lesson();
102 $this->rewrite_rules = new Rewrite_Rules();
103 $this->template = new Template();
104 $this->instructor = new Instructor();
105 $this->student = new Student();
106 $this->q_and_a = new Q_and_A();
107 $this->quiz = new Quiz();
108 $this->question = new Question();
109 $this->tools = new Tools();
110 $this->user = new User();
111 $this->theme_compatibility = new Theme_Compatibility();
112 $this->gutenberg = new Gutenberg();
113 $this->woocommerce = new WooCommerce();
114 $this->edd = new TutorEDD();
115 $this->withdraw = new Withdraw();
116 $this->course_widget = new Course_Widget();
117 $this->upgrader = new Upgrader();
118 $this->dashboard = new Dashboard();
119
120 /**
121 * Run Method
122 * @since v.1.2.0
123 */
124 $this->run();
125
126 do_action('tutor_loaded');
127
128 add_action( 'init', array( $this, 'init_action' ) );
129 }
130
131 /**
132 * @param $className
133 *
134 * Auto Load class and the files
135 */
136 private function loader($className) {
137 if ( ! class_exists($className)){
138 $className = preg_replace(
139 array('/([a-z])([A-Z])/', '/\\\/'),
140 array('$1$2', DIRECTORY_SEPARATOR),
141 $className
142 );
143
144 $className = str_replace('TUTOR'.DIRECTORY_SEPARATOR, 'classes'.DIRECTORY_SEPARATOR, $className);
145 $file_name = $this->path.$className.'.php';
146
147 if (file_exists($file_name) ) {
148 require_once $file_name;
149 }
150 }
151 }
152
153 public function includes(){
154 include tutor()->path.'includes/tutor-general-functions.php';
155 include tutor()->path.'includes/tutor-template-functions.php';
156 include tutor()->path.'includes/tutor-template-hook.php';
157 }
158
159 //Run the TUTOR right now
160 public function run(){
161 do_action('tutor_before_run');
162
163 register_activation_hook( TUTOR_FILE, array($this, 'tutor_activate' ) );
164 register_deactivation_hook(TUTOR_FILE, array($this, 'tutor_deactivation'));
165
166 do_action('tutor_after_run');
167 }
168
169 /**
170 * Tutor Action Via do_action
171 * @since 1.2.14
172 */
173 public function init_action(){
174 if (isset($_REQUEST['tutor_action'])){
175 do_action('tutor_action_'.$_REQUEST['tutor_action']);
176 }
177
178 }
179
180 /**
181 * Do some task during plugin activation
182 */
183 public function tutor_activate(){
184 $version = get_option('tutor_version');
185 //Save Option
186 if ( ! $version){
187 //Create Database
188 $this->create_database();
189
190 $options = self::default_options();
191 update_option('tutor_option', $options);
192
193 //Rewrite Flush
194 update_option('required_rewrite_flush', time());
195 self::manage_tutor_roles_and_permissions();
196
197 self::save_data();//Save initial Page
198 update_option('tutor_version', TUTOR_VERSION);
199 }
200
201 //Set Schedule
202 if (! wp_next_scheduled ( 'tutor_once_in_day_run_schedule' )) {
203 wp_schedule_event(time(), 'twicedaily', 'tutor_once_in_day_run_schedule');
204 }
205
206 /**
207 * Backward Compatibility for version < 1.2.0
208 */
209 if (version_compare(get_option('tutor_version'), '1.2.0', '<')){
210 /**
211 * Creating New Database
212 */
213 $this->create_withdraw_database();
214 //Update the tutor version
215 update_option('tutor_version', '1.2.0');
216 //Rewrite Flush
217 update_option('required_rewrite_flush', time());
218 }
219
220 /**
221 * Backward Compatibility to < 1.3.1 for make course plural
222 */
223 if (version_compare(get_option('tutor_version'), '1.3.1', '<')){
224 global $wpdb;
225
226 if ( ! get_option('is_course_post_type_updated')){
227 $wpdb->update($wpdb->posts, array('post_type' => 'courses'), array('post_type' => 'course'));
228 update_option('is_course_post_type_updated', true);
229 update_option('tutor_version', '1.3.1');
230 flush_rewrite_rules();
231 }
232 }
233
234 }
235
236 //Run task on deactivation
237 public function tutor_deactivation() {
238 wp_clear_scheduled_hook('tutor_once_in_day_run_schedule');
239 }
240
241 public function create_database(){
242 global $wpdb;
243
244 $charset_collate = $wpdb->get_charset_collate();
245
246 /**
247 * Table SQL
248 *
249 * {$wpdb->prefix}tutor_quiz_attempts
250 * {$wpdb->prefix}tutor_quiz_attempt_answers
251 * {$wpdb->prefix}tutor_quiz_questions
252 * {$wpdb->prefix}tutor_quiz_question_answers
253 * {$wpdb->prefix}tutor_earnings
254 * {$wpdb->prefix}tutor_withdraws
255 *
256 * @since v.1.0.0
257 */
258 $quiz_attempts_sql = "CREATE TABLE {$wpdb->prefix}tutor_quiz_attempts (
259 attempt_id int(11) NOT NULL AUTO_INCREMENT,
260 course_id int(11) DEFAULT NULL,
261 quiz_id int(11) DEFAULT NULL,
262 user_id int(11) DEFAULT NULL,
263 total_questions int(11) DEFAULT NULL,
264 total_answered_questions int(11) DEFAULT NULL,
265 total_marks decimal(9,2) DEFAULT NULL,
266 earned_marks decimal(9,2) DEFAULT NULL,
267 attempt_info text,
268 attempt_status varchar(50) DEFAULT NULL,
269 attempt_ip varchar(250) DEFAULT NULL,
270 attempt_started_at datetime DEFAULT NULL,
271 attempt_ended_at datetime DEFAULT NULL,
272 is_manually_reviewed int(1) DEFAULT NULL,
273 manually_reviewed_at datetime DEFAULT NULL,
274 PRIMARY KEY (attempt_id)
275 ) $charset_collate;";
276
277 $quiz_attempt_answers = "CREATE TABLE {$wpdb->prefix}tutor_quiz_attempt_answers (
278 attempt_answer_id int(11) NOT NULL AUTO_INCREMENT,
279 user_id int(11) DEFAULT NULL,
280 quiz_id int(11) DEFAULT NULL,
281 question_id int(11) DEFAULT NULL,
282 quiz_attempt_id int(11) DEFAULT NULL,
283 given_answer longtext,
284 question_mark decimal(8,2) DEFAULT NULL,
285 achieved_mark decimal(8,2) DEFAULT NULL,
286 minus_mark decimal(8,2) DEFAULT NULL,
287 is_correct tinyint(4) DEFAULT NULL,
288 PRIMARY KEY (attempt_answer_id)
289 ) $charset_collate;";
290
291 $tutor_quiz_questions = "CREATE TABLE {$wpdb->prefix}tutor_quiz_questions (
292 question_id int(11) NOT NULL AUTO_INCREMENT,
293 quiz_id int(11) DEFAULT NULL,
294 question_title text,
295 question_description longtext,
296 question_type varchar(50) DEFAULT NULL,
297 question_mark decimal(9,2) DEFAULT NULL,
298 question_settings longtext,
299 question_order int(11) DEFAULT NULL,
300 PRIMARY KEY (question_id)
301 ) $charset_collate;";
302
303 $tutor_quiz_question_answers = "CREATE TABLE {$wpdb->prefix}tutor_quiz_question_answers (
304 answer_id int(11) NOT NULL AUTO_INCREMENT,
305 belongs_question_id int(11) DEFAULT NULL,
306 belongs_question_type varchar(250) DEFAULT NULL,
307 answer_title text,
308 is_correct tinyint(4) DEFAULT NULL,
309 image_id int(11) DEFAULT NULL,
310 answer_two_gap_match text,
311 answer_view_format varchar(250) DEFAULT NULL,
312 answer_settings text,
313 answer_order int(11) DEFAULT '0',
314 PRIMARY KEY (answer_id)
315 ) $charset_collate;";
316
317 $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
318 earning_id int(11) NOT NULL AUTO_INCREMENT,
319 user_id int(11) DEFAULT NULL,
320 course_id int(11) DEFAULT NULL,
321 order_id int(11) DEFAULT NULL,
322 order_status varchar(50) DEFAULT NULL,
323 course_price_total decimal(16,2) DEFAULT NULL,
324 course_price_grand_total decimal(16,2) DEFAULT NULL,
325 instructor_amount decimal(16,2) DEFAULT NULL,
326 instructor_rate decimal(16,2) DEFAULT NULL,
327 admin_amount decimal(16,2) DEFAULT NULL,
328 admin_rate decimal(16,2) DEFAULT NULL,
329 commission_type varchar(20) DEFAULT NULL,
330 deduct_fees_amount decimal(16,2) DEFAULT NULL,
331 deduct_fees_name varchar(250) DEFAULT NULL,
332 deduct_fees_type varchar(20) DEFAULT NULL,
333 process_by varchar(20) DEFAULT NULL,
334 created_at datetime DEFAULT NULL,
335 PRIMARY KEY (earning_id)
336 ) $charset_collate;";
337
338 $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
339 withdraw_id int(11) NOT NULL AUTO_INCREMENT,
340 user_id int(11) DEFAULT NULL,
341 amount decimal(16,2) DEFAULT NULL,
342 method_data text DEFAULT NULL,
343 status varchar(50) DEFAULT NULL,
344 updated_at datetime DEFAULT NULL,
345 created_at datetime DEFAULT NULL,
346 PRIMARY KEY (withdraw_id)
347 ) $charset_collate;";
348
349 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
350 dbDelta( $quiz_attempts_sql );
351 dbDelta( $quiz_attempt_answers );
352 dbDelta( $tutor_quiz_questions );
353 dbDelta( $tutor_quiz_question_answers );
354 dbDelta( $earning_table );
355 dbDelta( $withdraw_table );
356 }
357
358 public static function manage_tutor_roles_and_permissions(){
359 /**
360 * Add role for instructor
361 */
362 $instructor_role = tutor()->instructor_role;
363
364 remove_role($instructor_role);
365 add_role( $instructor_role, __('Tutor Instructor', 'tutor'), array() );
366
367 $custom_post_type_permission = array(
368 //Manage Instructor
369 'manage_tutor_instructor',
370
371 //Tutor Posts Type Permission
372 'edit_tutor_course',
373 'read_tutor_course',
374 'delete_tutor_course',
375 'delete_tutor_courses',
376 'edit_tutor_courses',
377 'edit_others_tutor_courses',
378 'read_private_tutor_courses',
379 'edit_tutor_courses',
380
381 'edit_tutor_lesson',
382 'read_tutor_lesson',
383 'delete_tutor_lesson',
384 'delete_tutor_lessons',
385 'edit_tutor_lessons',
386 'edit_others_tutor_lessons',
387 'read_private_tutor_lessons',
388 'edit_tutor_lessons',
389 'publish_tutor_lessons',
390
391 'edit_tutor_quiz',
392 'read_tutor_quiz',
393 'delete_tutor_quiz',
394 'delete_tutor_quizzes',
395 'edit_tutor_quizzes',
396 'edit_others_tutor_quizzes',
397 'read_private_tutor_quizzes',
398 'edit_tutor_quizzes',
399 'publish_tutor_quizzes',
400
401 'edit_tutor_question',
402 'read_tutor_question',
403 'delete_tutor_question',
404 'delete_tutor_questions',
405 'edit_tutor_questions',
406 'edit_others_tutor_questions',
407 'publish_tutor_questions',
408 'read_private_tutor_questions',
409 'edit_tutor_questions',
410 );
411
412 $instructor = get_role( $instructor_role );
413 if ( $instructor ) {
414 $instructor_cap = array (
415 'edit_posts',
416 'read',
417 'upload_files',
418 );
419
420 $instructor_cap = array_merge($instructor_cap, $custom_post_type_permission);
421
422 $can_publish_course = (bool) tutor_utils()->get_option('instructor_can_publish_course');
423 if ($can_publish_course){
424 $instructor_cap[] = 'publish_tutor_courses';
425 }
426
427 foreach ($instructor_cap as $cap){
428 $instructor->add_cap( $cap );
429 }
430 }
431
432 $administrator = get_role( 'administrator' );
433 if ( $administrator ) {
434
435 $administrator_cap = array (
436 'manage_tutor',
437 );
438 $administrator_cap = array_merge($administrator_cap, $custom_post_type_permission);
439 $administrator_cap[] = 'publish_tutor_courses';
440
441 foreach ($administrator_cap as $cap){
442 $administrator->add_cap( $cap );
443 }
444 }
445
446 /**
447 * Add Instructor role to administrator
448 */
449 if (current_user_can('administrator')){
450 tutor_utils()->add_instructor_role(get_current_user_id());
451 }
452
453 }
454
455 /**
456 * Save data like page
457 */
458 public static function save_data(){
459 $student_dashboard_args = array(
460 'post_title' => __('Dashboard', 'tutor'),
461 'post_content' => '',
462 'post_type' => 'page',
463 'post_status' => 'publish',
464 );
465 $student_dashboard_page_id = wp_insert_post( $student_dashboard_args );
466 tutor_utils()->update_option('tutor_dashboard_page_id', $student_dashboard_page_id);
467
468 $student_registration_args = array(
469 'post_title' => __('Student Registration', 'tutor'),
470 'post_content' => '[tutor_student_registration_form]',
471 'post_type' => 'page',
472 'post_status' => 'publish',
473 );
474 $student_register_page_id = wp_insert_post( $student_registration_args );
475 tutor_utils()->update_option('student_register_page', $student_register_page_id);
476
477 $instructor_registration_args = array(
478 'post_title' => __('Instructor Registration', 'tutor'),
479 'post_content' => '[tutor_instructor_registration_form]',
480 'post_type' => 'page',
481 'post_status' => 'publish',
482 );
483 $instructor_registration_id = wp_insert_post( $instructor_registration_args );
484 tutor_utils()->update_option('instructor_register_page', $instructor_registration_id);
485 }
486
487 public static function default_options(){
488 $options = array (
489 'load_tutor_css' => '1',
490 'load_tutor_js' => '1',
491 'course_allow_upload_private_files' => '1',
492 'display_course_instructors' => '1',
493 'enable_q_and_a_on_course' => '1',
494 'courses_col_per_row' => '3',
495 'courses_per_page' => '3',
496 'lesson_permalink_base' => 'lesson',
497 'quiz_time_limit' =>
498 array (
499 'value' => '0',
500 'time' => 'minutes',
501 ),
502 'quiz_when_time_expires' => 'autosubmit',
503 'quiz_attempts_allowed' => '10',
504 'quiz_grade_method' => 'highest_grade',
505 'enable_public_profile' => '1',
506 'email_to_students' =>
507 array (
508 'quiz_completed' => '1',
509 'completed_course' => '1',
510 ),
511 'email_to_instructors' =>
512 array (
513 'a_student_enrolled_in_course' => '1',
514 'a_student_completed_course' => '1',
515 'a_student_completed_lesson' => '1',
516 'a_student_placed_question' => '1',
517 ),
518 'email_from_name' => get_option('blogname'),
519 'email_from_address' => get_option('admin_email'),
520 'email_footer_text' => '',
521 );
522 return $options;
523 }
524
525
526 /**
527 * Create withdraw database
528 *
529 * @since v.1.2.0
530 */
531 public function create_withdraw_database(){
532 global $wpdb;
533
534 $charset_collate = $wpdb->get_charset_collate();
535
536 /**
537 * Table SQL
538 *
539 * {$wpdb->prefix}tutor_earnings
540 * {$wpdb->prefix}tutor_withdraws
541 *
542 * @since v.1.2.0
543 */
544
545 $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
546 earning_id int(11) NOT NULL AUTO_INCREMENT,
547 user_id int(11) DEFAULT NULL,
548 course_id int(11) DEFAULT NULL,
549 order_id int(11) DEFAULT NULL,
550 order_status varchar(50) DEFAULT NULL,
551 course_price_total decimal(16,2) DEFAULT NULL,
552 course_price_grand_total decimal(16,2) DEFAULT NULL,
553 instructor_amount decimal(16,2) DEFAULT NULL,
554 instructor_rate decimal(16,2) DEFAULT NULL,
555 admin_amount decimal(16,2) DEFAULT NULL,
556 admin_rate decimal(16,2) DEFAULT NULL,
557 commission_type varchar(20) DEFAULT NULL,
558 deduct_fees_amount decimal(16,2) DEFAULT NULL,
559 deduct_fees_name varchar(250) DEFAULT NULL,
560 deduct_fees_type varchar(20) DEFAULT NULL,
561 process_by varchar(20) DEFAULT NULL,
562 created_at datetime DEFAULT NULL,
563 PRIMARY KEY (earning_id)
564 ) $charset_collate;";
565
566 $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
567 withdraw_id int(11) NOT NULL AUTO_INCREMENT,
568 user_id int(11) DEFAULT NULL,
569 amount decimal(16,2) DEFAULT NULL,
570 method_data text DEFAULT NULL,
571 status varchar(50) DEFAULT NULL,
572 updated_at datetime DEFAULT NULL,
573 created_at datetime DEFAULT NULL,
574 PRIMARY KEY (withdraw_id)
575 ) $charset_collate;";
576
577 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
578 dbDelta( $earning_table );
579 dbDelta( $withdraw_table );
580
581 /**
582 * Setting previous dashboard to new dashboard
583 */
584 $previous_dashboard_page_id = (int) tutor_utils()->get_option('student_dashboard');
585 tutor_utils()->update_option('tutor_dashboard_page_id', $previous_dashboard_page_id);
586 }
587
588 /**
589 * @param $bool
590 *
591 * @return bool
592 *
593 * Filter the wp_doing_ajax from tutor requests to get advanced advantages from Tutor
594 *
595 * @since v.1.3.4
596 */
597 public function wp_doing_ajax($bool){
598 if (isset($_REQUEST['tutor_ajax_action'])){
599 return true;
600 }
601 return $bool;
602 }
603
604
605 }