Пример #1
0
        protected void doRollback_Click(object sender, System.EventArgs e)
        {
            if (allVersions.SelectedValue.Trim() != "")
            {
                Document d = new Document(int.Parse(helper.Request("nodeId")));
                d.RollBack(new Guid(allVersions.SelectedValue), base.getUser());

                BusinessLogic.Log.Add(BusinessLogic.LogTypes.RollBack, base.getUser(), d.Id, "Version rolled back to revision '" + allVersions.SelectedValue + "'");

                Document rollback = new Document(d.Id, new Guid(allVersions.SelectedValue));
                feedBackMsg.type = global::umbraco.uicontrols.Feedback.feedbacktype.success;
                string[] vars = { rollback.Text, rollback.VersionDate.ToLongDateString() };

                feedBackMsg.Text   = ui.Text("rollback", "documentRolledBack", vars, new global::umbraco.BusinessLogic.User(0)) + "</p><p><a href='#' onclick='" + ClientTools.Scripts.CloseModalWindow() + "'>" + ui.Text("closeThisWindow") + "</a>";
                diffPanel.Visible  = false;
                pl_buttons.Visible = false;

                ClientTools.ReloadLocationIfMatched(string.Format("/content/content/edit/{0}", d.Id));
            }
        }