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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 / dashboard / announcements.php
tutor / templates / dashboard Last commit date
announcements 1 year ago assignments 8 months ago elements 1 year ago enrolled-courses 3 years ago instructor 2 years ago my-courses 1 year ago my-quiz-attempts 3 years ago notifications 3 years ago question-answer 1 year ago quiz-attempts 3 years ago reviews 3 years ago settings 1 year ago withdraw-method-fields 3 years ago announcements.php 1 year ago assignments.php 11 months ago create-course.php 1 year ago dashboard.php 8 months ago enrolled-courses.php 8 months ago index.php 3 years ago logged-in.php 3 years ago my-courses.php 8 months ago my-profile.php 9 months ago my-quiz-attempts.php 3 years ago purchase_history.php 10 months ago question-answer.php 11 months ago quiz-attempts.php 1 year ago registration.php 2 years ago reviews.php 3 years ago settings.php 1 year ago wishlist.php 1 year ago withdraw.php 1 year ago
announcements.php
139 lines
1 <?php
2 /**
3 * Template for displaying Announcements
4 *
5 * @package Tutor\Templates
6 * @subpackage Dashboard
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.7.9
10 */
11
12 use TUTOR\Input;
13 use Tutor\Models\CourseModel;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 $per_page = tutor_utils()->get_option( 'pagination_per_page', 10 );
20 $paged = max( 1, Input::get( 'current_page', 1, Input::TYPE_INT ) );
21
22 $order_filter = Input::get( 'order', 'DESC' );
23 $search_filter = Input::get( 'search', '' );
24
25 // Announcement's parent.
26 $course_id = Input::get( 'course-id', '' );
27 $date_filter = Input::get( 'date', '' );
28
29 $year = date( 'Y', strtotime( $date_filter ) );
30 $month = date( 'm', strtotime( $date_filter ) );
31 $day = date( 'd', strtotime( $date_filter ) );
32
33 $args = array(
34 'post_type' => 'tutor_announcements',
35 'post_status' => 'publish',
36 's' => sanitize_text_field( $search_filter ),
37 'post_parent' => sanitize_text_field( $course_id ),
38 'posts_per_page' => sanitize_text_field( $per_page ),
39 'paged' => sanitize_text_field( $paged ),
40 'orderBy' => 'ID',
41 'order' => sanitize_text_field( $order_filter ),
42
43 );
44 if ( ! empty( $date_filter ) ) {
45 $args['date_query'] = array(
46 array(
47 'year' => $year,
48 'month' => $month,
49 'day' => $day,
50 ),
51 );
52 }
53 if ( ! current_user_can( 'administrator' ) ) {
54 $args['author'] = get_current_user_id();
55 }
56 $the_query = new WP_Query( $args );
57
58 // Get courses.
59 $courses = ( current_user_can( 'administrator' ) ) ? CourseModel::get_courses() : CourseModel::get_courses_by_instructor();
60 $image_base = tutor()->url . '/assets/images/';
61 ?>
62
63 <div class="tutor-card tutor-p-24">
64 <div class="tutor-row tutor-align-lg-center">
65 <div class="tutor-col-lg-auto tutor-mb-16 tutor-mb-lg-0">
66 <div class="tutor-round-box tutor-p-8">
67 <i class="tutor-icon-bullhorn tutor-fs-3" area-hidden="true"></i>
68 </div>
69 </div>
70
71 <div class="tutor-col tutor-mb-16 tutor-mb-lg-0">
72 <div class="tutor-fs-6 tutor-color-muted tutor-mb-4">
73 <?php esc_html_e( 'Create Announcement', 'tutor' ); ?>
74 </div>
75 <div class="tutor-fs-5 tutor-color-black">
76 <?php esc_html_e( 'Notify all students of your course', 'tutor' ); ?>
77 </div>
78 </div>
79
80 <div class="tutor-col-lg-auto">
81 <button type="button" class="tutor-btn tutor-btn-primary" data-tutor-modal-target="tutor_announcement_new">
82 <?php esc_html_e( 'Add New Announcement', 'tutor' ); ?>
83 </button>
84 </div>
85 </div>
86 </div>
87
88 <div class="tutor-row tutor-mb-32 tutor-mt-44" style="width: calc(100% + 30px);">
89 <div class="tutor-col-12 tutor-col-lg-6 tutor-mt-12 tutor-mt-lg-0">
90 <label class="tutor-d-block tutor-mb-12 tutor-form-label">
91 <?php esc_html_e( 'Courses', 'tutor' ); ?>
92 </label>
93 <select class="tutor-form-select tutor-announcement-course-sorting" data-searchable>
94 <option value=""><?php esc_html_e( 'All', 'tutor' ); ?></option>
95 <?php if ( $courses ) : ?>
96 <?php foreach ( $courses as $course ) : ?>
97 <option value="<?php echo esc_attr( $course->ID ); ?>" <?php selected( $course_id, $course->ID, 'selected' ); ?>>
98 <?php echo esc_html( $course->post_title ); ?>
99 </option>
100 <?php endforeach; ?>
101 <?php else : ?>
102 <option value=""><?php esc_html_e( 'No course found', 'tutor' ); ?></option>
103 <?php endif; ?>
104 </select>
105 </div>
106
107 <div class="tutor-col-6 tutor-col-lg-3 tutor-mt-12 tutor-mt-lg-0">
108 <label class="tutor-d-block tutor-mb-12 tutor-form-label"><?php esc_html_e( 'Sort By', 'tutor' ); ?></label>
109 <select class="tutor-form-select tutor-announcement-order-sorting tutor-form-control-sm" data-search="no">
110 <option <?php selected( $order_filter, 'ASC' ); ?>><?php esc_html_e( 'ASC', 'tutor' ); ?></option>
111 <option <?php selected( $order_filter, 'DESC' ); ?>><?php esc_html_e( 'DESC', 'tutor' ); ?></option>
112 </select>
113 </div>
114
115 <div class="tutor-col-6 tutor-col-lg-3 tutor-mt-12 tutor-mt-lg-0">
116 <label class="tutor-form-label tutor-d-block tutor-mb-12"><?php esc_html_e( 'Date', 'tutor' ); ?></label>
117 <div class="tutor-v2-date-picker">
118 <div class="tutor-form-wrap">
119 <span class="tutor-form-icon tutor-form-icon-reverse">
120 <span class="tutor-icon-calender-line" aria-hidden="true"></span>
121 </span>
122 <input class="tutor-form-control" placeholder="<?php esc_attr_e( 'Loading...', 'tutor' ); ?>">
123 </div>
124 </div>
125 </div>
126 </div>
127
128 <?php
129 $announcements = $the_query->have_posts() ? $the_query->posts : array();
130 tutor_load_template_from_custom_path(
131 tutor()->path . '/views/fragments/announcement-list.php',
132 array(
133 'announcements' => is_array( $announcements ) ? $announcements : array(),
134 'the_query' => $the_query,
135 'paged' => $paged,
136 )
137 );
138 ?>
139