public void Process(GetContentEditorFieldsArgs args) { Assert.ArgumentNotNull(args, "args"); if (args.Sections == null || args.Sections.Count == 0) { return; } this.args = args; for (int sectionIndex = 0; sectionIndex < args.Sections.Count; sectionIndex++) { Editor.Section section = args.Sections[sectionIndex]; TrimFields(section); if (Settings.HidingEmptySections && section.Fields.Count == 0) { args.Sections.RemoveAt(sectionIndex); sectionIndex--; } } }
protected void NavigatorMenu_DropDown() { Item item; Item item2; this.ContentEditorDataContext.GetState(out item2, out item); if (item != null) { Hashtable fieldInfo = this.FieldInfo; Editor.Sections sections = new Editor.Sections(); GetContentEditorFieldsArgs args = new GetContentEditorFieldsArgs(item) { Sections = sections, FieldInfo = new Hashtable(), ShowDataFieldsOnly = !UserOptions.ContentEditor.ShowSystemFields }; using (new LongRunningOperationWatcher(Settings.Profiling.RenderFieldThreshold, "getContentEditorFields pipeline[id={0}]", new string[] { item.ID.ToString() })) { CorePipeline.Run("getContentEditorFields", args); } HtmlTextWriter writer = new HtmlTextWriter(new StringWriter()); writer.Write("<table class=\"scEditorHeaderNavigatorMenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" onclick=\"javascript:return scForm.Content.scrollTo(this, event);\">"); foreach (Editor.Section section in sections) { writer.Write("<tr><td><a id=\"Nav_" + section.ControlID + "\" href=\"#\" class=\"scEditorHeaderNavigatorSection\">" + section.DisplayName + "<a></td></tr>"); foreach (Editor.Field field in section.Fields) { string controlID = field.ControlID; foreach (FieldInfo info in fieldInfo.Values) { if (info.FieldID == field.TemplateField.ID) { controlID = info.ID; break; } } string str2 = WebUtil.SafeEncode(StringUtil.GetString(new string[] { field.TemplateField.GetTitle(Context.Language), field.TemplateField.Name })); writer.Write("<tr><td><a id=\"Nav_" + controlID + "\" href=\"#\" class=\"scEditorHeaderNavigatorField\">" + str2 + "<a></td></tr>"); } } writer.Write("</table>"); SheerResponse.ShowPopup("ContentEditorNavigator", "below", writer.InnerWriter.ToString()); } }
protected abstract void DoProcess(GetContentEditorFieldsArgs args);
public void Process(GetContentEditorFieldsArgs args) { KernelContainer.Inject(this); this.DoProcess(args); }