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