public override CommandState QueryState(CommandContext context)
        {
            if (!PublishingHelper.CanPublishDatabase(Sitecore.Context.ContentDatabase))
            {
                return(CommandState.Disabled);
            }

            return(base.QueryState(context));
        }
        public static new void Run(ClientPipelineArgs args)
        {
            if (!PublishingHelper.CanPublishDatabase(Sitecore.Context.ContentDatabase))
            {
                string msg = Translate.Text("You cannot publish this database.");
                Sitecore.Context.ClientPage.ClientResponse.Alert(msg);
                return;
            }

            Sitecore.Shell.Framework.Commands.System.Publish.Run(args);
        }
        public override CommandState QueryState(CommandContext context)
        {
            Assert.IsNotNull(context, "context");

            if (PublishingHelper.CanPublishDatabase(Sitecore.Context.ContentDatabase) &&
                context.Items.Length == 1 &&
                context.Items[0] != null &&
                (PublishingHelper.CanPublishItem(context.Items[0], Sitecore.Context.User) || context.Items[0].HasChildren))
            {
                return(base.QueryState(context));
            }

            return(CommandState.Disabled);
        }