public ActionResult IndexWidgetPOST(int widgetId, string returnUrl, int?layerId, string moveUp, string moveDown, string moveHere, string moveOut)
        {
            if (!string.IsNullOrWhiteSpace(moveOut))
            {
                return(DeleteWidget(widgetId, returnUrl));
            }

            if (!IsAuthorizedToManageWidgets())
            {
                return(new HttpUnauthorizedResult());
            }

            if (!string.IsNullOrWhiteSpace(moveUp))
            {
                _widgetsService.MoveWidgetUp(widgetId);
            }
            else if (!string.IsNullOrWhiteSpace(moveDown))
            {
                _widgetsService.MoveWidgetDown(widgetId);
            }
            else if (!string.IsNullOrWhiteSpace(moveHere))
            {
                _widgetsService.MoveWidgetToLayer(widgetId, layerId);
            }

            return(this.RedirectLocal(returnUrl, () => RedirectToAction("Index")));
        }
        public ActionResult IndexWidgetPOST(int widgetId, string returnUrl, int?layerId, string moveUp, string moveDown, string moveHere, string moveOut)
        {
            if (!string.IsNullOrWhiteSpace(moveOut))
            {
                return(DeleteWidget(widgetId, returnUrl));
            }

            if (!Services.Authorizer.Authorize(Permissions.ManageWidgets, T(NotAuthorizedManageWidgetsLabel)))
            {
                return(new HttpUnauthorizedResult());
            }

            try {
                if (!string.IsNullOrWhiteSpace(moveUp))
                {
                    _widgetsService.MoveWidgetUp(widgetId);
                }
                else if (!string.IsNullOrWhiteSpace(moveDown))
                {
                    _widgetsService.MoveWidgetDown(widgetId);
                }
                else if (!string.IsNullOrWhiteSpace(moveHere))
                {
                    _widgetsService.MoveWidgetToLayer(widgetId, layerId);
                }
            }
            catch (Exception exception) {
                this.Error(exception, T("Moving widget failed: {0}", exception.Message), Logger, Services.Notifier);
            }

            return(this.RedirectLocal(returnUrl, () => RedirectToAction("Index")));
        }