alert.php
4 years ago
attachments.php
4 years ago
course-archive-filter-bar.php
4 years ago
tutor-text-editor.php
4 years ago
attachments.php
50 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display attachments |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * @author themeum |
| 7 | * @url https://themeum.com |
| 8 | * |
| 9 | * @package TutorLMS/Templates |
| 10 | * @version 1.4.3 |
| 11 | */ |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; |
| 15 | } |
| 16 | |
| 17 | $attachments = tutor_utils()->get_attachments(); |
| 18 | $open_mode_view = apply_filters( 'tutor_pro_attachment_open_mode', null ) == 'view' ? ' target="_blank" ' : null; |
| 19 | |
| 20 | do_action( 'tutor_global/before/attachments' ); |
| 21 | |
| 22 | if ( is_array( $attachments ) && count( $attachments ) ) { |
| 23 | ?> |
| 24 | <div class="tutor-exercise-files tutor-mt-20"> |
| 25 | <?php |
| 26 | foreach ($attachments as $attachment){ |
| 27 | ?> |
| 28 | <a href="<?php echo esc_url( $attachment->url ); ?>" <?php echo ($open_mode_view ? $open_mode_view : ' download="'.$attachment->name.'" ' ); ?>> |
| 29 | <div class="tutor-instructor-card tutor-mb-12"> |
| 30 | <div class="tutor-icard-content"> |
| 31 | <h6 class="tutor-name tutor-fs-6 tutor-fw-normal tutor-color-black-70"> |
| 32 | <?php echo esc_html( $attachment->name ); ?> |
| 33 | </h6> |
| 34 | <div class="text-regular-small"> |
| 35 | <?php echo esc_html( $attachment->size ); ?> |
| 36 | </div> |
| 37 | </div> |
| 38 | <div class="tutor-avatar tutor-is-xs flex-center tutor-flex-shrink-0"> |
| 39 | <span class="tutor-icon-24 tutor-icon-download-line tutor-color-design-brand"></span> |
| 40 | </div> |
| 41 | </div> |
| 42 | </a> |
| 43 | <?php } ?> |
| 44 | </div> |
| 45 | <?php } else { |
| 46 | tutor_utils()->tutor_empty_state(__('No Attachment Found', 'tutor')); |
| 47 | } |
| 48 | |
| 49 | do_action( 'tutor_global/after/attachments' ); ?> |
| 50 |