</a>

									<?php 
        /* if (current_user_can('coursepress_change_course_status_cap') || ( current_user_can('coursepress_change_my_course_status_cap') && $course_details->post_author == get_current_user_id() )) { ?>
        	  <input type="submit" name="submit-unit-<?php echo ( $course_details->post_status == 'unpublished' ) ? 'publish' : 'unpublish'; ?>" class="button button-units button-<?php echo ( $course_details->post_status == 'unpublished' ) ? 'publish' : 'unpublish'; ?>" value="<?php echo ( $course_details->post_status == 'unpublished' ) ? __('Publish', 'cp') : __('Unpublish', 'cp'); ?>">
        	  <?php
        	  } */
    }
    ?>
							</div>
							<!-- /COURSE BUTTONS -->

							<!-- COURSE DETAILS -->
							<div class='course-details'>
								<?php 
    $wp_course_search = new Course_Search('', 1);
    if (CoursePress_Capabilities::can_create_course()) {
        if ($wp_course_search->is_light) {
            if ($wp_course_search->get_count_of_all_courses() < $wp_course_search->courses_per_page) {
                $not_limited = true;
            } else {
                $not_limited = false;
            }
        } else {
            $not_limited = true;
        }
    }
    if (isset($_GET['course_id']) || !isset($_GET['course_id']) && $not_limited) {
        ?>
									<!-- Course Overview -->
									<div class="course-section step step-1 <?php 
<?php

global $action, $page;
wp_reset_vars(array('action', 'page'));
$wp_course_search = new Course_Search();
if ($wp_course_search->is_light) {
    if ($wp_course_search->get_count_of_all_courses() >= 10 && !isset($_GET['course_id'])) {
        wp_redirect(admin_url('admin.php?page=courses'));
        exit;
    }
}
$unit_id = '';
$course_id = '';
if (isset($_GET['course_id']) && is_numeric($_GET['course_id'])) {
    $course_id = (int) $_GET['course_id'];
}
if (isset($_GET['unit_id']) && is_numeric($_GET['unit_id'])) {
    $unit_id = (int) $_GET['unit_id'];
}
$course = new Course($course_id);
if (empty($course)) {
    $course = new StdClass();
} else {
    $course_object = $course->get_course();
}
$units = $course->get_units();
$students_count = $course->get_number_of_students();
?>

<div class="wrap nosubsub course-details cp-wrap">
	<div class="icon32" id="icon-themes"><br></div>
示例#3
0
     }
 }
 // Query the courses
 if (isset($_GET['page_num'])) {
     $page_num = (int) $_GET['page_num'];
 } else {
     $page_num = 1;
 }
 if (isset($_GET['s'])) {
     $coursesearch = $_GET['s'];
 } else {
     $coursesearch = '';
 }
 $course_category = isset($_GET['course_category_filter']) ? (int) $_GET['course_category_filter'] : 0;
 $show_courses_per_page = isset($_GET['courses_per_page']) ? $_GET['courses_per_page'] : 10;
 $wp_course_search = new Course_Search($coursesearch, $page_num, $show_courses_per_page, $course_category);
 if (isset($_GET['course_id'])) {
     $course = new Course($_GET['course_id']);
 }
 if (isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['course_id']) && is_numeric($_GET['course_id'])) {
     if (!isset($_GET['cp_nonce']) || !wp_verify_nonce($_GET['cp_nonce'], 'delete_course_' . $_GET['course_id'])) {
         die(__('Cheating huh?', 'cp'));
     }
     $course_object = $course->get_course();
     if (CoursePress_Capabilities::can_delete_course($_GET['course_id'])) {
         $course->delete_course($force_delete = true);
         $message = __('Selected course has been deleted successfully.', 'cp');
     } else {
         $message = __("You don't have right permissions to delete the course.", 'cp');
     }
 }