@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
3 | 5 | /** |
4 | 6 | * The Template for displaying the my course page data. |
5 | 7 | * |
@@ -28,7 +28,10 @@ |
||
28 | 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
29 | 29 | */ |
30 | 30 | |
31 | - if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
31 | + if ( ! defined( 'ABSPATH' ) ) { |
|
32 | + exit; |
|
33 | + } |
|
34 | + // Exit if accessed directly |
|
32 | 35 | |
33 | 36 | require_once( 'includes/class-sensei-autoloader.php' ); |
34 | 37 | require_once( 'includes/lib/woo-functions.php' ); |
@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | /** |
4 | 7 | * |
5 | 8 | * Renders the [sensei_courses] shortcode |
@@ -77,7 +80,7 @@ discard block |
||
77 | 80 | |
78 | 81 | $this->order = 'ASC'; |
79 | 82 | |
80 | - }else{ |
|
83 | + } else{ |
|
81 | 84 | |
82 | 85 | // for everything else use the value passed or the default DESC |
83 | 86 | $this->order = isset( $attributes['order'] ) ? $attributes['order'] : 'DESC'; |
@@ -139,7 +142,7 @@ discard block |
||
139 | 142 | $teacher_query_by = 'author__in'; |
140 | 143 | $this->teacher = $teachers; |
141 | 144 | |
142 | - }else{ |
|
145 | + } else{ |
|
143 | 146 | // when users passed in a single teacher value |
144 | 147 | $teacher_query_by = is_numeric( $this->teacher )? 'author':'author_name'; |
145 | 148 |
@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | /** |
4 | 7 | * This class is loaded int WP by the shortcode loader class. |
5 | 8 | * |
@@ -75,7 +78,7 @@ discard block |
||
75 | 78 | |
76 | 79 | $this->order = 'ASC'; |
77 | 80 | |
78 | - }else{ |
|
81 | + } else{ |
|
79 | 82 | |
80 | 83 | // for everything else use the value passed or the default DESC |
81 | 84 | $this->order = isset( $attributes['order'] ) ? $attributes['order'] : 'ASC'; |
@@ -121,11 +124,11 @@ discard block |
||
121 | 124 | $included_courses = $completed_ids; |
122 | 125 | |
123 | 126 | |
124 | - }elseif( 'active'==$this->status ){ |
|
127 | + } elseif( 'active'==$this->status ){ |
|
125 | 128 | |
126 | 129 | $included_courses = $active_ids; |
127 | 130 | |
128 | - }else{ // all courses |
|
131 | + } else{ // all courses |
|
129 | 132 | |
130 | 133 | if( empty( $completed_ids ) ){ |
131 | 134 | |
@@ -142,7 +145,7 @@ discard block |
||
142 | 145 | |
143 | 146 | $included_courses = array('-1000'); // don't show any courses |
144 | 147 | |
145 | - }else{ |
|
148 | + } else{ |
|
146 | 149 | $included_courses = Sensei_Utils::array_zip_merge( $active_ids, $completed_ids ); |
147 | 150 | } |
148 | 151 |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // security check |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// security check |
|
3 | 6 | /** |
4 | 7 | * Sensei Shortcode Loader Class |
5 | 8 | * |
@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | /** |
4 | 7 | * |
5 | 8 | * Renders the [sensei_teachers] shortcode. Will show a list of teachers |
@@ -149,7 +152,7 @@ discard block |
||
149 | 152 | // exclude this user as it is already in the list |
150 | 153 | unset( $users[ $index ] ); |
151 | 154 | |
152 | - }else{ |
|
155 | + } else{ |
|
153 | 156 | |
154 | 157 | // add teh user to the list of users |
155 | 158 | $array_unique_users_ids[] = $user->ID; |
@@ -239,9 +242,7 @@ discard block |
||
239 | 242 | |
240 | 243 | $user_public_name = $user->first_name . ' ' . $user->last_name; |
241 | 244 | |
242 | - } |
|
243 | - |
|
244 | - else { |
|
245 | + } else { |
|
245 | 246 | |
246 | 247 | $user_public_name = $user->display_name; |
247 | 248 |
@@ -166,7 +166,7 @@ |
||
166 | 166 | |
167 | 167 | Sensei_Templates::get_template( 'user/my-courses.php' ); |
168 | 168 | |
169 | - }else{ |
|
169 | + } else{ |
|
170 | 170 | |
171 | 171 | Sensei()->frontend->sensei_login_form(); |
172 | 172 |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | /** |
6 | 8 | * Sensei Modules Class |
@@ -401,8 +403,9 @@ discard block |
||
401 | 403 | $term = urldecode(stripslashes($_GET['term'])); |
402 | 404 | |
403 | 405 | // Return nothing if term is empty |
404 | - if (empty($term)) |
|
405 | - die(); |
|
406 | + if (empty($term)) { |
|
407 | + die(); |
|
408 | + } |
|
406 | 409 | |
407 | 410 | // Set a default if none is given |
408 | 411 | $default = isset($_GET['default']) ? $_GET['default'] : __('No course', 'woothemes-sensei'); |
@@ -789,7 +792,9 @@ discard block |
||
789 | 792 | ); |
790 | 793 | $lessons = get_posts($args); |
791 | 794 | |
792 | - if (is_wp_error($lessons) || 0 >= count($lessons)) return 0; |
|
795 | + if (is_wp_error($lessons) || 0 >= count($lessons)) { |
|
796 | + return 0; |
|
797 | + } |
|
793 | 798 | |
794 | 799 | $completed = false; |
795 | 800 | $lesson_count = 0; |
@@ -1378,7 +1383,7 @@ discard block |
||
1378 | 1383 | |
1379 | 1384 | return $lesson_query->posts; |
1380 | 1385 | |
1381 | - }else{ |
|
1386 | + } else{ |
|
1382 | 1387 | |
1383 | 1388 | return array(); |
1384 | 1389 |
@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | /** |
5 | 8 | * Sensei Analysis Overview List Table Class |
@@ -306,8 +309,7 @@ discard block |
||
306 | 309 | // Output course data |
307 | 310 | if ( $this->csv_output ) { |
308 | 311 | $course_title = apply_filters( 'the_title', $item->post_title, $item->ID ); |
309 | - } |
|
310 | - else { |
|
312 | + } else { |
|
311 | 313 | $url = add_query_arg( array( 'page' => $this->page_slug, 'course_id' => $item->ID ), admin_url( 'admin.php' ) ); |
312 | 314 | |
313 | 315 | $course_title = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . apply_filters( 'the_title', $item->post_title, $item->ID ) . '</a></strong>'; |
@@ -363,16 +365,14 @@ discard block |
||
363 | 365 | // Output lesson data |
364 | 366 | if ( $this->csv_output ) { |
365 | 367 | $lesson_title = apply_filters( 'the_title', $item->post_title, $item->ID ); |
366 | - } |
|
367 | - else { |
|
368 | + } else { |
|
368 | 369 | $url = add_query_arg( array( 'page' => $this->page_slug, 'lesson_id' => $item->ID ), admin_url( 'admin.php' ) ); |
369 | 370 | $lesson_title = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . apply_filters( 'the_title', $item->post_title, $item->ID ) . '</a></strong>'; |
370 | 371 | |
371 | 372 | if ( $course_id ) { |
372 | 373 | $url = add_query_arg( array( 'page' => $this->page_slug, 'course_id' => $course_id ), admin_url( 'admin.php' ) ); |
373 | 374 | $course_title = '<a href="' . esc_url( $url ) . '">' . $course_title . '</a>'; |
374 | - } |
|
375 | - else { |
|
375 | + } else { |
|
376 | 376 | $course_title = __('n/a', 'woothemes-sensei'); |
377 | 377 | } |
378 | 378 | if ( is_numeric( $lesson_average_grade ) ) { |
@@ -423,8 +423,7 @@ discard block |
||
423 | 423 | // Output the users data |
424 | 424 | if ( $this->csv_output ) { |
425 | 425 | $user_name = Sensei()->learners->get_learner_full_name( $item->ID ); |
426 | - } |
|
427 | - else { |
|
426 | + } else { |
|
428 | 427 | $url = add_query_arg( array( 'page' => $this->page_slug, 'user_id' => $item->ID ), admin_url( 'admin.php' ) ); |
429 | 428 | $user_name = '<strong><a class="row-title" href="' . esc_url( $url ) . '">' . $item->display_name . '</a></strong>'; |
430 | 429 | $user_average_grade .= '%'; |