/**
 * Template for displaying the enroll button
 *
 * @author  ThimPress
 * @package LearnPress/Templates
 * @version 1.0
 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
global $course;
if (!$course->is_required_enroll()) {
    return;
}
$course_status = learn_press_get_user_course_status();
$user = learn_press_get_current_user();
// only show enroll button if user had not enrolled
$purchase_button_text = apply_filters('learn_press_purchase_button_text', __('Buy this course', 'learn_press'));
$enroll_button_text = apply_filters('learn_press_enroll_button_loading_text', __('Enroll', 'learn_press'));
if ($user->has('enrolled-course', $course->id)) {
    ?>

	<?php 
    learn_press_display_message(__('You have already enrolled this course', 'learn_press'));
    ?>

<?php 
} else {
    ?>
	<?php 
Beispiel #2
0
/**
 * Template for displaying the students of a course
 */
learn_press_prevent_access_directly();
do_action('learn_press_before_course_students');
?>
<span class="course-students">
    <?php 
do_action('learn_press_begin_course_students');
?>
    <?php 
if ($count = learn_press_count_students_enrolled()) {
    ?>
        <?php 
    if (strtolower(learn_press_get_user_course_status()) == 'completed') {
        ?>
            <?php 
        if ($count == 1) {
            ?>
                <?php 
            _e('You enrolled', 'learn_press');
            ?>
            <?php 
        } else {
            ?>
            <?php 
            printf(_nx('You and one student enrolled', 'You and %1$s students enrolled', intval($count - 1), '', 'learn_press'), $count - 1);
            ?>
            <?php 
        }
Beispiel #3
0
<div class="course-status">
<?php 
printf(__('You have taken this course but it\'s status is %s', 'learn_press'), learn_press_get_user_course_status());
?>
</div>
 /**
  * Display course status message     
  */
 function learn_press_course_status_message()
 {
     $course_status = learn_press_get_user_course_status();
     // only show enroll button if user had not enrolled
     if ($course_status && 'completed' != strtolower($course_status)) {
         learn_press_get_template('course/course-pending.php');
     }
 }