Example #1
0
<?php

$result = '';
if ($_POST) {
    if (isset($_POST['button-id']) && isset($_POST['bulk-action-select'])) {
        if ($_POST['bulk-action-select'] == 'trash') {
            $count = 0;
            foreach ($_POST['button-id'] as $id) {
                maxbuttons_button_move_to_trash($id);
                $count++;
            }
            if ($count == 1) {
                $result = 'Moved 1 button to the trash.';
            }
            if ($count > 1) {
                $result = 'Moved ' . $count . ' buttons to the trash.';
            }
        }
    }
}
if (isset($_GET['message']) && $_GET['message'] == '1') {
    $result = 'Moved 1 button to the trash.';
}
$published_buttons = maxbuttons_get_published_buttons();
$published_buttons_count = maxbuttons_get_published_buttons_count();
$trashed_buttons_count = maxbuttons_get_trashed_buttons_count();
?>

<script type="text/javascript">
	jQuery(document).ready(function() {
		jQuery("#bulk-action-all").click(function() {
Example #2
0
<?php

if (isset($_GET['id']) && $_GET['id'] != '') {
    maxbuttons_button_move_to_trash($_GET['id']);
}
?>
<script type="text/javascript">
	window.location = "<?php 
admin_url();
?>
admin.php?page=maxbuttons-controller&action=list&message=1";
</script>