protected void AddNotification(string message, Sitecore.Data.Items.Item item, Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs args) { Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs.ContentEditorWarning warning = args.Add(); warning.Title = "Item Naming"; warning.Text = message; warning.Icon = "/assets/img/about.png"; }
protected void AddNotification(string message, Sitecore.Data.Items.Item item, Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs args, Item redirectitem) { Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs.ContentEditorWarning note = args.Add(); note.Title = Translate.Text("Redirect Manager"); note.Text = String.Format(Translate.Text("The URL \"{0}\" is currently redirecting to this page."), redirectitem["Requested Url"]); note.AddOption(Translate.Text("Review the redirect definition"), string.Format("item:load(id={0}, language={1}, version={2})", redirectitem.ID, redirectitem.Language, redirectitem.Version)); note.AddOption(Translate.Text("Delete the redirect definition"), string.Format("redirectmanager:delete(id={0}, language={1}, version={2}, item={3})", redirectitem.ID, redirectitem.Language, redirectitem.Version, item.ID)); }
protected void AddLinkToRedirectItem(string message, Sitecore.Data.Items.Item item, Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs args) { Database db = Sitecore.Data.Database.GetDatabase("master"); Item target = db.GetItem(item["Redirect To Item"]); if (target != null) { Sitecore.Pipelines.GetContentEditorWarnings.GetContentEditorWarningsArgs.ContentEditorWarning note = args.Add(); note.Title = Translate.Text("Redirect Manager"); note.Text = Translate.Text("This item is a redirect item. Would you like to manage the redirect target?"); note.AddOption(target.DisplayName, string.Format("item:load(id={0}, language={1}, version={2})", target.ID, target.Language, target.Version)); } }