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.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / archive-course-init.php
tutor / templates Last commit date
course-filter 4 years ago dashboard 4 years ago email 4 years ago global 4 years ago instructor 4 years ago loop 4 years ago modal 4 years ago profile 4 years ago shortcode 4 years ago single 4 years ago template-part 4 years ago widget 4 years ago archive-course-init.php 4 years ago archive-course.php 4 years ago course-none.php 4 years ago dashboard.php 4 years ago feature_disabled.php 4 years ago instructor-setting.php 4 years ago login-form.php 4 years ago login.php 4 years ago permission-denied.php 4 years ago public-profile.php 4 years ago single-assignment.php 4 years ago single-content-loader.php 4 years ago single-course.php 4 years ago single-lesson.php 4 years ago single-preview-lesson.php 4 years ago single-quiz.php 4 years ago template.php 4 years ago
archive-course-init.php
149 lines
1 <?php
2 // Initialize argument variables
3 !isset($course_filter) ? $course_filter = false : 0;
4 !isset($supported_filters) ? $supported_filters = tutor_utils()->get_option( 'supported_course_filters', array() ) : 0;
5 !isset($loop_content_only) ? $loop_content_only = false : 0;
6 !isset($column_per_row) ? $column_per_row = tutor_utils()->get_option( 'courses_col_per_row', 3 ) : 0;
7 !isset($course_per_page) ? $course_per_page = tutor_utils()->get_option( 'courses_per_page', 12 ) : 0;
8 !isset($show_pagination) ? $show_pagination = true : 0;
9 !isset($current_page) ? $current_page = 1 : 0;
10
11 // Hide pagination is there is no page after first one
12 $pages_count = 0;
13 if(isset($the_query)){
14 $pages_count = $the_query->max_num_pages;
15 } else {
16 global $wp_query;
17 $pages_count = $wp_query->max_num_pages;
18 }
19 $pages_count<2 ? $show_pagination=false : 0;
20
21 // Set in global variable to avoid too many stack to pass to other templates
22 $GLOBALS['tutor_course_archive_arg'] = compact(
23 'course_filter',
24 'supported_filters',
25 'loop_content_only',
26 'column_per_row',
27 'course_per_page',
28 'show_pagination'
29 );
30
31 // Render the loop
32 ob_start();
33 do_action( 'tutor_course/archive/before_loop' );
34
35 if ( (isset($the_query) && $the_query->have_posts()) || have_posts() ) {
36 /* Start the Loop */
37
38 tutor_course_loop_start();
39
40 while ( isset($the_query) ? $the_query->have_posts() : have_posts() ){
41 isset($the_query) ? $the_query->the_post() : the_post();
42
43 /**
44 * @hook tutor_course/archive/before_loop_course
45 * @type action
46 * Usage Idea, you may keep a loop within a wrap, such as bootstrap col
47 */
48 do_action( 'tutor_course/archive/before_loop_course' );
49
50 tutor_load_template( 'loop.course' );
51
52 /**
53 * @hook tutor_course/archive/after_loop_course
54 * @type action
55 * Usage Idea, If you start any div before course loop, you can end it here, such as </div>
56 */
57 do_action( 'tutor_course/archive/after_loop_course' );
58 }
59
60 tutor_course_loop_end();
61 } else {
62
63 /**
64 * No course found
65 */
66 // tutor_load_template('course-none');
67 tutor_utils()->tutor_empty_state( tutor_utils()->not_found_text() );
68 }
69
70 do_action( 'tutor_course/archive/after_loop' );
71
72 if($show_pagination) {
73 // Load the pagination now
74 global $wp_query;
75
76 $current_url = wp_doing_ajax() ? $_SERVER['HTTP_REFERER'] : tutor()->current_url;
77 $push_link = add_query_arg( array_merge( $_POST, $GLOBALS['tutor_course_archive_arg'] ), $current_url );
78
79 $data = wp_doing_ajax( ) ? $_POST : $_GET;
80 $pagination_data = array(
81 'total_page' => isset($the_query) ? $the_query->max_num_pages : $wp_query->max_num_pages,
82 'per_page' => $course_per_page,
83 'paged' => $current_page,
84 'data_set' => array('push_state_link'=>$push_link),
85 'ajax' => array_merge($data, array(
86 'loading_container' => '.tutor-course-filter-loop-container',
87 'action' => 'tutor_course_filter_ajax',
88 ))
89 );
90
91 tutor_load_template_from_custom_path(
92 tutor()->path . 'templates/dashboard/elements/pagination.php',
93 $pagination_data
94 );
95 }
96
97 $course_loop = ob_get_clean();
98
99 if (isset($loop_content_only) && $loop_content_only==true) {
100 echo $course_loop;
101 return;
102 }
103
104 $course_archive_arg = isset($GLOBALS['tutor_course_archive_arg']) ? $GLOBALS['tutor_course_archive_arg']['column_per_row'] : null;
105 $columns = $course_archive_arg === null ? tutor_utils()->get_option( 'courses_col_per_row', 3 ) : $course_archive_arg;
106 $has_course_filters = $course_filter && count($supported_filters);
107
108 $supported_filters_keys = array_keys( $supported_filters );
109 ?>
110
111 <div class="tutor-wrap tutor-wrap-parent tutor-courses-wrap tutor-container course-archive-page" data-tutor_courses_meta="<?php echo esc_attr( json_encode($GLOBALS['tutor_course_archive_arg']) ); ?>">
112 <?php if ( $has_course_filters && in_array( 'search', $supported_filters_keys ) ) : ?>
113 <div class="tutor-d-block tutor-d-lg-none tutor-mb-32">
114 <div class="tutor-d-flex tutor-align-center tutor-justify-between">
115 <span class="tutor-fs-3 tutor-fw-medium tutor-color-black"><?php _e("Courses", "tutor"); ?></span>
116 <a href="#" class="tutor-iconic-btn tutor-iconic-btn-secondary tutor-iconic-btn-md" tutor-toggle-course-filter><span class="tutor-icon-slider-vertical"></span></a>
117 </div>
118 </div>
119 <?php endif; ?>
120
121 <div class="tutor-row tutor-gx-xl-5">
122 <?php if ( $has_course_filters ): ?>
123 <div class="tutor-col-3 tutor-course-filter-container">
124 <div class="tutor-course-filter" tutor-course-filter>
125 <?php tutor_load_template('course-filter.filters'); ?>
126 </div>
127 </div>
128
129 <?php if ( $columns < 3 ) : ?>
130 <div class="tutor-col-1 tutor-d-none tutor-d-xl-block" area-hidden="true"></div>
131 <?php endif; ?>
132
133 <div class="tutor-col-lg-9 tutor-col-xl-<?php echo $columns < 3 ? 8 : 9; ?> tutor-pagination-wrapper-replaceable" tutor-course-list-container>
134 <?php echo $course_loop; ?>
135 </div>
136 <?php else: ?>
137 <div class="tutor-col-12 tutor-pagination-wrapper-replaceable" tutor-course-list-container>
138 <?php echo $course_loop; ?>
139 </div>
140 <?php endif; ?>
141 </div>
142 </div>
143
144
145 <?php
146 if ( ! is_user_logged_in() ) {
147 tutor_load_template_from_custom_path( tutor()->path . '/views/modal/login.php' );
148 }
149 ?>