Skip to content

Commit

Permalink
Merge branch 'master' into backupception
Browse files Browse the repository at this point in the history
# Conflicts:
#	backupwordpress.php
  • Loading branch information
paul de wouters committed Mar 12, 2015
2 parents 3afd704 + b2d7c88 commit cef89cc
Show file tree
Hide file tree
Showing 6 changed files with 463 additions and 422 deletions.
10 changes: 6 additions & 4 deletions admin/schedule-form.php
Expand Up @@ -84,6 +84,8 @@
$start_time = time();
} ?>

<?php $start_date_array = date_parse( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $start_time ) ); ?>

<tr id="start-day" class="recurring-setting">

<th scope="row">
Expand Down Expand Up @@ -123,7 +125,7 @@
</th>

<td>
<input type="number" min="0" max="31" step="1" id="hmbkp_schedule_start_day_of_month" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_month]" value="<?php echo esc_attr( date_i18n( 'j', $start_time ) ); ?>">
<input type="number" min="0" max="31" step="1" id="hmbkp_schedule_start_day_of_month" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_month]" value="<?php echo esc_attr( $start_date_array['day'] ); ?>">
</td>

</tr>
Expand All @@ -138,16 +140,16 @@

<span class="field-group">

<label for="hmbkp_schedule_start_hours"><input type="number" min="0" max="23" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_hours]" id="hmbkp_schedule_start_hours" value="<?php echo esc_attr( date_i18n( 'G', $start_time ) ); ?>">
<label for="hmbkp_schedule_start_hours"><input type="number" min="0" max="23" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_hours]" id="hmbkp_schedule_start_hours" value="<?php echo esc_attr( $start_date_array['hour'] ); ?>">

<?php _e( 'Hours', 'backupwordpress' ); ?></label>

<label for="hmbkp_schedule_start_minutes"><input type="number" min="0" max="59" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_minutes]" id="hmbkp_schedule_start_minutes" value="<?php echo esc_attr( (float) date_i18n( 'i', $start_time ) ); ?>">
<label for="hmbkp_schedule_start_minutes"><input type="number" min="0" max="59" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_minutes]" id="hmbkp_schedule_start_minutes" value="<?php echo esc_attr( $start_date_array['minute'] ); ?>">

<?php _e( 'Minutes', 'backupwordpress' ); ?></label>

</span>

<p class="descriprion"><strong><?php esc_html_e( 'Please use 24 hour format for hours', 'backupwordpress' ); ?></strong></p>
<p class="twice-js description<?php if ( $schedule->get_reoccurrence() !== 'hmbkp_fortnightly' ) { ?> hidden<?php } ?>"><?php _e( 'The second backup will run 12 hours after the first', 'backupwordpress' ); ?></p>

</td>
Expand Down
10 changes: 8 additions & 2 deletions admin/schedule-sentence.php
Expand Up @@ -148,11 +148,17 @@
function hmbkp_get_site_size_text( HM\BackUpWordPress\Scheduled_Backup $schedule ) {

if ( isset( $_GET['hmbkp_add_schedule'] ) ) {

return '';
} elseif ( ( 'database' === $schedule->get_type() ) || $schedule->is_site_size_cached() ) {

} elseif ( ( 'database' === $schedule->get_type() ) || $schedule->is_site_size_cached() ) {

return sprintf( '(<code title="' . __( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ) . '">%s</code>)', esc_attr( $schedule->get_formatted_site_size() ) );

} else {
return sprintf('(<code class="calculating" title="' . __( 'this shouldn\'t take long&hellip;', 'backupwordpress' ) . '">' . __( 'calculating the size of your backup&hellip;', 'backupwordpress' ) . '</code>)');

return sprintf( '(<code class="calculating" title="' . __( 'this shouldn\'t take long&hellip;', 'backupwordpress' ) . '">' . __( 'calculating the size of your backup&hellip;', 'backupwordpress' ) . '</code>)' );

}

}

0 comments on commit cef89cc

Please sign in to comment.