common
3 years ago
basic.php
3 years ago
buddypress.php
3 years ago
color_picker.php
3 years ago
design.php
3 years ago
google_classroom.php
3 years ago
gradebook.php
3 years ago
import_export.php
3 years ago
notifications.php
3 years ago
status.php
3 years ago
tab.php
3 years ago
tutor_pages.php
3 years ago
zoom.php
4 years ago
import_export.php
146 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Import export tools view |
| 4 | * |
| 5 | * @package Tutor\Views |
| 6 | * @subpackage Tutor\Tools |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 2.0.0 |
| 10 | */ |
| 11 | |
| 12 | ?> |
| 13 | <div class="tutor-option-main-title"> |
| 14 | <div class="tutor-fs-4 tutor-fw-medium tutor-color-black"> |
| 15 | <?php esc_html_e( 'Import/Export', 'tutor' ); ?> |
| 16 | </div> |
| 17 | </div> |
| 18 | |
| 19 | <?php |
| 20 | tutor_alert( |
| 21 | __( 'Warning: Importing, Restoring, or Resetting will overwrite ALL existing settings. Please proceed with caution.', 'tutor' ), |
| 22 | 'warning' |
| 23 | ); |
| 24 | ?> |
| 25 | |
| 26 | <div class="tutor-option-single-item tutor-mb-32"> |
| 27 | <div class="tutor-option-group-title tutor-mb-16"> |
| 28 | <div class="tutor-fs-6 tutor-color-muted"><?php esc_html_e( 'Export', 'tutor' ); ?></div> |
| 29 | </div> |
| 30 | |
| 31 | <div class="item-wrapper"> |
| 32 | <div class="tutor-option-field-row"> |
| 33 | <div class="tutor-option-field-label"> |
| 34 | <div class="label tutor-fs-6 tutor-color-black"><?php esc_html_e( 'Current Settings', 'tutor' ); ?></div> |
| 35 | <div class="desc tutor-fs-8 tutor-fw-medium tutor-color-secondary"> |
| 36 | <span style="font-weight: 500"><?php esc_html_e( 'Last Update', 'tutor' ); ?>: </span> <?php echo esc_html( get_option( 'tutor_option_update_time' ) ); ?> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="tutor-option-field-input"> |
| 40 | <button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm" id="export_settings"><?php esc_html_e( 'Export Settings', 'tutor' ); ?></button> |
| 41 | </div> |
| 42 | </div> |
| 43 | </div> |
| 44 | </div> |
| 45 | |
| 46 | <div class="tutor-option-single-item tutor-mb-32 item-variation-dragndrop import-setting"> |
| 47 | <div class="tutor-option-group-title tutor-mb-16"> |
| 48 | <div class="tutor-fs-6 tutor-color-muted"><?php esc_html_e( 'Import Settings', 'tutor' ); ?></div> |
| 49 | </div> |
| 50 | <!-- @todo: fix the upload button --> |
| 51 | <div class="item-wrapper"> |
| 52 | <div class="tutor-option-field-row tutor-d-block"> |
| 53 | <div class="tutor-option-field-label"> |
| 54 | <div class="drag-drop-zone"> |
| 55 | <span class="tutor-icon-upload tutor-fs-1 tutor-color-primary"></span> |
| 56 | <div class="title"><?php esc_html_e( 'Drag & Drop your JSON File here', 'tutor' ); ?> </div> |
| 57 | <div class="subtitle"><span><?php esc_html_e( 'File Format', 'tutor' ); ?>:</span> .json <br> <?php esc_html_e( 'Or', 'tutor' ); ?></div> |
| 58 | <label for="drag-drop-input" class="tutor-btn tutor-btn-primary tutor-btn-sm"> |
| 59 | <input type="file" name="drag-drop-input" id="drag-drop-input" class="tutor-d-none"> |
| 60 | <span><?php esc_html_e( 'Browse File', 'tutor' ); ?></span> |
| 61 | </label> |
| 62 | <span class="file-info"></span> |
| 63 | </div> |
| 64 | </div> |
| 65 | <div class="tutor-option-field-input tutor-mt-16"> |
| 66 | <button class="tutor-btn tutor-btn-primary tutor-btn-md tutor_import_options" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="<?php esc_attr_e( 'Yes, Import Settings', 'tutor' ); ?>" data-heading="<?php esc_attr_e( 'Import from Previous Settings?', 'tutor' ); ?>" data-message="<?php esc_attr_e( 'WARNING! This will overwrite all existing settings, please proceed with caution.', 'tutor' ); ?>" id="import_options"><?php esc_html_e( 'Update Settings', 'tutor' ); ?></button> |
| 67 | </div> |
| 68 | </div> |
| 69 | </div> |
| 70 | </div> |
| 71 | |
| 72 | <div class="tutor-option-single-item tutor-mb-32 item-variation-table settings-history"> |
| 73 | <div class="tutor-option-group-title tutor-mb-16"> |
| 74 | <div class="tutor-fs-6 tutor-color-muted"><?php esc_attr_e( 'Settings History', 'tutor' ); ?></div> |
| 75 | </div> |
| 76 | <div class="item-wrapper history_data"> |
| 77 | <div class="tutor-option-field-row"> |
| 78 | <div class="tutor-option-field-label"> |
| 79 | <?php esc_attr_e( 'Date', 'tutor' ); ?> |
| 80 | </div> |
| 81 | </div> |
| 82 | <?php if ( $tutor_options = get_option( 'tutor_settings_log', array() ) ) : ?> |
| 83 | <?php |
| 84 | foreach ( $tutor_options as $key => $option_data ) : |
| 85 | $datetypeClass = 'saved' == $option_data['datatype'] ? ' label-primary' : ' label-refund'; |
| 86 | ?> |
| 87 | <div class="tutor-option-field-row"> |
| 88 | <div class="tutor-option-field-label"> |
| 89 | <div class="tutor-fs-7 tutor-fw-medium"> |
| 90 | <?php echo esc_html( $option_data['history_date'] ); ?> |
| 91 | <span class="tutor-badge-label tutor-ml-16<?php echo esc_attr( $datetypeClass ); ?>"> <?php echo esc_html( ucwords( $option_data['datatype'] ) ); ?></span> |
| 92 | </div> |
| 93 | </div> |
| 94 | <div class="tutor-option-field-input"> |
| 95 | <button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm apply_settings" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="<?php esc_attr_e( 'Yes, Restore Settings', 'tutor' ); ?>" data-heading="<?php esc_attr_e( 'Restore Previous Settings?', 'tutor' ); ?>" data-message="<?php esc_attr_e( 'WARNING! This will overwrite all existing settings, please proceed with caution.', 'tutor' ); ?>" data-id="<?php echo esc_attr( $key ); ?>"><?php esc_html_e( 'Apply', 'tutor' ); ?></button> |
| 96 | <div class="tutor-dropdown-parent tutor-ml-16"> |
| 97 | <button type="button" class="tutor-iconic-btn" action-tutor-dropdown="toggle"> |
| 98 | <span class="tutor-icon-kebab-menu" area-hidden="true"></span> |
| 99 | </button> |
| 100 | <ul class="tutor-dropdown tutor-dropdown-dark tutor-text-left"> |
| 101 | <li> |
| 102 | <a href="javascript:;" class="tutor-dropdown-item export_single_settings" data-id="<?php echo esc_attr( $key ); ?>"> |
| 103 | <span class="tutor-icon-archive tutor-mr-8" area-hidden="true"></span> |
| 104 | <span><?php esc_html_e( 'Download', 'tutor' ); ?></span> |
| 105 | </a> |
| 106 | </li> |
| 107 | <li> |
| 108 | <a href="javascript:;" class="tutor-dropdown-item delete_single_settings" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="<?php esc_attr_e( 'Yes, Delete Settings', 'tutor' ); ?>" data-heading="<?php esc_attr_e( 'Delete This Settings?', 'tutor' ); ?>" data-message="<?php esc_attr_e( 'WARNING! This will remove the settings history data from your system, please proceed with caution.', 'tutor' ); ?>" data-id="<?php echo esc_attr( $key ); ?>"> |
| 109 | <span class="icon tutor-icon-trash-can-bold tutor-mr-8" area-hidden="true"></span> |
| 110 | <span><?php esc_html_e( 'Delete', 'tutor' ); ?></span> |
| 111 | </a> |
| 112 | </li> |
| 113 | </ul> |
| 114 | </div> |
| 115 | </div> |
| 116 | </div> |
| 117 | <?php endforeach; ?> |
| 118 | <?php else : ?> |
| 119 | <div class="tutor-option-field-row"> |
| 120 | <div class="tutor-option-field-label"> |
| 121 | <div class="tutor-fs-7 tutor-fw-medium"><?php esc_html_e( 'No settings data found.', 'tutor' ); ?></div> |
| 122 | </div> |
| 123 | </div> |
| 124 | <?php endif; ?> |
| 125 | </div> |
| 126 | </div> |
| 127 | |
| 128 | <div class="tutor-option-single-item tutor-mb-32"> |
| 129 | <div class="tutor-option-group-title tutor-mb-16"> |
| 130 | <div class="tutor-fs-6 tutor-color-muted"><?php esc_html_e( 'Reset Settings', 'tutor' ); ?></div> |
| 131 | </div> |
| 132 | <div class="item-wrapper"> |
| 133 | <div class="tutor-option-field-row"> |
| 134 | <div class="tutor-option-field-label"> |
| 135 | <div class="tutor-fs-6 tutor-color-black"><?php esc_html_e( 'Reset Everything to Default', 'tutor' ); ?></div> |
| 136 | <div class="tutor-fs-7 tutor-fw-medium tutor-color-secondary"> |
| 137 | <span class="tutor-fw-medium"><?php esc_html_e( 'It will revert all settings to initial setup.', 'tutor' ); ?></span> |
| 138 | </div> |
| 139 | </div> |
| 140 | <div class="tutor-option-field-input"> |
| 141 | <button class="tutor-btn tutor-btn-outline-primary tutor-btn-sm tutor-reset-all" data-tutor-modal-target="tutor-modal-bulk-action" data-btntext="<?php esc_attr_e( 'Yes, Reset Settings', 'tutor' ); ?>" data-heading="<?php esc_attr_e( 'Reset All Settings?', 'tutor' ); ?>" data-message="<?php esc_attr_e( 'WARNING! This will reset all settings to default, please proceed with caution.', 'tutor' ); ?>" id="reset_options"><?php esc_html_e( 'Reset All Settings', 'tutor' ); ?></button> |
| 142 | </div> |
| 143 | </div> |
| 144 | </div> |
| 145 | </div> |
| 146 |