Addons.php
4 years ago
Admin.php
4 years ago
Ajax.php
4 years ago
Announcements.php
4 years ago
Assets.php
4 years ago
Backend_Page_Trait.php
4 years ago
Course.php
4 years ago
Course_Filter.php
4 years ago
Course_List.php
4 years ago
Course_Settings_Tabs.php
4 years ago
Course_Widget.php
4 years ago
Custom_Validation.php
5 years ago
Dashboard.php
4 years ago
FormHandler.php
4 years ago
Frontend.php
4 years ago
Gutenberg.php
4 years ago
Instructor.php
4 years ago
Instructors_List.php
4 years ago
Lesson.php
4 years ago
Options_V2.php
4 years ago
Post_types.php
4 years ago
Private_Course_Access.php
4 years ago
Q_and_A.php
4 years ago
Question_Answers_List.php
4 years ago
Quiz.php
4 years ago
Quiz_Attempts_List.php
4 years ago
RestAPI.php
4 years ago
Reviews.php
4 years ago
Rewrite_Rules.php
4 years ago
Shortcode.php
4 years ago
Student.php
4 years ago
Students_List.php
4 years ago
Taxonomies.php
4 years ago
Template.php
4 years ago
Theme_Compatibility.php
5 years ago
Tools.php
4 years ago
Tools_V2.php
4 years ago
Tutor.php
4 years ago
TutorEDD.php
4 years ago
Tutor_Base.php
5 years ago
Tutor_List_Table.php
4 years ago
Tutor_Setup.php
4 years ago
Upgrader.php
4 years ago
User.php
4 years ago
Utils.php
4 years ago
Video_Stream.php
4 years ago
Withdraw.php
4 years ago
Withdraw_Requests_List.php
4 years ago
WooCommerce.php
4 years ago
Question_Answers_List.php
56 lines
| 1 | <?php |
| 2 | namespace TUTOR; |
| 3 | |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | exit; |
| 6 | } |
| 7 | |
| 8 | class Question_Answers_List { |
| 9 | |
| 10 | use Backend_Page_Trait; |
| 11 | |
| 12 | const Question_Answer_PAGE = 'question_answer'; |
| 13 | |
| 14 | function __construct($register_hook=true) { |
| 15 | if(!$register_hook) { |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | } |
| 20 | |
| 21 | |
| 22 | function get_items($args=array()) { |
| 23 | $per_page = tutor_utils()->get_option( 'pagination_per_page' ); |
| 24 | |
| 25 | $search_term = ''; |
| 26 | if (isset($args['search'])){ |
| 27 | $search_term = sanitize_text_field($args['search']); |
| 28 | } |
| 29 | if(isset($args['tab']) && 'all' === $args['tab']){ |
| 30 | $args['no_archive'] = false; |
| 31 | } |
| 32 | |
| 33 | $current_page = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; |
| 34 | |
| 35 | $question_status= !empty($args['tab']) ? $args['tab'] : null; |
| 36 | $items = tutor_utils()->get_qa_questions(($current_page-1)*$per_page, $per_page, $search_term, null, null, null, $question_status, false, $args); |
| 37 | $total_items = tutor_utils()->get_qa_questions(($current_page-1)*$per_page, $per_page, $search_term, null, null, null, $question_status, true, $args); |
| 38 | |
| 39 | return array( |
| 40 | 'items' => $items, |
| 41 | 'pagination' => array( |
| 42 | 'total_items' => $total_items, |
| 43 | 'per_page' => $per_page, |
| 44 | 'paged' => $current_page |
| 45 | ) |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | public function get_bulk_actions() { |
| 50 | return array( |
| 51 | $this->bulk_action_default(), |
| 52 | $this->bulk_action_delete() |
| 53 | ); |
| 54 | } |
| 55 | } |
| 56 |