AA-Template.php
11 months ago
backup-row-template.php
11 months ago
dropdown-template.php
11 months ago
exclusion-rule-template.php
11 months ago
option-template.php
11 months ago
premium-function-overlay.php
11 months ago
premium-overlay.php
11 months ago
staging-row-template.php
11 months ago
stg-option-template.php
11 months ago
backup-row-template.php
114 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["AWS"] = [ "name" => "Amazon S3", "icon" => "amazon-s3-mono.svg" ]; |
| 18 | $clouds["WASABI"] = [ "name" => "Wasabi", "icon" => "wasabi-s3-mono.svg" ]; |
| 19 | $clouds["SFTP"] = [ "name" => "SFTP", "icon" => "sftp-mono.svg" ]; |
| 20 | |
| 21 | |
| 22 | foreach ($clouds as $cloudKey => $cloudDetail) { |
| 23 | if (!defined('BMI_PRO_INC') && $cloudKey != "BACKUPBLISS") { |
| 24 | $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'); |
| 25 | $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>'); |
| 26 | } |
| 27 | $clouds[$cloudKey]["enabled"] = Dashboard\bmi_get_config('STORAGE::EXTERNAL::' . $cloudKey); //Make sure cloudNames you add has proper naming structure which matches the config name |
| 28 | } |
| 29 | |
| 30 | $clouds["BACKUPBLISS"]["enabled"] = true; //BB Storage always enabled |
| 31 | |
| 32 | ?> |
| 33 | |
| 34 | <table> |
| 35 | <tr class="br_tr_template"> |
| 36 | <td> |
| 37 | <label class="br_label" for=""> |
| 38 | <input class="br_checkbox" id="" type="checkbox"> |
| 39 | <span class="br_date">---</span> |
| 40 | </label> |
| 41 | </td> |
| 42 | <td class="br_name tooltip-html" tooltip="example.com" data-top="5">---</td> |
| 43 | <td class="br_size">---</td> |
| 44 | <td class="br_stroage center"> |
| 45 | <div class="cf br_wrapper_storage"> |
| 46 | <div class="left"> |
| 47 | |
| 48 | <svg class="list-storage-img strg-local tooltip" tooltip="<?php _e('Local Storage', 'backup-backup') ?>" data-top="5"> |
| 49 | <use xlink:href="<?php echo $this->get_asset('images', 'local-server-2.svg#img') ?>"></use> |
| 50 | </svg> |
| 51 | |
| 52 | <?php foreach ($clouds as $cloudKey => $cloudDetail): ?> |
| 53 | <?php if ($cloudDetail["enabled"] === true || $cloudDetail["enabled"] === 'true'): ?> |
| 54 | <?php //Make sure again the class name you define .strg- conforms with the strucuture as implemented above. |
| 55 | ?> |
| 56 | <svg class="list-storage-img strg-<?php echo strtolower($cloudKey) ?> tooltip-html" tooltip="<?php echo esc_attr(isset($cloudDetail["tooltip"]) ? $cloudDetail["tooltip"] : $cloudDetail["name"]); ?>" data-top="5"> |
| 57 | <use xlink:href="<?php echo $this->get_asset('images', $cloudDetail["icon"] . '#img') ?>"></use> |
| 58 | </svg> |
| 59 | <?php endif; ?> |
| 60 | <?php endforeach; ?> |
| 61 | |
| 62 | </div> |
| 63 | |
| 64 | <div class="right"> |
| 65 | |
| 66 | <!-- <svg class="list-storage-img strg-suc tooltip" tooltip="<?php _e('Backup is stored on: Cloud & Local Storage.', 'backup-backup') ?>" data-top="5"> |
| 67 | <use xlink:href="<?php echo $this->get_asset('images', 'list-success.svg#img') ?>"></use> |
| 68 | </svg> --> |
| 69 | |
| 70 | <svg class="list-storage-img strg-warn img-red tooltip" tooltip="<?php _e('There was an error during upload to: Cloud.', 'backup-backup') ?>" data-top="5" style="display: none;"> |
| 71 | <use xlink:href="<?php echo $this->get_asset('images', 'list-warning.svg#img') ?>"></use> |
| 72 | </svg> |
| 73 | |
| 74 | <svg class="list-storage-img strg-ong ongoing tooltip" tooltip="<?php _e('Upload to Cloud in progress:', 'backup-backup') ?>" data-top="5" style="display: none;"> |
| 75 | <use xlink:href="<?php echo $this->get_asset('images', 'list-ongoing.svg#img') ?>"></use> |
| 76 | </svg> |
| 77 | |
| 78 | <svg class="list-storage-img strg-wait tooltip" tooltip="<?php _e('Backup is queued for upload.', 'backup-backup') ?>" data-top="5" style="display: none;"> |
| 79 | <use xlink:href="<?php echo $this->get_asset('images', 'list-waiting.svg#img') ?>"></use> |
| 80 | </svg> |
| 81 | |
| 82 | </div> |
| 83 | </div> |
| 84 | </td> |
| 85 | <td class="center"> |
| 86 | <div class="brow_lock"> |
| 87 | <img class="tooltip bc-unlocked-btn hoverable" tooltip="<?php _e('Lock backup files', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'unlocked-min.svg'); ?>" alt="image"> |
| 88 | <img class="tooltip bc-locked-btn hoverable" tooltip="<?php _e('Unlock backup files', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'lock-min.svg'); ?>" alt="image"> |
| 89 | </div> |
| 90 | </td> |
| 91 | <td> |
| 92 | <div class="brow_subactions"> |
| 93 | <a href="#" class="bc-download-btn hoverable nodec untab" tabindex="-1" download> |
| 94 | <img class="tooltip" tooltip="<?php _e('Download the backup file. Click on it downloads it', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'download-min.png'); ?>" alt="image"> |
| 95 | </a> |
| 96 | <img class="tooltip bc-url-btn hoverable untab" tabindex="-1" tooltip="<?php _e('Copy link to backup file for super-quick migration', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'link-min.png'); ?>" alt="image"> |
| 97 | <a href="#" class="bc-logs-btn hoverable nodec untab" tabindex="-1" download> |
| 98 | <img class="tooltip" tooltip="<?php _e('Download log file which was created at time of backup', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'log-min.svg'); ?>" alt="image"> |
| 99 | </a> |
| 100 | </div> |
| 101 | </td> |
| 102 | <td> |
| 103 | <div class="stg-restore-btn hoverable tooltip-html" tooltip="<?php _e('Spin up a staging site with this backup.<br />Click on it to learn more.', 'backup-backup') ?>"> |
| 104 | <img src="<?php echo $this->get_asset('images', 'stg-restore-btn.svg'); ?>" width="12px" alt="image"> |
| 105 | <?php _e('Staging', 'backup-backup') ?> |
| 106 | </div> |
| 107 | <div class="restore-btn hoverable tooltip" tooltip="<?php _e('Restore this backup on this site', 'backup-backup') ?>"> |
| 108 | <img src="<?php echo $this->get_asset('images', 'restore-min.svg'); ?>" width="12px" alt="image"> |
| 109 | <?php _e('Restore', 'backup-backup') ?> |
| 110 | </div> |
| 111 | </td> |
| 112 | <td><img class="tooltip bc-remove-btn hoverable" tooltip="<?php _e('Delete this backup', 'backup-backup') ?>" src="<?php echo $this->get_asset('images', 'red-close-min.svg'); ?>" alt="image"></td> |
| 113 | </tr> |
| 114 | </table> |