tools
4 years ago
add_new_instructor.php
4 years ago
addons.php
4 years ago
announcements.php
4 years ago
answer.php
4 years ago
course-list.php
4 years ago
enable_disable_addons.php
4 years ago
get-pro.php
5 years ago
instructors.php
4 years ago
question_answer.php
4 years ago
quiz_attempts.php
4 years ago
students.php
4 years ago
tools.php
4 years ago
tutor-pro-addons.php
4 years ago
uninstall.php
4 years ago
view_attempt.php
4 years ago
welcome.php
4 years ago
withdraw_requests.php
4 years ago
question_answer.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package @TUTOR |
| 4 | * @since v.1.0.0 |
| 5 | */ |
| 6 | |
| 7 | use TUTOR\Input; |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | if ( Input::has( 'question_id' ) ){ |
| 14 | tutor_load_template_from_custom_path(tutor()->path . '/views/qna/qna-single.php', array( |
| 15 | 'question_id' => Input::get( 'question_id' ), |
| 16 | 'context' => 'backend-dashboard-qna-single' |
| 17 | )); |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | $qna_object = new \TUTOR\Question_Answers_List(false); |
| 22 | $qna = $qna_object->get_items($_GET); |
| 23 | $qna_list = $qna['items']; |
| 24 | $qna_pagination = $qna['pagination']; |
| 25 | |
| 26 | $filters = array( |
| 27 | 'bulk_action' => true, |
| 28 | 'bulk_actions' => $qna_object->get_bulk_actions(), |
| 29 | 'ajax_action' => 'tutor_qna_bulk_action', |
| 30 | 'filters' => true, |
| 31 | 'course_filter' => true, |
| 32 | ); |
| 33 | |
| 34 | /** |
| 35 | * Determine active tab |
| 36 | */ |
| 37 | |
| 38 | $active_tab = Input::get( 'tab', 'all' ); |
| 39 | |
| 40 | $navbar_data = array( |
| 41 | 'page_title' => __('Question & Answer', 'tutor'), |
| 42 | 'tabs' => \Tutor\Q_and_A::tabs_key_value(), |
| 43 | 'active' => $active_tab, |
| 44 | ); |
| 45 | ?> |
| 46 | |
| 47 | <div class="tutor-admin-wrap"> |
| 48 | <?php |
| 49 | /** |
| 50 | * Load Templates with data. |
| 51 | */ |
| 52 | $navbar_template = tutor()->path . 'views/elements/navbar.php'; |
| 53 | $filters_template = tutor()->path . 'views/elements/filters.php'; |
| 54 | tutor_load_template_from_custom_path( $navbar_template, $navbar_data ); |
| 55 | tutor_load_template_from_custom_path( $filters_template, $filters ); |
| 56 | ?> |
| 57 | <div class="tutor-admin-body"> |
| 58 | <div class="tutor-mt-24"> |
| 59 | <?php |
| 60 | tutor_load_template_from_custom_path(tutor()->path . '/views/qna/qna-table.php', array( |
| 61 | 'qna_list' => $qna_list, |
| 62 | 'context' => 'backend-dashboard-qna-table', |
| 63 | 'qna_pagination' => $qna_pagination |
| 64 | )); |
| 65 | ?> |
| 66 | </div> |
| 67 | </div> |
| 68 | </div> |