| 1 |
<?php |
| 2 |
/** |
| 3 |
* Display the upgrades page. |
| 4 |
* |
| 5 |
* @author Studio 164a |
| 6 |
* @package Charitable/Admin View/Upgrades |
| 7 |
* @since 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
$page = $view_args['page']; |
| 11 |
$action = $page->get_action(); |
| 12 |
$step = $page->get_step(); |
| 13 |
$total = $page->get_total(); |
| 14 |
$number = $page->get_number(); |
| 15 |
$steps = $page->get_steps( $total, $number ); |
| 16 |
$args = array( |
| 17 |
'charitable-upgrade' => $action, |
| 18 |
'page' => 'charitable-upgrades', |
| 19 |
'step' => $step, |
| 20 |
'total' => $total, |
| 21 |
'steps' => $steps, |
| 22 |
); |
| 23 |
|
| 24 |
update_option( 'charitable_doing_upgrade', $args ); |
| 25 |
|
| 26 |
if ( $step > $steps ) { |
| 27 |
// Prevent a weird case where the estimate was off. Usually only a couple. |
| 28 |
$steps = $step; |
| 29 |
} |
| 30 |
?> |
| 31 |
<div class="wrap"> |
| 32 |
<h2><?php _e( 'Charitable - Upgrades', 'charitable' ); ?></h2> |
| 33 |
|
| 34 |
<div id="charitable-upgrade-status"> |
| 35 |
<p><?php _e( 'The upgrade process has started, please be patient. This could take several minutes. You will be automatically redirected when the upgrade is finished.', 'charitable' ); ?></p> |
| 36 |
|
| 37 |
<?php if ( ! empty( $total ) ) : ?> |
| 38 |
<p><strong><?php printf( __( 'Step %d of approximately %d running', 'charitable' ), $step, $steps ); ?></strong></p> |
| 39 |
<?php endif; ?> |
| 40 |
</div> |
| 41 |
<script type="text/javascript"> |
| 42 |
setTimeout(function() { document.location.href = "index.php?charitable_action=<?php echo $action; ?>&step=<?php echo $step; ?>&total=<?php echo $total; ?>"; }, 250); |
| 43 |
</script> |
| 44 |
</div> |
| 45 |
|