Ajax::open_review_update_modal()
Opening update modal from the dashboard
Description
See also
Source
File: classes/Ajax.php
public function open_review_update_modal() { $review_id = dozent_input_text( 'review_id' ); $review = dozent_get_review( $review_id ); if ( ! $review ) { wp_send_json_error(); } ob_start(); ?> <div class="modal-content"> <div class="modal-header dozent-mb-2"> <h5 class="modal-title"> <i class="dicon-graduation-cap"></i> <?php echo $review->course_title; ?> </h5> <a href="javascript:;" class="dozent-modal-close" data-dismiss="dozent-modal"> <i class="dicon-close"></i> </a> </div> <form action="" class="dozent-modal-review-form" method="post"> <div class="modal-body"> <div id="review-writing-box" class="course-review-write-box-wrap"> <input type="hidden" name="course_id" value="<?php echo $review->course_id; ?>"> <?php dozent_rating_field( $review->rating ); ?> <div class="form-group"> <textarea name="review" class="form-control" rows="4"><?php echo $review ? $review->review : ''; ?></textarea> </div> </div> </div> <div class="review-modal-footer"> <p class="review-modal-nofity-text"> <i class="dicon-earth"></i> <?php _e( 'Your review will be posted publicly. Under', 'dozent' ); ?> <strong> <?php echo $review->user_display_name; ?> </strong> </p> <button type="submit" class="dozent-btn dozent-btn-primary"> <i class="dicon-comment"></i> <?php _e( 'Update review', 'dozent' ); ?> </button> <button type="button" class="dozent-btn dozent-btn-light" data-dismiss="dozent-modal"> <?php _e( 'Cancel', 'dozent' ); ?> </button> </div> </form> </div> <?php $html = ob_get_clean(); wp_send_json_success( [ 'html' => $html ] ); }
Changelog
Version | Description |
---|---|
DozentLMS 1.0.0 | Introduced. |