AA-Template.php
4 months ago
backup-row-template.php
4 months ago
dropdown-template.php
4 months ago
exclusion-rule-template.php
4 months ago
option-template.php
4 months ago
premium-function-overlay.php
4 months ago
premium-overlay.php
4 months ago
staging-row-template.php
4 months ago
stg-option-template.php
4 months ago
backup-row-template.php
131 lines
| 1 | <?php |
| 2 | |
| 3 | // Namespace |
| 4 | namespace BMI\Plugin\Dashboard; |
| 5 | |
| 6 | use BMI\Plugin\Dashboard as Dashboard; |
| 7 | |
| 8 | // Exit on direct access |
| 9 | if (!defined('ABSPATH')) exit; |
| 10 | |
| 11 | $clouds = []; |
| 12 | $clouds["BACKUPBLISS"] = [ "name" => "BackupBliss", "icon" => "backupbliss-mono.svg"]; |
| 13 | $clouds["GDRIVE"] = [ "name" => "Google Drive", "icon" => "google-drive-mono.svg" ]; |
| 14 | $clouds["ONEDRIVE"] = [ "name" => "OneDrive", "icon" => "one-drive-mono.svg" ]; |
| 15 | $clouds["DROPBOX"] = [ "name" => "Dropbox", "icon" => "dropbox-mono.svg" ]; |
| 16 | $clouds["FTP"] = [ "name" => "FTP", "icon" => "ftp-mono.svg" ]; |
| 17 | $clouds["PCLOUD"] = [ "name" => "pCloud", "icon" => "pcloud-mono.svg" ]; |
| 18 | $clouds["AWS"] = [ "name" => "Amazon S3", "icon" => "amazon-s3-mono.svg" ]; |
| 19 | $clouds["WASABI"] = [ "name" => "Wasabi", "icon" => "wasabi-s3-mono.svg" ]; |
| 20 | $clouds["SFTP"] = [ "name" => "SFTP", "icon" => "sftp-mono.svg" ]; |
| 21 | |
| 22 | |
| 23 | foreach ($clouds as $cloudKey => $cloudDetail) { |
| 24 | if (!defined('BMI_PRO_INC') && !in_array($cloudKey, ["BACKUPBLISS", "DROPBOX", "GDRIVE", "FTP", "AWS", "WASABI"])) { |
| 25 | $clouds[$cloudKey]["tooltip"] = __('%sNever lose a backup by also saving it on ' . $cloudDetail["name"] . '!%s%sUpgrade to %sPremium%s today%s%s%sWe made it really affordable!%s', 'backup-backup'); |
| 26 | $clouds[$cloudKey]["tooltip"] = sprintf($clouds[$cloudKey]["tooltip"], '<div class="bmi-center-text">', '<br>', '<a href="' . BMI_AUTHOR_URI . '" target="_blank">', '<span class="bmi-premium-bg-stars">', '</span>', '</a>', '<br>', '<b>', '</b>', '</div>'); |
| 27 | } |
| 28 | $clouds[$cloudKey]["enabled"] = Dashboard\bmi_get_config('STORAGE::EXTERNAL::' . $cloudKey); //Make sure cloudNames you add has proper naming structure which matches the config name |
| 29 | } |
| 30 | |
| 31 | $clouds["BACKUPBLISS"]["enabled"] = true; //BB Storage always enabled |
| 32 | |
| 33 | ?> |
| 34 | |
| 35 | <table> |
| 36 | <tr class="br_tr_template"> |
| 37 | <td> |
| 38 | <label class="br_label" for=""> |
| 39 | <input class="br_checkbox" id="" type="checkbox"> |
| 40 | <span class="br_date">---</span> |
| 41 | </label> |
| 42 | </td> |
| 43 | <td class="br_name tooltip-html" tooltip="example.com" data-top="5">---</td> |
| 44 | <td class="br_size">---</td> |
| 45 | <td class="br_stroage center"> |
| 46 | <div class="br_wrapper_storage_grid"> |
| 47 | <div class="storage-icons-container"> |
| 48 | |
| 49 | <svg class="list-storage-img strg-local tooltip" tooltip="<?php esc_attr_e('Local Storage', 'backup-backup') ?>" |
| 50 | data-top="5"> |
| 51 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', 'local-server-2.svg#img') ); ?>"></use> |
| 52 | </svg> |
| 53 | |
| 54 | <?php foreach ($clouds as $cloudKey => $cloudDetail): |
| 55 | $isEnabled = ($cloudDetail["enabled"] === true || $cloudDetail["enabled"] === 'true'); |
| 56 | $hiddenStyle = $isEnabled ? '' : ' style="display: none;"'; |
| 57 | ?> |
| 58 | <?php //Make sure again the class name you define .strg- conforms with the strucuture as implemented above. ?> |
| 59 | <svg class="list-storage-img strg-<?php echo esc_attr(strtolower($cloudKey)) ?> tooltip-html" |
| 60 | tooltip="<?php echo esc_attr(isset($cloudDetail["tooltip"]) ? $cloudDetail["tooltip"] : $cloudDetail["name"]); ?>" |
| 61 | data-top="5" style="<?php echo $isEnabled ? '' : 'display: none;'; ?>"> |
| 62 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', $cloudDetail["icon"] . '#img') ); ?>"></use> |
| 63 | </svg> |
| 64 | <?php endforeach; ?> |
| 65 | |
| 66 | </div> |
| 67 | |
| 68 | <div class="storage-status-indicators"> |
| 69 | |
| 70 | <svg class="list-storage-img strg-warn img-red tooltip" |
| 71 | tooltip="<?php esc_attr_e('There was an error during upload to: Cloud.', 'backup-backup') ?>" data-top="5" |
| 72 | style="display: none;"> |
| 73 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', 'list-warning.svg#img') ); ?>"></use> |
| 74 | </svg> |
| 75 | |
| 76 | <svg class="list-storage-img strg-ong ongoing tooltip" |
| 77 | tooltip="<?php esc_attr_e('Upload to Cloud in progress:', 'backup-backup') ?>" data-top="5" style="display: none;"> |
| 78 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', 'list-ongoing.svg#img') ); ?>"></use> |
| 79 | </svg> |
| 80 | |
| 81 | <svg class="list-storage-img strg-wait tooltip" |
| 82 | tooltip="<?php esc_attr_e('Backup is queued for upload.', 'backup-backup') ?>" data-top="5" style="display: none;"> |
| 83 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', 'list-waiting.svg#img') ); ?>"></use> |
| 84 | </svg> |
| 85 | |
| 86 | </div> |
| 87 | </div> |
| 88 | </td> |
| 89 | <td class="center"> |
| 90 | <div class="brow_lock"> |
| 91 | <img class="tooltip bc-unlocked-btn hoverable" tooltip="<?php esc_attr_e('Lock backup files', 'backup-backup') ?>" |
| 92 | src="<?php echo esc_url( $this->get_asset('images', 'unlocked-min.svg') ); ?>" alt="image"> |
| 93 | <img class="tooltip bc-locked-btn hoverable" tooltip="<?php esc_attr_e('Unlock backup files', 'backup-backup') ?>" |
| 94 | src="<?php echo esc_url( $this->get_asset('images', 'lock-min.svg') ); ?>" alt="image"> |
| 95 | </div> |
| 96 | </td> |
| 97 | <td> |
| 98 | <div class="brow_subactions"> |
| 99 | <a href="#" class="bc-download-btn hoverable nodec untab" tabindex="-1" download> |
| 100 | <img class="tooltip" |
| 101 | tooltip="<?php esc_attr_e('Download the backup file. Click on it downloads it', 'backup-backup') ?>" |
| 102 | src="<?php echo esc_url( $this->get_asset('images', 'download-min.png') ); ?>" alt="image"> |
| 103 | </a> |
| 104 | <a href="#" class="tooltip bc-url-btn hoverable nodec untab bmi-tt-center" tabindex="-1" tooltip="<?php esc_attr_e('Copy link to backup file for super-quick migration', 'backup-backup') ?>"> |
| 105 | <svg width="21px" height="22px"> |
| 106 | <use xlink:href="<?php echo esc_url( $this->get_asset('images', 'link-min.svg#img') ); ?>"></use> |
| 107 | </svg> |
| 108 | </a> |
| 109 | <a href="#" class="bc-logs-btn hoverable nodec untab" tabindex="-1" download> |
| 110 | <img class="tooltip" |
| 111 | tooltip="<?php esc_attr_e('Download log file which was created at time of backup', 'backup-backup') ?>" |
| 112 | src="<?php echo esc_url( $this->get_asset('images', 'log-min.svg') ); ?>" alt="image"> |
| 113 | </a> |
| 114 | </div> |
| 115 | </td> |
| 116 | <td> |
| 117 | <div class="stg-restore-btn hoverable tooltip-html" |
| 118 | tooltip="<?php echo esc_attr( __('Spin up a staging site with this backup.<br />Click on it to learn more.', 'backup-backup') ); ?>"> |
| 119 | <img src="<?php echo esc_url( $this->get_asset('images', 'stg-restore-btn.svg') ); ?>" width="12px" alt="image"> |
| 120 | <?php esc_html_e('Staging', 'backup-backup') ?> |
| 121 | </div> |
| 122 | <div class="restore-btn hoverable tooltip" |
| 123 | tooltip="<?php esc_attr_e('Restore this backup on this site', 'backup-backup') ?>"> |
| 124 | <img src="<?php echo esc_url( $this->get_asset('images', 'restore-min.svg') ); ?>" width="12px" alt="image"> |
| 125 | <?php esc_html_e('Restore', 'backup-backup') ?> |
| 126 | </div> |
| 127 | </td> |
| 128 | <td><img class="tooltip bc-remove-btn hoverable" tooltip="<?php esc_attr_e('Delete this backup', 'backup-backup') ?>" |
| 129 | src="<?php echo esc_url( $this->get_asset('images', 'red-close-min.svg') ); ?>" alt="image"></td> |
| 130 | </tr> |
| 131 | </table> |