Skip to content

Commit

Permalink
Merge pull request #350 from woothemes/release-1-5-3
Browse files Browse the repository at this point in the history
Release 1 5 3
  • Loading branch information
Dan Johnson committed Mar 20, 2014
2 parents 22147c2 + 566738b commit 434a7a5
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 68 deletions.
2 changes: 1 addition & 1 deletion assets/css/frontend.css

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions assets/css/frontend.less
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ section.entry span.course-category { padding-left: 10px; }
section.entry span.course-lesson-progress { padding-left: 10px; }
section.entry span.course-price { padding-left: 10px; }

form {
.sensei form {
.form-row {
padding: 3px;
margin: 0 0 6px;
Expand Down Expand Up @@ -411,8 +411,16 @@ form {
.register-link {
clear: both;
}
form#loginform {
label {
display: block;
}
input[type="text"], input[type="password"] {
width: 90%;
}
}
&.ui-tabs {
position: relative; /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
position: relative;
zoom: 1;
.ui-tabs-nav {
margin: 0 0 10px!important;
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
*** Sensei Changelog ***

2014.03.21 - version 1.5.3
* New - Moving global Sensei functions to new file to make them accessible everywhere
* Fix - Fixing CSS conflict with WooCommerce forms
* Fix - Fixing login form on My Courses page
* Fix - Making sure multiple choice answers that contain apostrophes wil always work on any server
* Fix - Fixing occasional WooCommerce error on single course pages

2014.03.12 - version 1.5.2
* New - Adding support for RTL languages in the dashboard
* New - Minifying all Javascript files and enabling SCRIPT_DEBUG script expansion
Expand Down
29 changes: 3 additions & 26 deletions classes/class-woothemes-sensei-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function enqueue_styles () {
$disable_styles = apply_filters( 'sensei_disable_styles', $disable_styles );

if ( ! $disable_styles ) {
wp_register_style( $woothemes_sensei->token . '-frontend', $woothemes_sensei->plugin_url . 'assets/css/frontend.css', '', '1.5.0', 'screen' );
wp_register_style( $woothemes_sensei->token . '-frontend', $woothemes_sensei->plugin_url . 'assets/css/frontend.css', '', '1.5.3', 'screen' );
wp_enqueue_style( $woothemes_sensei->token . '-frontend' );

// Allow additional stylesheets to be loaded
Expand Down Expand Up @@ -1365,6 +1365,7 @@ public function sensei_course_category_main_content() {
<?php } // End If Statement
} // End sensei_course_category_main_content()


public function sensei_login_form() {
?><div id="my-courses">
<div class="col2-set" id="customer_login">
Expand All @@ -1373,31 +1374,7 @@ public function sensei_login_form() {

<h2><?php _e( 'Login', 'woothemes-sensei' ); ?></h2>

<form method="post" class="login">

<?php do_action( 'sensei_login_form_start' ); ?>

<p class="form-row form-row-wide">
<label for="username"><?php _e( 'Username or email address', 'woothemes-sensei' ); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="username" id="username" />
</p>
<p class="form-row form-row-wide">
<label for="password"><?php _e( 'Password', 'woothemes-sensei' ); ?> <span class="required">*</span></label>
<input class="input-text" type="password" name="password" id="password" />
</p>

<?php do_action( 'sensei_login_form_fields' ); ?>

<p class="form-row">
<input type="submit" class="button" name="login" value="<?php _e( 'Login', 'woothemes-sensei' ); ?>" />
<label for="rememberme" class="inline">
<input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember me', 'woothemes-sensei' ); ?>
</label>
</p>

<?php do_action( 'sensei_login_form_end' ); ?>

</form>
<?php wp_login_form( array( 'redirect' => get_permalink() ) ); ?>

<?php
if ( get_option('users_can_register') ) {
Expand Down
7 changes: 7 additions & 0 deletions classes/class-woothemes-sensei-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,20 @@ public function sensei_grade_question_auto( $question_id = 0, $answer = '', $use

$question_grade = 0;
if( intval( $question_id ) > 0 ) {

$right_answer = get_post_meta( $question_id, '_question_right_answer', true );

if( 0 == get_magic_quotes_gpc() ) {
$answer = stripslashes( $answer );
}

if ( 0 == strcmp( $right_answer, $answer ) ) {
$question_grade = get_post_meta( $question_id, '_question_grade', true );
if( ! $question_grade || $question_grade == '' ) {
$question_grade = 1;
}
}

$activity_logged = WooThemes_Sensei_Utils::sensei_grade_question( $question_id, $question_grade, $user_id );
}

Expand Down
42 changes: 42 additions & 0 deletions inc/woothemes-sensei-functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
* Global Sensei functions
*/

function is_sensei() {
global $post, $woothemes_sensei;

$is_sensei = false;

$post_types = array( 'lesson', 'course', 'quiz', 'question' );
$taxonomies = array( 'course-category', 'quiz-type', 'question-type', 'lesson-tag' );

if( is_post_type_archive( $post_types ) || is_singular( $post_types ) || is_tax( $taxonomies ) ) {
$is_sensei = true;
}

if( is_object( $post ) && ! is_wp_error( $post ) ) {

$course_page_id = intval( $woothemes_sensei->settings->settings[ 'course_page' ] );
$my_courses_page_id = intval( $woothemes_sensei->settings->settings[ 'my_course_page' ] );

if( in_array( $post->ID, array( $course_page_id, $my_courses_page_id ) ) ) {
$is_sensei = true;
}
}

return apply_filters( 'is_sensei', $is_sensei, $post );
}

function sensei_all_access() {
$access = false;
if( current_user_can( 'manage_options' ) ) {
$access = true;
}
return apply_filters( 'sensei_all_access', $access );
} // End sensei_all_access()

?>
33 changes: 0 additions & 33 deletions inc/woothemes-sensei-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,37 +555,4 @@ function sensei_no_quiz_message( $no_quiz_count = 0 ) {
} // End If Statement
} // End sensei_no_quiz_message()

function sensei_all_access() {
$access = false;
if( current_user_can( 'manage_options' ) ) {
$access = true;
}
return apply_filters( 'sensei_all_access', $access );
} // End sensei_all_access()

function is_sensei() {
global $post, $woothemes_sensei;

$is_sensei = false;

$post_types = array( 'lesson', 'course', 'quiz', 'question' );
$taxonomies = array( 'course-category', 'quiz-type', 'question-type', 'lesson-tag' );

if( is_post_type_archive( $post_types ) || is_singular( $post_types ) || is_tax( $taxonomies ) ) {
$is_sensei = true;
}

if( is_object( $post ) && ! is_wp_error( $post ) ) {

$course_page_id = intval( $woothemes_sensei->settings->settings[ 'course_page' ] );
$my_courses_page_id = intval( $woothemes_sensei->settings->settings[ 'my_course_page' ] );

if( in_array( $post->ID, array( $course_page_id, $my_courses_page_id ) ) ) {
$is_sensei = true;
}
}

return apply_filters( 'is_sensei', $is_sensei, $post );
}

?>
7 changes: 6 additions & 1 deletion templates/single-quiz/question_type-multiple-choice.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@
}

if ( isset( $user_quizzes[ $question_id ] ) && ( '' != $user_quizzes[ $question_id ] ) ) {
$checked = checked( $question, $user_quizzes[ $question_id ], false );
if( 0 == get_magic_quotes_gpc() ) {
$user_answer = stripslashes( $user_quizzes[ $question_id ] );
} else {
$user_answer = $user_quizzes[ $question_id ];
}
$checked = checked( $question, $user_answer, false );
} // End If Statement ?>
<li class="<?php esc_attr_e( $answer_class ); ?>">
<input type="radio" id="<?php echo esc_attr( 'question_' . $question_id ) . '-option-' . $count; ?>" name="<?php echo esc_attr( 'sensei_question[' . $question_id . ']' ); ?>" value="<?php echo esc_attr( stripslashes( $question ) ); ?>" <?php echo $checked; ?><?php if ( !is_user_logged_in() ) { echo ' disabled'; } ?>>&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion templates/woocommerce/add-to-cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
if ( 0 < $wc_post_id ) {
// Get the product
$product = $woothemes_sensei->sensei_get_woocommerce_product_object( $wc_post_id );
if ( ! isset ( $product ) ) exit;
if ( ! isset ( $product ) || ! is_object( $product ) ) exit;
if ( $product->is_purchasable() ) {
// Check Product Availability
$availability = $product->get_availability();
Expand Down
12 changes: 8 additions & 4 deletions woothemes-sensei.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Sensei
Plugin URI: http://www.woothemes.com/products/sensei/
Description: A course management plugin that offers the smoothest platform for helping you teach anything.
Version: 1.5.2
Version: 1.5.3
Author: WooThemes
Author URI: http://www.woothemes.com/
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand All @@ -28,10 +28,14 @@

require_once( 'classes/class-woothemes-sensei.php' );
require_once( 'inc/woo-functions.php' );
if ( ! is_admin() ) require_once( 'inc/woothemes-sensei-template.php' );
global $woothemes_sensei;
require_once( 'inc/woothemes-sensei-functions.php' );
if ( ! is_admin() ) {
require_once( 'inc/woothemes-sensei-template.php' );
}

global $woothemes_sensei;
$woothemes_sensei = new WooThemes_Sensei( __FILE__ );
$woothemes_sensei->version = '1.5.2';
$woothemes_sensei->version = '1.5.3';

/**
* Plugin updates
Expand Down

0 comments on commit 434a7a5

Please sign in to comment.