Completed
Push — master ( f45963...ffd8a9 )
by Dwain
05:01
created
widgets/widget-woothemes-sensei-course-component.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 		remove_filter( 'pre_get_posts', 'sensei_course_archive_filter', 10, 1 );
65 65
 
66 66
 		if ( in_array( $instance['component'], array_keys( $this->woo_widget_componentslist ) )
67
-            && ( 'activecourses' == $instance['component'] || 'completedcourses' == $instance['component'] )
68
-            && !is_user_logged_in() ) {
67
+			&& ( 'activecourses' == $instance['component'] || 'completedcourses' == $instance['component'] )
68
+			&& !is_user_logged_in() ) {
69 69
 
70 70
 			// No Output
71
-            return;
71
+			return;
72 72
 
73 73
 		} else {
74 74
 			/* Our variables from the widget settings. */
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @param  array $instance The settings for this instance.
131 131
 	 * @return void
132 132
 	 */
133
-    public function form( $instance ) {
133
+	public function form( $instance ) {
134 134
 
135 135
 		/* Set up some default widget settings. */
136 136
 		/* Make sure all keys are added here, even with empty string values. */
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	/**
169 169
 	 * Load the desired component, if a method is available for it.
170 170
 	 * @param  string $component The component to potentially be loaded.
171
-     *
171
+	 *
172 172
 	 * @since  1.0.0
173 173
 	 * @return void
174 174
 	 */
@@ -207,24 +207,24 @@  discard block
 block discarded – undo
207 207
 
208 208
 		}
209 209
 
210
-        if ( ! empty( $course_ids ) ) {
210
+		if ( ! empty( $course_ids ) ) {
211 211
 
212
-            $posts_array = Sensei()->course->course_query( intval( $instance['limit'] ), esc_attr( $instance['component'] ), $course_ids );
212
+			$posts_array = Sensei()->course->course_query( intval( $instance['limit'] ), esc_attr( $instance['component'] ), $course_ids );
213 213
 
214 214
 		} else {
215 215
 
216
-            if ( 'activecourses' == esc_attr( $instance['component'] ) || 'completedcourses' == esc_attr( $instance['component'] ) ) {
216
+			if ( 'activecourses' == esc_attr( $instance['component'] ) || 'completedcourses' == esc_attr( $instance['component'] ) ) {
217 217
 				$posts_array = array();
218 218
 
219
-            } else {
219
+			} else {
220 220
 
221
-                $course_args = array(
222
-                    'post_type' => 'course',
223
-                    'orderby'         	=> 'date',
224
-                    'order'           	=> 'DESC',
225
-                    'post_status'      	=> 'publish',
226
-                    'posts_per_page' => $instance['limit'],
227
-                );
221
+				$course_args = array(
222
+					'post_type' => 'course',
223
+					'orderby'         	=> 'date',
224
+					'order'           	=> 'DESC',
225
+					'post_status'      	=> 'publish',
226
+					'posts_per_page' => $instance['limit'],
227
+				);
228 228
 
229 229
 				$posts_array = get_posts( $course_args );
230 230
 			}
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
 		if ( count( $posts_array ) > 0 ) { ?>
235 235
 			<ul>
236 236
 			<?php foreach ($posts_array as $post_item){
237
-		    	$post_id = absint( $post_item->ID );
238
-		    	$post_title = $post_item->post_title;
239
-		    	$user_info = get_userdata( absint( $post_item->post_author ) );
240
-		    	$author_link = get_author_posts_url( absint( $post_item->post_author ) );
241
-		    	$author_display_name = $user_info->display_name;
242
-		    	$author_id = $post_item->post_author;
243
-		    ?>
237
+				$post_id = absint( $post_item->ID );
238
+				$post_title = $post_item->post_title;
239
+				$user_info = get_userdata( absint( $post_item->post_author ) );
240
+				$author_link = get_author_posts_url( absint( $post_item->post_author ) );
241
+				$author_display_name = $user_info->display_name;
242
+				$author_id = $post_item->post_author;
243
+			?>
244 244
 		    	<li class="fix">
245 245
 		    		<?php do_action( 'sensei_course_image', $post_id ); ?>
246 246
 		    		<a href="<?php echo esc_url( get_permalink( $post_id ) ); ?>" title="<?php echo esc_attr( $post_title ); ?>"><?php echo $post_title; ?></a>
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
 		    	</li>
256 256
 		    <?php } // End For Loop ?>
257 257
 		    <?php if ( 'activecourses' == esc_attr( $instance['component'] ) || 'completedcourses' == esc_attr( $instance['component'] ) ) {
258
-		    	$my_account_page_id = intval( Sensei()->settings->settings[ 'my_course_page' ] );
259
-		    	echo '<li class="my-account fix"><a href="'. esc_url( get_permalink( $my_account_page_id ) ) .'">'.__('My Courses', 'woothemes-sensei').' <span class="meta-nav"></span></a></li>';
260
-		    } // End If Statement ?>
258
+				$my_account_page_id = intval( Sensei()->settings->settings[ 'my_course_page' ] );
259
+				echo '<li class="my-account fix"><a href="'. esc_url( get_permalink( $my_account_page_id ) ) .'">'.__('My Courses', 'woothemes-sensei').' <span class="meta-nav"></span></a></li>';
260
+			} // End If Statement ?>
261 261
 		</ul>
262 262
 		<?php } else {
263 263
 			// No posts returned. This means the user either has no active or no completed courses.
Please login to merge, or discard this patch.
templates/teacher-archive.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,31 +1,31 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The Template for displaying teacher author archives, this template wil show the teacher
4
- * and all course that belong to to them.
5
- *
6
- * Override this template by copying it to your_theme/sensei/teacher-archive.php
7
- *
8
- * @author 		Automattic
9
- * @package 	Sensei
10
- * @category    Templates
11
- * @version     1.9.0
12
- */
3
+		 * The Template for displaying teacher author archives, this template wil show the teacher
4
+		 * and all course that belong to to them.
5
+		 *
6
+		 * Override this template by copying it to your_theme/sensei/teacher-archive.php
7
+		 *
8
+		 * @author 		Automattic
9
+		 * @package 	Sensei
10
+		 * @category    Templates
11
+		 * @version     1.9.0
12
+		 */
13 13
 ?>
14 14
 
15 15
 <?php  get_sensei_header();  ?>
16 16
 
17 17
     <?php
18 18
 
19
-        /**
20
-         * This action before teacher courses loop. This hook fires within the archive-course.php
21
-         * It fires even if the current archive has no posts.
22
-         *
23
-         * @since 1.9.0
24
-         *
25
-         */
26
-        do_action( 'sensei_teacher_archive_course_loop_before' );
19
+		/**
20
+		 * This action before teacher courses loop. This hook fires within the archive-course.php
21
+		 * It fires even if the current archive has no posts.
22
+		 *
23
+		 * @since 1.9.0
24
+		 *
25
+		 */
26
+		do_action( 'sensei_teacher_archive_course_loop_before' );
27 27
 
28
-    ?>
28
+	?>
29 29
 
30 30
     <?php if ( have_posts() ): ?>
31 31
 
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 
40 40
     <?php
41 41
 
42
-        /**
43
-         * This action runs after including the teacher archive loop. This hook fires within the teacher-archive.php
44
-         * It fires even if the current archive has no posts.
45
-         *
46
-         * @since 1.9.0
47
-         */
48
-        do_action( 'sensei_teacher_archive_course_loop_after' );
42
+		/**
43
+		 * This action runs after including the teacher archive loop. This hook fires within the teacher-archive.php
44
+		 * It fires even if the current archive has no posts.
45
+		 *
46
+		 * @since 1.9.0
47
+		 */
48
+		do_action( 'sensei_teacher_archive_course_loop_after' );
49 49
 
50
-    ?>
50
+	?>
51 51
 
52 52
 <?php get_sensei_footer(); ?>
Please login to merge, or discard this patch.
templates/archive-lesson.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,29 +1,29 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * The Template for displaying lesson archives, including the lesson page template.
4
- * This template also handels the lesson modules taxonomy and the lessons_tag taxonomy.
5
- *
6
- * Override this template by copying it to your_theme/sensei/archive-lesson.php
7
- *
8
- * @author 		Automattic
9
- * @package 	Sensei
10
- * @category    Templates
11
- * @version     1.9.0
12
- */
3
+	 * The Template for displaying lesson archives, including the lesson page template.
4
+	 * This template also handels the lesson modules taxonomy and the lessons_tag taxonomy.
5
+	 *
6
+	 * Override this template by copying it to your_theme/sensei/archive-lesson.php
7
+	 *
8
+	 * @author 		Automattic
9
+	 * @package 	Sensei
10
+	 * @category    Templates
11
+	 * @version     1.9.0
12
+	 */
13 13
 ?>
14 14
 
15 15
 <?php  get_sensei_header();  ?>
16 16
 
17 17
     <?php
18 18
 
19
-        /**
20
-         * Action before lesson archive loop. This action runs within the archive-lesson.php.
21
-         *
22
-         * It will be executed even if there are no posts on the archive page.
23
-         */
24
-        do_action( 'sensei_archive_before_lesson_loop' );
19
+		/**
20
+		 * Action before lesson archive loop. This action runs within the archive-lesson.php.
21
+		 *
22
+		 * It will be executed even if there are no posts on the archive page.
23
+		 */
24
+		do_action( 'sensei_archive_before_lesson_loop' );
25 25
 
26
-    ?>
26
+	?>
27 27
 
28 28
     <?php if ( have_posts() ): ?>
29 29
 
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 
38 38
     <?php
39 39
 
40
-        /**
41
-         * Action after lesson archive  loop on the archive-lesson.php template file
42
-         * It will be executed even if there are no posts on the archive page.
43
-         *
44
-         * @since 1.9.0
45
-         */
46
-        do_action( 'sensei_archive_after_lesson_loop' );
47
-    ?>
40
+		/**
41
+		 * Action after lesson archive  loop on the archive-lesson.php template file
42
+		 * It will be executed even if there are no posts on the archive page.
43
+		 *
44
+		 * @since 1.9.0
45
+		 */
46
+		do_action( 'sensei_archive_after_lesson_loop' );
47
+	?>
48 48
 <?php get_sensei_footer(); ?>
Please login to merge, or discard this patch.
templates/globals/pagination.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,23 +13,23 @@
 block discarded – undo
13 13
 global $wp_query;
14 14
 
15 15
 if ( $wp_query->max_num_pages <= 1 ) {
16
-    return;
16
+	return;
17 17
 }
18 18
 
19 19
 ?>
20 20
 <nav class="sensei-pagination">
21 21
     <?php
22
-    echo paginate_links( apply_filters( 'sensei_pagination_args', array(
23
-        'base'         => esc_url_raw( str_replace( 999999999, '%#%', get_pagenum_link( 999999999, false ) ) ),
24
-        'format'       => '',
25
-        'add_args'     => '',
26
-        'current'      => max( 1, get_query_var( 'paged' ) ),
27
-        'total'        => $wp_query->max_num_pages,
28
-        'prev_text'    => '&larr;',
29
-        'next_text'    => '&rarr;',
30
-        'type'         => 'list',
31
-        'end_size'     => 3,
32
-        'mid_size'     => 3
33
-    ) ) );
34
-    ?>
22
+	echo paginate_links( apply_filters( 'sensei_pagination_args', array(
23
+		'base'         => esc_url_raw( str_replace( 999999999, '%#%', get_pagenum_link( 999999999, false ) ) ),
24
+		'format'       => '',
25
+		'add_args'     => '',
26
+		'current'      => max( 1, get_query_var( 'paged' ) ),
27
+		'total'        => $wp_query->max_num_pages,
28
+		'prev_text'    => '&larr;',
29
+		'next_text'    => '&rarr;',
30
+		'type'         => 'list',
31
+		'end_size'     => 3,
32
+		'mid_size'     => 3
33
+	) ) );
34
+	?>
35 35
 </nav>
Please login to merge, or discard this patch.
templates/emails/header.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,11 +107,11 @@
 block discarded – undo
107 107
             	<tr>
108 108
                 	<td align="center" valign="top">
109 109
                 		<?php
110
-                			if ( isset( Sensei()->settings->settings['email_header_image'] ) && '' != Sensei()->settings->settings['email_header_image'] ) {
111
-                				$img = Sensei()->settings->settings['email_header_image'];
112
-                				echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>';
113
-                			}
114
-                		?>
110
+							if ( isset( Sensei()->settings->settings['email_header_image'] ) && '' != Sensei()->settings->settings['email_header_image'] ) {
111
+								$img = Sensei()->settings->settings['email_header_image'];
112
+								echo '<p style="margin-top:0;"><img src="' . esc_url( $img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>';
113
+							}
114
+						?>
115 115
                     	<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container" style="<?php echo $template_container; ?>">
116 116
                         	<tr>
117 117
                             	<td align="center" valign="top">
Please login to merge, or discard this patch.
templates/emails/teacher-new-course-assignment.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@
 block discarded – undo
35 35
 <p style="<?php echo esc_attr( $style_small ); ?>">
36 36
     <?php
37 37
 
38
-    echo __( 'You can edit the assigned course here: ', 'woothemes-sensei' ) . '<a href="' . esc_url( $sensei_email_data['course_edit_link'] ) . '">'. $sensei_email_data['course_name'] . '</a>';
38
+	echo __( 'You can edit the assigned course here: ', 'woothemes-sensei' ) . '<a href="' . esc_url( $sensei_email_data['course_edit_link'] ) . '">'. $sensei_email_data['course_name'] . '</a>';
39 39
 
40
-    ?>
40
+	?>
41 41
 </p>
42 42
 
43 43
 <?php
Please login to merge, or discard this patch.
templates/emails/footer.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@
 block discarded – undo
15 15
 // Load colours
16 16
 $base = '#557da1';
17 17
 if( isset( Sensei()->settings->settings['email_base_color'] ) && '' != Sensei()->settings->settings['email_base_color'] ) {
18
-    $base = Sensei()->settings->settings['email_base_color'];
18
+	$base = Sensei()->settings->settings['email_base_color'];
19 19
 }
20 20
 
21 21
 $base_lighter_40 = sensei_hex_lighter( $base, 40 );
22 22
 
23 23
 $footer_text = sprintf( __( '%1$s - Powered by Sensei', 'woothemes-sensei' ), get_bloginfo( 'name' ) );
24 24
 if( isset( Sensei()->settings->settings['email_footer_text'] ) ) {
25
-    $footer_text = Sensei()->settings->settings['email_footer_text'];
25
+	$footer_text = Sensei()->settings->settings['email_footer_text'];
26 26
 }
27 27
 
28 28
 // For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline.
Please login to merge, or discard this patch.
templates/single-course/modules.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) exit;
3 3
 /**
4
- * List the Course Modules and Lesson in these modules
5
- *
6
- * Template is hooked into Single Course sensei_single_main_content. It will
7
- * only be shown if the course contains modules.
8
- *
9
- * All lessons shown here will not be included in the list of other lessons.
10
- *
11
- * @author 		Automattic
12
- * @package 	Sensei
13
- * @category    Templates
14
- * @version     1.9.0
15
- */
4
+	 * List the Course Modules and Lesson in these modules
5
+	 *
6
+	 * Template is hooked into Single Course sensei_single_main_content. It will
7
+	 * only be shown if the course contains modules.
8
+	 *
9
+	 * All lessons shown here will not be included in the list of other lessons.
10
+	 *
11
+	 * @author 		Automattic
12
+	 * @package 	Sensei
13
+	 * @category    Templates
14
+	 * @version     1.9.0
15
+	 */
16 16
 ?>
17 17
 
18 18
 <?php
19 19
 
20
-    /**
21
-     * Hook runs inside single-course/course-modules.php
22
-     *
23
-     * It runs before the modules are shown. This hook fires on the single course page. It will show
24
-     * irrespective of irrespective the course has any modules or not.
25
-     *
26
-     * @since 1.8.0
27
-     *
28
-     */
29
-    do_action('sensei_single_course_modules_before');
20
+	/**
21
+	 * Hook runs inside single-course/course-modules.php
22
+	 *
23
+	 * It runs before the modules are shown. This hook fires on the single course page. It will show
24
+	 * irrespective of irrespective the course has any modules or not.
25
+	 *
26
+	 * @since 1.8.0
27
+	 *
28
+	 */
29
+	do_action('sensei_single_course_modules_before');
30 30
 
31 31
 ?>
32 32
 
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 
40 40
                 <?php
41 41
 
42
-                /**
43
-                 * Hook runs inside single-course/course-modules.php
44
-                 *
45
-                 * It runs inside the if statement after the article tag opens just before the modules are shown. This hook will NOT fire if there
46
-                 * are no modules to show.
47
-                 *
48
-                 * @since 1.9.0
49
-                 *
50
-                 * @hooked Sensei()->modules->course_modules_title - 20
51
-                 */
52
-                do_action('sensei_single_course_modules_inside_before');
42
+				/**
43
+				 * Hook runs inside single-course/course-modules.php
44
+				 *
45
+				 * It runs inside the if statement after the article tag opens just before the modules are shown. This hook will NOT fire if there
46
+				 * are no modules to show.
47
+				 *
48
+				 * @since 1.9.0
49
+				 *
50
+				 * @hooked Sensei()->modules->course_modules_title - 20
51
+				 */
52
+				do_action('sensei_single_course_modules_inside_before');
53 53
 
54
-                ?>
54
+				?>
55 55
 
56 56
                 <header>
57 57
 
@@ -101,18 +101,18 @@  discard block
 block discarded – undo
101 101
 
102 102
                 <?php
103 103
 
104
-                /**
105
-                 * Hook runs inside single-course/course-modules.php
106
-                 *
107
-                 * It runs inside the if statement before the closing article tag directly after the modules were shown.
108
-                 * This hook will not trigger if there are no modules to show.
109
-                 *
110
-                 * @since 1.9.0
111
-                 *
112
-                 */
113
-                do_action('sensei_single_course_modules_inside_after');
114
-
115
-                ?>
104
+				/**
105
+				 * Hook runs inside single-course/course-modules.php
106
+				 *
107
+				 * It runs inside the if statement before the closing article tag directly after the modules were shown.
108
+				 * This hook will not trigger if there are no modules to show.
109
+				 *
110
+				 * @since 1.9.0
111
+				 *
112
+				 */
113
+				do_action('sensei_single_course_modules_inside_after');
114
+
115
+				?>
116 116
 
117 117
             </article>
118 118
 
Please login to merge, or discard this patch.
templates/single-quiz/question_type-boolean.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 
13 13
 <?php
14 14
 
15
-    /**
16
-     * Get the question data with the current quiz id
17
-     * All data is loaded in this array to keep the template clean.
18
-     */
19
-    $question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
20
-    $boolean_options = array( 'true', 'false' );
15
+	/**
16
+	 * Get the question data with the current quiz id
17
+	 * All data is loaded in this array to keep the template clean.
18
+	 */
19
+	$question_data = WooThemes_Sensei_Question::get_template_data( sensei_get_the_question_id(), get_the_ID() );
20
+	$boolean_options = array( 'true', 'false' );
21 21
 
22 22
 ?>
23 23
 
@@ -25,42 +25,42 @@  discard block
 block discarded – undo
25 25
 
26 26
     <?php
27 27
 
28
-    // setup the options the right answer set by the admin/teacher
29
-    // will be compared to.
30
-    $boolean_options = array( 'true', 'false' );
28
+	// setup the options the right answer set by the admin/teacher
29
+	// will be compared to.
30
+	$boolean_options = array( 'true', 'false' );
31 31
 
32
-    //loop through the 2 boolean options and compare them with
33
-    // the selected right answer
34
-    foreach ( $boolean_options as $option ){
32
+	//loop through the 2 boolean options and compare them with
33
+	// the selected right answer
34
+	foreach ( $boolean_options as $option ){
35 35
 
36
-        $answer_class = '';
36
+		$answer_class = '';
37 37
 
38
-        // Add classes to indicate correctness, only if there is a grade
39
-        if( isset( $question_data[ 'user_correct' ] ) && 0 < $question_data['question_grade'] ) {
38
+		// Add classes to indicate correctness, only if there is a grade
39
+		if( isset( $question_data[ 'user_correct' ] ) && 0 < $question_data['question_grade'] ) {
40 40
 
41
-            if( $question_right_answer == $question_data[ 'question_right_answer' ] ) {
41
+			if( $question_right_answer == $question_data[ 'question_right_answer' ] ) {
42 42
 
43
-                if( $question_data[ 'user_correct' ] ) {
43
+				if( $question_data[ 'user_correct' ] ) {
44 44
 
45
-                    $answer_class = 'user_right';
45
+					$answer_class = 'user_right';
46 46
 
47
-                }
47
+				}
48 48
 
49
-                $answer_class .= ' right_answer';
49
+				$answer_class .= ' right_answer';
50 50
 
51
-            } else {
51
+			} else {
52 52
 
53
-                if( ! $question_data[ 'user_correct' ] ) {
53
+				if( ! $question_data[ 'user_correct' ] ) {
54 54
 
55
-                    $answer_class = 'user_wrong';
55
+					$answer_class = 'user_wrong';
56 56
 
57
-                }
57
+				}
58 58
 
59
-            } // end if right answer == current booloean options
59
+			} // end if right answer == current booloean options
60 60
 
61
-        }// end if $user_correct .. $question_grade
61
+		}// end if $user_correct .. $question_grade
62 62
 
63
-    ?>
63
+	?>
64 64
 
65 65
     <li class="<?php esc_attr_e( $answer_class ); ?>">
66 66
 
@@ -74,17 +74,17 @@  discard block
 block discarded – undo
74 74
         <label for="<?php echo esc_attr( 'question_' . $question_data[ 'ID' ]  ) . '-option-'.$option; ?>">
75 75
             <?php
76 76
 
77
-            if( 'true' == $option ){
77
+			if( 'true' == $option ){
78 78
 
79
-                _e( 'True', 'woothemes-sensei' );
79
+				_e( 'True', 'woothemes-sensei' );
80 80
 
81
-            }else{
81
+			}else{
82 82
 
83
-                _e( 'False', 'woothemes-sensei' );
83
+				_e( 'False', 'woothemes-sensei' );
84 84
 
85
-            }
85
+			}
86 86
 
87
-            ?>
87
+			?>
88 88
 
89 89
 
90 90
         </label>
Please login to merge, or discard this patch.