Example #1
0
/**
 * Display the running status via ajax
 */
function hmbkp_ajax_is_backup_in_progress()
{
    check_ajax_referer('hmbkp_nonce', 'nonce');
    if (empty($_POST['hmbkp_schedule_id'])) {
        die;
    }
    $schedule = new HMBKP_Scheduled_Backup(sanitize_text_field(urldecode($_POST['hmbkp_schedule_id'])));
    if (!$schedule->get_status()) {
        echo 0;
    } else {
        hmbkp_schedule_actions($schedule);
    }
    die;
}
Example #2
0
        $services[] = esc_html($service->display());
    }
}
if (!empty($services) && count($services) > 1) {
    $services[count($services) - 2] .= ' & ' . $services[count($services) - 1];
    array_pop($services);
}
?>

<div class="hmbkp-schedule-sentence<?php 
if ($schedule->get_status()) {
    ?>
 hmbkp-running<?php 
}
?>
">

	<?php 
if (!empty($services)) {
    printf(__('Backup my %1$s %2$s %3$s, %4$s. %5$s Send a copy of each backup to %6$s.', 'hmbkp'), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, $email_msg, implode(', ', array_filter($services)));
} else {
    printf(__('Backup my %1$s %2$s %3$s, %4$s. %5$s', 'hmbkp'), $filesize, '<span>' . $type . '</span>', $reoccurrence, $backup_to_keep, $email_msg);
}
?>

	<?php 
hmbkp_schedule_actions($schedule);
?>

</div>