Esempio n. 1
0
/**
 * Display the row of actions for a schedule
 *
 * @access public
 * @param HMBKP_Scheduled_Backup $schedule
 * @return void
 */
function hmbkp_schedule_actions(HMBKP_Scheduled_Backup $schedule)
{
    // Start output buffering
    ob_start();
    ?>

	<span class="hmbkp-status"><?php 
    echo $schedule->get_status() ? wp_kses_data($schedule->get_status()) : __('Starting Backup', 'hmbkp');
    ?>
 <a href="<?php 
    echo esc_url(add_query_arg(array('action' => 'hmbkp_cancel', 'hmbkp_schedule_id' => $schedule->get_id()), HMBKP_ADMIN_URL));
    ?>
"><?php 
    _e('cancel', 'hmbkp');
    ?>
</a></span>

	<div class="hmbkp-schedule-actions row-actions">

		<a class="colorbox" href="<?php 
    echo esc_url(add_query_arg(array('action' => 'hmbkp_edit_schedule_load', 'hmbkp_schedule_id' => $schedule->get_id()), admin_url('admin-ajax.php')));
    ?>
"><?php 
    _e('Settings', 'hmbkp');
    ?>
</a> |

	<?php 
    if ($schedule->get_type() !== 'database') {
        ?>
		<a class="colorbox" href="<?php 
        echo esc_url(add_query_arg(array('action' => 'hmbkp_edit_schedule_excludes_load', 'hmbkp_schedule_id' => $schedule->get_id()), admin_url('admin-ajax.php')));
        ?>
"><?php 
        _e('Excludes', 'hmbkp');
        ?>
</a>  |
	<?php 
    }
    ?>

		<?php 
    // capture output
    $output = ob_get_clean();
    echo apply_filters('hmbkp_schedule_actions_menu', $output, $schedule);
    ?>

		<a class="hmbkp-run" href="<?php 
    echo esc_url(add_query_arg(array('action' => 'hmbkp_run_schedule', 'hmbkp_schedule_id' => $schedule->get_id()), admin_url('admin-ajax.php')));
    ?>
"><?php 
    _e('Run now', 'hmbkp');
    ?>
</a>  |

		<a class="delete-action" href="<?php 
    echo wp_nonce_url(add_query_arg(array('action' => 'hmbkp_delete_schedule', 'hmbkp_schedule_id' => $schedule->get_id()), HMBKP_ADMIN_URL), 'hmbkp-delete_schedule');
    ?>
"><?php 
    _e('Delete', 'hmbkp');
    ?>
</a>

	</div>

<?php 
}
Esempio n. 2
0
/**
 * Display the row of actions for a schedule
 *
 * @access public
 * @param HMBKP_Scheduled_Backup $schedule
 * @return void
 */
function hmbkp_schedule_status(HMBKP_Scheduled_Backup $schedule, $echo = true)
{
    ob_start();
    ?>

	<span class="hmbkp-status"<?php 
    if ($schedule->get_status()) {
        ?>
 title="<?php 
        printf(__('Started %s ago', 'hmbkp'), human_time_diff($schedule->get_schedule_running_start_time()));
        ?>
"<?php 
    }
    ?>
>
		<?php 
    echo $schedule->get_status() ? wp_kses_data($schedule->get_status()) : __('Starting Backup', 'hmbkp');
    ?>
		<a href="<?php 
    echo esc_url(wp_nonce_url(add_query_arg(array('action' => 'hmbkp_request_cancel_backup', 'hmbkp_schedule_id' => $schedule->get_id()), hmbkp_get_settings_url()), 'hmbkp_request_cancel_backup', 'hmbkp_request_cancel_backup_nonce'));
    ?>
"><?php 
    _e('cancel', 'hmbkp');
    ?>
</a>
	</span>

	<?php 
    $output = ob_get_clean();
    if (!$echo) {
        return $output;
    }
    echo $output;
}
Esempio n. 3
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_status($schedule);
    }
    die;
}
Esempio n. 4
0
/**
 * Display the row of actions for a schedule
 *
 * @access public
 * @param HMBKP_Scheduled_Backup $schedule
 * @return void
 */
function hmbkp_schedule_status(HMBKP_Scheduled_Backup $schedule, $echo = true)
{
    ob_start();
    ?>

	<span class="hmbkp-status"<?php 
    if ($schedule->get_status()) {
        ?>
 title="<?php 
        printf(__('Started %s ago', 'backupwordpress'), human_time_diff($schedule->get_schedule_running_start_time()));
        ?>
"<?php 
    }
    ?>
>
		<?php 
    echo $schedule->get_status() ? wp_kses_data($schedule->get_status()) : __('Starting Backup', 'backupwordpress');
    ?>
		<a href="<?php 
    echo hmbkp_admin_action_url('request_cancel_backup', array('hmbkp_schedule_id' => $schedule->get_id()));
    ?>
"><?php 
    _e('cancel', 'backupwordpress');
    ?>
</a>
	</span>

	<?php 
    $output = ob_get_clean();
    if (!$echo) {
        return $output;
    }
    echo $output;
}