awake.php
5 years ago
bgLogin.php
5 years ago
cancelBackup.php
5 years ago
cancelDownload.php
5 years ago
checkBackupCreation.php
5 years ago
checkPHPVersionCompatibility.php
5 years ago
checkRestoreCreation.php
5 years ago
chooseProfile.php
5 years ago
cloudDropbox.php
5 years ago
createCloudUser.php
5 years ago
curlChecker.php
5 years ago
deleteBackup.php
5 years ago
dismissDiscountNotice.php
5 years ago
downloadBackup.php
5 years ago
getAction.php
5 years ago
getBackupContent.php
5 years ago
getRunningActions.php
5 years ago
hideNotice.php
5 years ago
importBackup.php
5 years ago
isBgUserExists.php
5 years ago
isFeatureAvailable.php
5 years ago
manualBackup.php
5 years ago
modalBackupGuardDetails.php
5 years ago
modalImport.php
5 years ago
modalManualBackup.php
5 years ago
modalManualRestore.php
5 years ago
modalPrivacy.php
5 years ago
modalReview.php
5 years ago
modalTerms.php
5 years ago
resetStatus.php
5 years ago
restore.php
5 years ago
reviewBannerActions.php
5 years ago
schedule.php
5 years ago
sendUsageStatus.php
5 years ago
setReviewPopupState.php
5 years ago
setUserInfoVerificationPopupState.php
5 years ago
settings.php
5 years ago
storeSubscriberInfo.php
5 years ago
storeSurveyResult.php
5 years ago
getBackupContent.php
57 lines
| 1 | <?php |
| 2 | header('Content-Type: application/json'); |
| 3 | require_once(dirname(__FILE__).'/../boot.php'); |
| 4 | require_once(SG_LIB_PATH.'SGArchive.php'); |
| 5 | require_once(SG_BACKUP_PATH.'SGBackupFiles.php'); |
| 6 | $backupName = $_GET['backupName']; |
| 7 | $path = isset($_GET["path"])? $_GET["path"] : "wp-content/"; |
| 8 | $parent = $path; |
| 9 | $data = array(); |
| 10 | |
| 11 | $disabled = !SGBoot::isFeatureAvailable('SLECTIVE_RESTORE'); |
| 12 | |
| 13 | if ($path == "#") { |
| 14 | |
| 15 | $parentNode = array(); |
| 16 | $parentNode["id"] = "/"; |
| 17 | $parentNode["parent"] = "#"; |
| 18 | $parentNode["text"] = "/"; |
| 19 | $parentNode["type"] = "none"; |
| 20 | $parentNode["children"] = true; |
| 21 | $parentNode["state"] = array ("selected"=>true); |
| 22 | array_push($data,$parentNode); |
| 23 | |
| 24 | } |
| 25 | else { |
| 26 | if ($path == "/") { |
| 27 | $path = ""; |
| 28 | } |
| 29 | else { |
| 30 | $path .= '/'; |
| 31 | } |
| 32 | |
| 33 | $backupPath = SG_BACKUP_DIRECTORY.$backupName; |
| 34 | $backupPath= $backupPath.'/'.$backupName.'.sgbp'; |
| 35 | $backupFiles = new SGBackupFiles(); |
| 36 | $archive = new SGArchive($backupPath,'r'); |
| 37 | $archive->setDelegate($backupFiles); |
| 38 | $headers = $archive->getArchiveHeaders(); |
| 39 | $filesList = $archive->getFilesList(); |
| 40 | $tree = $archive->getTreefromList($filesList, $path); |
| 41 | |
| 42 | |
| 43 | foreach ($tree as $node) { |
| 44 | $el = array(); |
| 45 | $el["id"] = $path.$node->name; |
| 46 | $el["parent"] = $parent; |
| 47 | $el["text"] = $node->name; |
| 48 | $el["type"] = $node->type; |
| 49 | if ($node->type == "folder") { |
| 50 | $el["children"] = true; |
| 51 | } |
| 52 | array_push($data, $el); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | echo json_encode($data); |
| 57 |