@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 7 | 7 | |
| 8 | 8 | if ( class_exists( 'Teacher_New_Course_Assignment' ) ){ |
| 9 | - return; |
|
| 9 | + return; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -40,40 +40,40 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | function __construct() { |
| 42 | 42 | |
| 43 | - $this->template = 'teacher-new-course-assignment'; |
|
| 43 | + $this->template = 'teacher-new-course-assignment'; |
|
| 44 | 44 | $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have been assigned to a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
| 45 | 45 | $this->heading = apply_filters( 'sensei_email_heading', __( 'Course assigned to you', 'woothemes-sensei' ), $this->template ); |
| 46 | - return; |
|
| 46 | + return; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * trigger function. |
| 51 | 51 | * |
| 52 | 52 | * @access public |
| 53 | - * @param $teacher_id |
|
| 54 | - * @param $course_id |
|
| 53 | + * @param $teacher_id |
|
| 54 | + * @param $course_id |
|
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | 57 | function trigger( $teacher_id = 0, $course_id = 0 ) { |
| 58 | 58 | global $sensei_email_data; |
| 59 | 59 | |
| 60 | 60 | $this->teacher = new WP_User( $teacher_id ); |
| 61 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 62 | - $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
| 61 | + $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 62 | + $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
| 63 | 63 | |
| 64 | - //course edit link |
|
| 65 | - $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
| 64 | + //course edit link |
|
| 65 | + $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
| 66 | 66 | |
| 67 | - // Course name |
|
| 68 | - $course = get_post( $course_id); |
|
| 67 | + // Course name |
|
| 68 | + $course = get_post( $course_id); |
|
| 69 | 69 | // Construct data array |
| 70 | 70 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 71 | 71 | 'template' => $this->template, |
| 72 | 72 | 'heading' => $this->heading, |
| 73 | 73 | 'teacher_id' => $teacher_id, |
| 74 | 74 | 'course_id' => $course_id, |
| 75 | - 'course_name' => $course->post_title, |
|
| 76 | - 'course_edit_link' => $course_edit_link, |
|
| 75 | + 'course_name' => $course->post_title, |
|
| 76 | + 'course_edit_link' => $course_edit_link, |
|
| 77 | 77 | ), $this->template ); |
| 78 | 78 | |
| 79 | 79 | // Send mail |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $teacher_id = get_post_field( 'post_author', $lesson_id, 'raw' ); |
| 52 | 52 | $this->teacher = new WP_User( $teacher_id ); |
| 53 | 53 | |
| 54 | - // Construct data array |
|
| 54 | + // Construct data array |
|
| 55 | 55 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 56 | 56 | 'template' => $this->template, |
| 57 | 57 | 'heading' => $this->heading, |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $this->recipient = stripslashes( $this->teacher->user_email ); |
| 66 | 66 | |
| 67 | 67 | // Send mail |
| 68 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 68 | + Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -48,8 +48,8 @@ |
||
| 48 | 48 | $this->learner = new WP_User( $learner_id ); |
| 49 | 49 | |
| 50 | 50 | // Get teacher ID and user object |
| 51 | - $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 52 | - $course_id = get_post_meta( $lesson_id, '_lesson_course', true ); |
|
| 51 | + $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 52 | + $course_id = get_post_meta( $lesson_id, '_lesson_course', true ); |
|
| 53 | 53 | $teacher_id = get_post_field( 'post_author', $course_id, 'raw' ); |
| 54 | 54 | $this->teacher = new WP_User( $teacher_id ); |
| 55 | 55 | |
@@ -57,16 +57,16 @@ |
||
| 57 | 57 | $content_id = get_post_meta( $message_id, '_post', true ); |
| 58 | 58 | $content_title = get_the_title( $content_id ); |
| 59 | 59 | |
| 60 | - // setup the post type parameter |
|
| 61 | - $content_type = get_post_type( $content_id ); |
|
| 62 | - if( !$content_type ){ |
|
| 63 | - $content_type =''; |
|
| 64 | - } |
|
| 60 | + // setup the post type parameter |
|
| 61 | + $content_type = get_post_type( $content_id ); |
|
| 62 | + if( !$content_type ){ |
|
| 63 | + $content_type =''; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | // Construct data array |
| 67 | 67 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 68 | 68 | 'template' => $this->template, |
| 69 | - $content_type.'_id' => $content_id, |
|
| 69 | + $content_type.'_id' => $content_id, |
|
| 70 | 70 | 'heading' => $this->heading, |
| 71 | 71 | 'teacher_id' => $this->teacher->ID, |
| 72 | 72 | 'learner_id' => $this->learner->ID, |
@@ -64,16 +64,16 @@ |
||
| 64 | 64 | |
| 65 | 65 | $comment_link = get_comment_link( $comment ); |
| 66 | 66 | |
| 67 | - // setup the post type parameter |
|
| 68 | - $content_type = get_post_type( $content_id ); |
|
| 69 | - if( !$content_type ){ |
|
| 70 | - $content_type =''; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - // Construct data array |
|
| 74 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 75 | - 'template' => $this->template, |
|
| 76 | - $content_type.'_id' => $content_id, |
|
| 67 | + // setup the post type parameter |
|
| 68 | + $content_type = get_post_type( $content_id ); |
|
| 69 | + if( !$content_type ){ |
|
| 70 | + $content_type =''; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + // Construct data array |
|
| 74 | + $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 75 | + 'template' => $this->template, |
|
| 76 | + $content_type.'_id' => $content_id, |
|
| 77 | 77 | 'heading' => $this->heading, |
| 78 | 78 | 'commenter_name' => $this->commenter->display_name, |
| 79 | 79 | 'message' => $this->comment->comment_content, |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | if ( current_user_can( 'manage_sensei_grades' ) ) { |
| 57 | 57 | |
| 58 | - add_submenu_page( 'sensei', __('Analysis', 'woothemes-sensei'), __('Analysis', 'woothemes-sensei') , 'manage_sensei_grades', 'sensei_analysis', array( $this, 'analysis_page' ) ); |
|
| 58 | + add_submenu_page( 'sensei', __('Analysis', 'woothemes-sensei'), __('Analysis', 'woothemes-sensei') , 'manage_sensei_grades', 'sensei_analysis', array( $this, 'analysis_page' ) ); |
|
| 59 | 59 | |
| 60 | 60 | } |
| 61 | 61 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'analysis-lesson' |
| 106 | 106 | ); |
| 107 | 107 | foreach ( $classes_to_load as $class_file ) { |
| 108 | - Sensei()->load_class( $class_file ); |
|
| 108 | + Sensei()->load_class( $class_file ); |
|
| 109 | 109 | } // End For Loop |
| 110 | 110 | } // End load_data_table_files() |
| 111 | 111 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | |
| 444 | 444 | $user_id = intval( $_GET['user_id'] ); |
| 445 | 445 | $url = esc_url( add_query_arg( array( 'page' => $this->page_slug, 'user' => $user_id ), admin_url( 'admin.php' ) ) ); |
| 446 | - $user_name = Sensei()->learners->get_learner_full_name( $user_id ); |
|
| 446 | + $user_name = Sensei()->learners->get_learner_full_name( $user_id ); |
|
| 447 | 447 | $title .= sprintf( ' <span class="user-title">> <a href="%s">%s</a></span>', $url, $user_name ); |
| 448 | 448 | |
| 449 | 449 | } // End If Statement |
@@ -464,8 +464,8 @@ discard block |
||
| 464 | 464 | $user_id = intval( $_GET['user_id'] ); |
| 465 | 465 | $user_data = get_userdata( $user_id ); |
| 466 | 466 | $url = add_query_arg( array( 'page' => $this->page_slug, 'user_id' => $user_id ), admin_url( 'admin.php' ) ); |
| 467 | - $user_name = Sensei()->learners->get_learner_full_name( $user_id ); |
|
| 468 | - $title .= sprintf( ' <span class="user-title">> <a href="%s">%s</a></span>', $url, $user_name ); |
|
| 467 | + $user_name = Sensei()->learners->get_learner_full_name( $user_id ); |
|
| 468 | + $title .= sprintf( ' <span class="user-title">> <a href="%s">%s</a></span>', $url, $user_name ); |
|
| 469 | 469 | $title .= sprintf( ' <span class="user-title">> <a href="%s">%s</a></span>', esc_url( $url ), $user_data->display_name ); |
| 470 | 470 | } // End If Statement |
| 471 | 471 | if ( isset( $_GET['course_id'] ) ) { |
@@ -25,45 +25,45 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Hook in tabs. |
| 28 | - * @since 1.8.0 |
|
| 28 | + * @since 1.8.0 |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct() { |
| 31 | 31 | |
| 32 | - add_action( 'admin_menu', array( $this, 'admin_menus') ); |
|
| 32 | + add_action( 'admin_menu', array( $this, 'admin_menus') ); |
|
| 33 | 33 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Sends user to the welcome page on first activation. |
|
| 39 | - * |
|
| 40 | - * Hooked into activated_plugin |
|
| 41 | - * @since 1.8.0 |
|
| 42 | - */ |
|
| 43 | - public static function redirect( $plugin ) { |
|
| 37 | + /** |
|
| 38 | + * Sends user to the welcome page on first activation. |
|
| 39 | + * |
|
| 40 | + * Hooked into activated_plugin |
|
| 41 | + * @since 1.8.0 |
|
| 42 | + */ |
|
| 43 | + public static function redirect( $plugin ) { |
|
| 44 | 44 | |
| 45 | - // Bail if activating from network, or bulk, or within an iFrame |
|
| 46 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { |
|
| 45 | + // Bail if activating from network, or bulk, or within an iFrame |
|
| 46 | + if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { |
|
| 47 | 47 | |
| 48 | - return; |
|
| 48 | + return; |
|
| 49 | 49 | |
| 50 | - } |
|
| 51 | - // don't run for upgrades and for pages already on the welcome screen |
|
| 52 | - if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) |
|
| 53 | - || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'sensei-welcome' ) ) { |
|
| 50 | + } |
|
| 51 | + // don't run for upgrades and for pages already on the welcome screen |
|
| 52 | + if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) |
|
| 53 | + || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'sensei-welcome' ) ) { |
|
| 54 | 54 | |
| 55 | - return; |
|
| 55 | + return; |
|
| 56 | 56 | |
| 57 | - } |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - wp_redirect( admin_url( 'index.php?page=sensei-welcome' ) ); |
|
| 60 | - exit; |
|
| 61 | - } |
|
| 59 | + wp_redirect( admin_url( 'index.php?page=sensei-welcome' ) ); |
|
| 60 | + exit; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Add admin menus/screens. |
| 65 | - * |
|
| 66 | - * @since 1.8.0 |
|
| 65 | + * |
|
| 66 | + * @since 1.8.0 |
|
| 67 | 67 | */ |
| 68 | 68 | public function admin_menus() { |
| 69 | 69 | |
@@ -73,17 +73,17 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $welcome_page_name = __( 'Sensei Activation', 'woothemes-sensei' ); |
| 75 | 75 | $welcome_page_title = __( 'Welcome to Sensei', 'woothemes-sensei' ); |
| 76 | - add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array( $this, 'welcome_screen' ) ); |
|
| 76 | + add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array( $this, 'welcome_screen' ) ); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * Output the Welcome screen. |
|
| 82 | - * |
|
| 83 | - * @since 1.8.0 |
|
| 84 | - */ |
|
| 85 | - public function welcome_screen() { |
|
| 86 | - ?> |
|
| 80 | + /** |
|
| 81 | + * Output the Welcome screen. |
|
| 82 | + * |
|
| 83 | + * @since 1.8.0 |
|
| 84 | + */ |
|
| 85 | + public function welcome_screen() { |
|
| 86 | + ?> |
|
| 87 | 87 | <div class="wrap about-wrap"> |
| 88 | 88 | |
| 89 | 89 | <?php $this->intro(); ?> |
@@ -136,13 +136,13 @@ discard block |
||
| 136 | 136 | </div> |
| 137 | 137 | </div> |
| 138 | 138 | <?php |
| 139 | - } |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * Add styles just for this page, and remove dashboard page links. |
| 143 | 143 | */ |
| 144 | 144 | public function admin_head() { |
| 145 | - // remove the menu page so it is not visible in the admin side bar |
|
| 145 | + // remove the menu page so it is not visible in the admin side bar |
|
| 146 | 146 | remove_submenu_page( 'index.php', 'sensei-welcome' ); |
| 147 | 147 | ?> |
| 148 | 148 | <style type="text/css"> |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // Random tweet - must be kept to 102 chars to "fit" |
| 268 | 268 | $tweets = array( |
| 269 | - 'I\'ve just installed Sensei - A premium Learning Management plugin for #WordPress.' |
|
| 269 | + 'I\'ve just installed Sensei - A premium Learning Management plugin for #WordPress.' |
|
| 270 | 270 | ); |
| 271 | 271 | shuffle( $tweets ); |
| 272 | 272 | ?> |
@@ -288,11 +288,11 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | <div class="sensei-badge"> |
| 290 | 290 | <?php |
| 291 | - _e('Sensei by WooThemes','woothemes-sensei'); |
|
| 292 | - echo '<br />'; |
|
| 291 | + _e('Sensei by WooThemes','woothemes-sensei'); |
|
| 292 | + echo '<br />'; |
|
| 293 | 293 | |
| 294 | - printf( __( 'Version %s', 'woothemes-sensei' ), Sensei()->version ); |
|
| 295 | - ?> |
|
| 294 | + printf( __( 'Version %s', 'woothemes-sensei' ), Sensei()->version ); |
|
| 295 | + ?> |
|
| 296 | 296 | </div> |
| 297 | 297 | |
| 298 | 298 | <p class="sensei-actions"> |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | if ( WooThemes_Sensei_Utils::sensei_is_woocommerce_activated() ) { |
| 87 | 87 | global $woocommerce; |
| 88 | 88 | if( version_compare( $woocommerce->version, $version, ">=" ) ) { |
| 89 | - return true; |
|
| 89 | + return true; |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | return false; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if( isset( $wp_query->query_vars['learner_profile'] ) ) { |
| 63 | 63 | $learner_user = get_user_by( 'login', $wp_query->query_vars['learner_profile'] ); |
| 64 | 64 | |
| 65 | - $name = Sensei()->learners->get_learner_full_name( $learner_user->ID ); |
|
| 65 | + $name = Sensei()->learners->get_learner_full_name( $learner_user->ID ); |
|
| 66 | 66 | |
| 67 | 67 | $title = apply_filters( 'sensei_learner_profile_courses_heading', sprintf( __( 'Courses %s is taking', 'woothemes-sensei' ), $name ) ) . ' ' . $sep . ' '; |
| 68 | 68 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | if( isset( $wp_query->query_vars['learner_profile'] ) ) { |
| 112 | 112 | |
| 113 | - Sensei_Templates::get_template( 'learner-profile/learner-info.php' ); |
|
| 113 | + Sensei_Templates::get_template( 'learner-profile/learner-info.php' ); |
|
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -140,43 +140,43 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public static function user_info( $user ) { |
| 142 | 142 | |
| 143 | - /** |
|
| 144 | - * This hooke fires inside the Sensei_Learner_Profiles::user_info function. |
|
| 145 | - * just before the htmls is generated. |
|
| 146 | - * @since 1.0.0 |
|
| 147 | - */ |
|
| 148 | - do_action( 'sensei_learner_profile_info', $user ); |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 152 | - * Here you can change the user avatar. |
|
| 153 | - * |
|
| 154 | - * @since 1.0.0 |
|
| 155 | - * |
|
| 156 | - * @param false|string `<img>` $user_avatar |
|
| 157 | - */ |
|
| 143 | + /** |
|
| 144 | + * This hooke fires inside the Sensei_Learner_Profiles::user_info function. |
|
| 145 | + * just before the htmls is generated. |
|
| 146 | + * @since 1.0.0 |
|
| 147 | + */ |
|
| 148 | + do_action( 'sensei_learner_profile_info', $user ); |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 152 | + * Here you can change the user avatar. |
|
| 153 | + * |
|
| 154 | + * @since 1.0.0 |
|
| 155 | + * |
|
| 156 | + * @param false|string `<img>` $user_avatar |
|
| 157 | + */ |
|
| 158 | 158 | $learner_avatar = apply_filters( 'sensei_learner_profile_info_avatar', get_avatar( $user->ID, 120 ), $user->ID ); |
| 159 | 159 | |
| 160 | - /** |
|
| 161 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 162 | - * Here you can change the learner profile user display name. |
|
| 163 | - * @since 1.0.0 |
|
| 164 | - * |
|
| 165 | - * @param string $user_display_name |
|
| 166 | - * @param string $user_id |
|
| 167 | - */ |
|
| 160 | + /** |
|
| 161 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 162 | + * Here you can change the learner profile user display name. |
|
| 163 | + * @since 1.0.0 |
|
| 164 | + * |
|
| 165 | + * @param string $user_display_name |
|
| 166 | + * @param string $user_id |
|
| 167 | + */ |
|
| 168 | 168 | $learner_name = apply_filters( 'sensei_learner_profile_info_name', $user->display_name, $user->ID ); |
| 169 | 169 | |
| 170 | - /** |
|
| 171 | - * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 172 | - * With this filter can change the users description on the learner user info |
|
| 173 | - * output. |
|
| 174 | - * |
|
| 175 | - * @since 1.0.0 |
|
| 176 | - * |
|
| 177 | - * @param string $user_description |
|
| 178 | - * @param string $user_id |
|
| 179 | - */ |
|
| 170 | + /** |
|
| 171 | + * This filter runs inside the Sensei_Learner_Profiles::user_info function. |
|
| 172 | + * With this filter can change the users description on the learner user info |
|
| 173 | + * output. |
|
| 174 | + * |
|
| 175 | + * @since 1.0.0 |
|
| 176 | + * |
|
| 177 | + * @param string $user_description |
|
| 178 | + * @param string $user_id |
|
| 179 | + */ |
|
| 180 | 180 | $learner_bio = apply_filters( 'sensei_learner_profile_info_bio', $user->description, $user->ID ); |
| 181 | 181 | ?> |
| 182 | 182 | |
@@ -210,16 +210,16 @@ discard block |
||
| 210 | 210 | return $classes; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - /** |
|
| 214 | - * Deprecate the deprecate_sensei_learner_profile_content hook |
|
| 215 | - * |
|
| 216 | - * @since 1.9.0 |
|
| 217 | - */ |
|
| 218 | - public static function deprecate_sensei_learner_profile_content_hook(){ |
|
| 213 | + /** |
|
| 214 | + * Deprecate the deprecate_sensei_learner_profile_content hook |
|
| 215 | + * |
|
| 216 | + * @since 1.9.0 |
|
| 217 | + */ |
|
| 218 | + public static function deprecate_sensei_learner_profile_content_hook(){ |
|
| 219 | 219 | |
| 220 | - sensei_do_deprecated_action( 'sensei_learner_profile_content', '1.9.0', 'sensei_learner_profile_content_before' ); |
|
| 220 | + sensei_do_deprecated_action( 'sensei_learner_profile_content', '1.9.0', 'sensei_learner_profile_content_before' ); |
|
| 221 | 221 | |
| 222 | - } |
|
| 222 | + } |
|
| 223 | 223 | |
| 224 | 224 | |
| 225 | 225 | } // End Class |