using System.Collections.Generic; using Sitecore.Data.Fields; using Sitecore.Pipelines.GetChromeData; namespace Konabos.RteSources.Pipelines { /// This resolves the RTE profile for the field webedit toolbar in EE mode public class RteTokenSourceChrome : GetChromeDataProcessor { public override void Process(GetChromeDataArgs args) { if (!args.ChromeType.Equals("field")) return; Field field = args.CustomData["field"] as Field; if (field != null && field.Type != "Rich Text" && !field.Source.StartsWith("site:")) return; string profilePath = SourceHelper.ResolveSource(field.Source, args.CommandContext.Items[0]); if (profilePath == field.Source) return; profilePath += "/WebEdit Buttons"; this.AddButtonsToChromeData((IEnumerable)base.GetButtons(profilePath), args); } } }