diff --git a/html/forms/update-dashboard-config.inc.php b/html/forms/update-dashboard-config.inc.php index 134aea32c8..c4e951ab9c 100644 --- a/html/forms/update-dashboard-config.inc.php +++ b/html/forms/update-dashboard-config.inc.php @@ -13,6 +13,12 @@ if ($sub_type == 'remove' && is_numeric($widget_id)) { $message = ''; } } +elseif ($sub_type == 'remove-all') { + if (dbDelete('users_widgets','`user_id`=?', array($_SESSION['user_id']))) { + $status = 'ok'; + $message = ''; + } +} elseif ($sub_type == 'add' && is_numeric($widget_id)) { $dupe_check = dbFetchCEll('SELECT `user_widget_id` FROM `users_widgets` WHERE `user_id`=? AND `widget_id`=?',array($_SESSION['user_id'],$widget_id)); diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php index 49ecc55f2f..46530220ce 100644 --- a/html/pages/front/tiles.php +++ b/html/pages/front/tiles.php @@ -27,7 +27,8 @@ $dash_config = unserialize(stripslashes($data)); ?> - + +Clear dashboard
' + data.message + '
'); + } + }, + error: function () { + $("#message").html('
An error occurred.
'); + } + }); + }); + $('a[name="place_widget"]').on('click', function(event, state) { var widget_id = $(this).data('widget_id'); $.ajax({