ajax
3 years ago
config
4 years ago
cron
6 years ago
css
3 years ago
fonts
5 years ago
img
3 years ago
include
3 years ago
js
3 years ago
templates
3 years ago
backups.php
3 years ago
boot.php
4 years ago
cloud.php
5 years ago
dashboardWidget.php
5 years ago
pagesContent.php
4 years ago
proFeatures.php
4 years ago
restore_wordpress.php
4 years ago
schedule.php
4 years ago
security.php
4 years ago
services.php
5 years ago
settings.php
3 years ago
support.php
4 years ago
systemInfo.php
4 years ago
videoTutorials.php
4 years ago
schedule.php
183 lines
| 1 | <?php |
| 2 | $contentClassName = getBackupPageContentClassName('schedule'); |
| 3 | $id = ''; |
| 4 | $directories = SG_BACKUP_FILE_PATHS; |
| 5 | $directories = explode(',', $directories); |
| 6 | $dropbox = SGConfig::get('SG_DROPBOX_ACCESS_TOKEN'); |
| 7 | $backupGuard = SGConfig::get('SG_BACKUPGUARD_UPLOAD_ACCESS_TOKEN'); |
| 8 | |
| 9 | $intervalSelectElement = array( |
| 10 | BG_SCHEDULE_INTERVAL_HOURLY => 'Hour', |
| 11 | BG_SCHEDULE_INTERVAL_DAILY => 'Day', |
| 12 | BG_SCHEDULE_INTERVAL_WEEKLY => 'Week', |
| 13 | BG_SCHEDULE_INTERVAL_MONTHLY => 'Month' |
| 14 | ); |
| 15 | |
| 16 | $sgb = new SGBackup(); |
| 17 | $scheduleParams = $sgb->getScheduleParamsById(SG_SCHEDULER_DEFAULT_ID); |
| 18 | $scheduleParams = backupGuardParseBackupOptions($scheduleParams); |
| 19 | ?> |
| 20 | |
| 21 | <div id="sg-backup-page-content-schedule" class="sg-backup-page-content <?php echo $contentClassName; ?>"> |
| 22 | <div class="row sg-schedule-container"> |
| 23 | <div class="col-md-12"> |
| 24 | <form class="form-horizontal" method="post" data-sgform="ajax" data-type="schedule"> |
| 25 | <fieldset> |
| 26 | <div><h1 class="sg-backup-page-title"><?php _backupGuardT('Schedule settings')?></h1></div> |
| 27 | <?php if (!SGBoot::isFeatureAvailable('MULTI_SCHEDULE')): ?> |
| 28 | <div class="form-group"> |
| 29 | <div class="col-md-12 sg-feature-alert-text"> |
| 30 | <?php _backupGuardT('*Multiple schedule profiles are available only in')?> <a href="<?php echo SG_BACKUP_SITE_PRICING_URL?>" target="_blank"><?php _backupGuardT('Platinum')?></a> <?php _backupGuardT('version.')?> |
| 31 | </div> |
| 32 | </div> |
| 33 | <?php endif; ?> |
| 34 | <div class="form-group"> |
| 35 | <label class="col-md-8 sg-control-label"> |
| 36 | <?php _backupGuardT('Scheduled backup')?> |
| 37 | </label> |
| 38 | <div class="col-md-3 pull-right text-right"> |
| 39 | <label class="sg-switch-container"> |
| 40 | <input type="checkbox" class="sg-switch" <?php echo strlen($scheduleParams['label'])?'checked':''?> data-remote="schedule"> |
| 41 | </label> |
| 42 | </div> |
| 43 | </div> |
| 44 | <div class="sg-schedule-settings sg-schedule-settings-<?php echo strlen($scheduleParams['label'])?'opened':'closed'; ?>"> |
| 45 | <div class="form-group"> |
| 46 | <label class="col-md-4 sg-control-label" for="sg-schedule-label"><?php _backupGuardT('Schedule label')?></label> |
| 47 | <div class="col-md-8"> |
| 48 | <input class="form-control sg-backup-input" name="sg-schedule-label" id="sg-schedule-label" value="<?php echo esc_html($scheduleParams['label'])?>"> |
| 49 | </div> |
| 50 | </div> |
| 51 | <!-- Schedule interval --> |
| 52 | <div class="form-group"> |
| 53 | <label class="col-md-4 sg-control-label" for="sg-schedule-interval"><?php _backupGuardT('Perform backup every')?></label> |
| 54 | <div class="col-md-8"> |
| 55 | <?php echo selectElement($intervalSelectElement, array('id'=>'sg-schedule-interval', 'name'=>'scheduleInterval', 'class'=>'form-control'), '', esc_html($scheduleParams['interval']));?> |
| 56 | </div> |
| 57 | </div> |
| 58 | <!-- Schedule options --> |
| 59 | <div class="form-group sg-custom-backup-schedule"> |
| 60 | <div class="col-md-8 col-md-offset-4"> |
| 61 | <div class="radio sg-no-padding-top"> |
| 62 | <label for="fullbackup-radio"> |
| 63 | <input type="radio" name="backupType" id="fullbackup-radio" value="1" checked> |
| 64 | <?php _backupGuardT('Full backup'); ?> |
| 65 | </label> |
| 66 | </div> |
| 67 | <div class="radio sg-no-padding-top"> |
| 68 | <label for="custombackup-radio"> |
| 69 | <input type="radio" name="backupType" id="custombackup-radio" value="2" <?php echo $scheduleParams['isCustomBackup']?'checked':'' ?>> |
| 70 | <?php _backupGuardT('Custom backup'); ?> |
| 71 | </label> |
| 72 | </div> |
| 73 | <div class="col-md-12 sg-custom-backup <?php echo $scheduleParams['isCustomBackup']?'sg-open':'' ?>"> |
| 74 | <div class="checkbox"> |
| 75 | <label for="custombackupdb-chbx"> |
| 76 | <input type="checkbox" name="backupDatabase" class="sg-custom-option" id="custombackupdb-chbx" <?php echo $scheduleParams['isDatabaseSelected']?'checked':'' ?>> |
| 77 | <span class="sg-checkbox-label-text"><?php _backupGuardT('Backup database'); ?></span> |
| 78 | </label> |
| 79 | </div> |
| 80 | <div class="checkbox"> |
| 81 | <label for="custombackupfiles-chbx"> |
| 82 | <input type="checkbox" name="backupFiles" class="sg-custom-option" id="custombackupfiles-chbx" <?php echo $scheduleParams['isFilesSelected']?'checked':'' ?>> |
| 83 | <span class="sg-checkbox-label-text"><?php _backupGuardT('Backup files'); ?></span> |
| 84 | </label> |
| 85 | <!--Files--> |
| 86 | <div class="col-md-12 sg-checkbox sg-custom-backup-files <?php echo $scheduleParams['isFilesSelected']?'sg-open':'' ?>"> |
| 87 | <?php foreach ($directories as $directory): ?> |
| 88 | <div class="checkbox"> |
| 89 | <label for="<?php echo 'sg'.$directory?>"> |
| 90 | <input type="checkbox" name="directory[]" id="<?php echo 'sg'.$directory;?>" value="<?php echo $directory;?>" <?php if($directory == 'wp-content' && in_array($directory, $scheduleParams['selectedDirectories'])){ echo 'checked=checked'; } elseif ($directory != 'wp-content' && !in_array($directory, $scheduleParams['excludeDirectories'])){ echo 'checked=checked'; } ?> > |
| 91 | <?php echo basename($directory);?> |
| 92 | </label> |
| 93 | </div> |
| 94 | <?php endforeach;?> |
| 95 | </div> |
| 96 | </div> |
| 97 | </div> |
| 98 | <div class="clearfix"></div> |
| 99 | <!--Cloud--> |
| 100 | <?php if(SGBoot::isFeatureAvailable('STORAGE')): ?> |
| 101 | <div class="checkbox"> |
| 102 | <label for="custombackupcloud-chbx"> |
| 103 | <input type="checkbox" name="backupCloud" id="custombackupcloud-chbx" <?php echo count($scheduleParams['selectedClouds'])?'checked':''?>> |
| 104 | <span class="sg-checkbox-label-text"><?php _backupGuardT('Upload to cloud'); ?></span> |
| 105 | </label> |
| 106 | <!--Storages--> |
| 107 | <div class="col-md-12 sg-checkbox sg-custom-backup-cloud <?php echo count($scheduleParams['selectedClouds'])?'sg-open':'';?>"> |
| 108 | <?php if(SGBoot::isFeatureAvailable('BACKUP_GUARD') && SG_SHOW_BACKUPGUARD_CLOUD): ?> |
| 109 | <div class="checkbox"> |
| 110 | <label for="cloud-backup-guard" <?php echo empty($backupGuard)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('BackupGuard is not active.',true).'"':''?>> |
| 111 | <input type="checkbox" name="backupStorages[]" id="cloud-backup-guard" value="<?php echo SG_STORAGE_BACKUP_GUARD ?>" <?php echo in_array(SG_STORAGE_BACKUP_GUARD, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($backupGuard)?'disabled="disabled"':''?>> |
| 112 | <?php echo 'BackupGuard' ?> |
| 113 | </label> |
| 114 | </div> |
| 115 | <?php endif; ?> |
| 116 | <?php if(SGBoot::isFeatureAvailable('FTP')): ?> |
| 117 | <div class="checkbox"> |
| 118 | <label for="cloud-ftp" <?php echo empty($ftp)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('FTP is not active.',true).'"':''?>> |
| 119 | <input type="checkbox" name="backupStorages[]" id="cloud-ftp" value="<?php echo SG_STORAGE_FTP ?>" <?php echo in_array(SG_STORAGE_FTP, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($ftp)?'disabled="disabled"':''?>> |
| 120 | <span class="sg-checkbox-label-text"><?php echo 'FTP' ?></span> |
| 121 | </label> |
| 122 | </div> |
| 123 | <?php endif; ?> |
| 124 | <?php if(SGBoot::isFeatureAvailable('DROPBOX')): ?> |
| 125 | <div class="checkbox"> |
| 126 | <label for="cloud-dropbox" <?php echo empty($dropbox)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('Dropbox is not active.',true).'"':''?>> |
| 127 | <input type="checkbox" name="backupStorages[]" id="cloud-dropbox" value="<?php echo SG_STORAGE_DROPBOX ?>" <?php echo in_array(SG_STORAGE_DROPBOX, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($dropbox)?'disabled="disabled"':''?>> |
| 128 | <span class="sg-checkbox-label-text"><?php echo 'Dropbox' ?></span> |
| 129 | </label> |
| 130 | </div> |
| 131 | <?php endif; ?> |
| 132 | <?php if(SGBoot::isFeatureAvailable('GOOGLE_DRIVE')): ?> |
| 133 | <div class="checkbox"> |
| 134 | <label for="cloud-gdrive" <?php echo empty($gdrive)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('Google Drive is not active.',true).'"':''?>> |
| 135 | <input type="checkbox" name="backupStorages[]" id="cloud-gdrive" value="<?php echo SG_STORAGE_GOOGLE_DRIVE?>" <?php echo in_array(SG_STORAGE_GOOGLE_DRIVE, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($gdrive)?'disabled="disabled"':''?>> |
| 136 | <span class="sg-checkbox-label-text"><?php echo 'Google Drive' ?></span> |
| 137 | </label> |
| 138 | </div> |
| 139 | <?php endif; ?> |
| 140 | <?php if(SGBoot::isFeatureAvailable('AMAZON')): ?> |
| 141 | <div class="checkbox"> |
| 142 | <label for="cloud-amazon" <?php echo empty($amazon)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('Amazon S3 Drive is not active.',true).'"':''?>> |
| 143 | <input type="checkbox" name="backupStorages[]" id="cloud-amazon" value="<?php echo SG_STORAGE_AMAZON?>" <?php echo in_array(SG_STORAGE_AMAZON, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($amazon)?'disabled="disabled"':''?>> |
| 144 | <span class="sg-checkbox-label-text"><?php echo 'Amazon S3' ?></span> |
| 145 | </label> |
| 146 | </div> |
| 147 | <?php endif; ?> |
| 148 | <?php if(SGBoot::isFeatureAvailable('ONE_DRIVE')): ?> |
| 149 | <div class="checkbox"> |
| 150 | <label for="cloud-one-drive" <?php echo empty($oneDrive)?'data-toggle="tooltip" data-placement="right" title="'._backupGuardT('One Drive is not active.', true).'"':''?>> |
| 151 | <input type="checkbox" name="backupStorages[]" id="cloud-one-drive" value="<?php echo SG_STORAGE_ONE_DRIVE?>" <?php echo in_array(SG_STORAGE_ONE_DRIVE, $scheduleParams['selectedClouds'])?'checked="checked"':''?> <?php echo empty($oneDrive)?'disabled="disabled"':''?>> |
| 152 | <span class="sg-checkbox-label-text"><?php echo 'One Drive' ?></span> |
| 153 | </label> |
| 154 | </div> |
| 155 | <?php endif;?> |
| 156 | </div> |
| 157 | <div class="clearfix"></div> |
| 158 | </div> |
| 159 | <?php endif; ?> |
| 160 | <!-- Background mode --> |
| 161 | <?php if(SGBoot::isFeatureAvailable('BACKGROUND_MODE')): ?> |
| 162 | <div class="checkbox"> |
| 163 | <label for="background-chbx"> |
| 164 | <input type="checkbox" name="backgroundMode" id="background-chbx" <?php echo $scheduleParams['isBackgroundMode']?'checked':''?>> |
| 165 | <span class="sg-checkbox-label-text"><?php _backupGuardT('Background mode'); ?></span> |
| 166 | </label> |
| 167 | </div> |
| 168 | <?php endif;?> |
| 169 | </div> |
| 170 | </div> |
| 171 | <!-- Button (Double) --> |
| 172 | <div class="form-group"> |
| 173 | <label class="col-md-4 sg-control-label" for="button1id"></label> |
| 174 | <div class="col-md-8"> |
| 175 | <button type="button" id="sg-save-schedule" onclick="sgBackup.schedule()" class="btn btn-success pull-right"><?php _backupGuardT('Save');?></button> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | </fieldset> |
| 180 | </form> |
| 181 | </div> |
| 182 | </div> |
| 183 | </div> |