public MenuButton NewButton(int index = -1) { MenuButton btn = new MenuButton(); if (index > -1) Icons.Insert(index, btn); else Icons.Add(btn); return btn; }
override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); Panel1.hasMenu = true; save = Panel1.Menu.NewButton(); save.Text = ui.Text("save"); save.Click += new EventHandler(save_click); save.ButtonType = MenuButtonType.Primary; Panel1.Text = ui.Text("membergroup"); }
protected override void OnInit(EventArgs e) { base.OnInit(e); var editor = Panel1.NewTabPage(ui.Text("stylesheet")); editor.Controls.Add(Pane7); var props = Panel1.NewTabPage(ui.Text("properties")); props.Controls.Add(Pane8); SaveButton = Panel1.Menu.NewButton(); SaveButton.Text = ui.Text("save"); SaveButton.ButtonType = MenuButtonType.Primary; SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; }
protected override void OnInit(EventArgs e) { base.OnInit(e); SaveButton = UmbracoPanel1.Menu.NewButton(); SaveButton.ToolTip = "Save scripting File"; SaveButton.Text = ui.Text("save"); SaveButton.OnClientClick = "return false;"; SaveButton.ID = "save"; SaveButton.ButtonType = MenuButtonType.Primary; var code = UmbracoPanel1.NewTabPage("code"); code.Controls.Add(Pane1); var props = UmbracoPanel1.NewTabPage("properties"); props.Controls.Add(Pane2); // Add source and filename String file = IOHelper.MapPath(SystemDirectories.MacroScripts + "/" + Request.QueryString["file"]); // validate file IOHelper.ValidateEditPath(file, SystemDirectories.MacroScripts); // validate extension IOHelper.ValidateFileExtension(file, validScriptingExtensions()); pythonFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.MacroScripts), "").Substring(1).Replace(@"\", "/"); StreamReader SR; string S; SR = File.OpenText(file); S = SR.ReadToEnd(); SR.Close(); pythonSource.Text = S; }
protected override void OnInit(EventArgs e) { base.OnInit(e); //check if a templateId is assigned, meaning we are editing a template if (!Request.QueryString["templateID"].IsNullOrWhiteSpace()) { _template = new Template(int.Parse(Request.QueryString["templateID"])); TemplateTreeSyncPath = "-1,init," + _template.Path.Replace("-1,", ""); } else if (!Request.QueryString["file"].IsNullOrWhiteSpace()) { //we are editing a view (i.e. partial view) OriginalFileName = HttpUtility.UrlDecode(Request.QueryString["file"]); TemplateTreeSyncPath = "-1,init," + Path.GetFileName(OriginalFileName); } else { throw new InvalidOperationException("Cannot render the editor without a supplied templateId or a file"); } Panel1.hasMenu = true; var editor = Panel1.NewTabPage(ui.Text("template")); editor.Controls.Add(Pane8); var props = Panel1.NewTabPage(ui.Text("properties")); props.Controls.Add(Pane7); SaveButton = Panel1.Menu.NewButton(); SaveButton.Text = ui.Text("save"); SaveButton.ButtonType = MenuButtonType.Primary; SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; Panel1.Text = ui.Text("edittemplate"); pp_name.Text = ui.Text("name", base.getUser()); pp_alias.Text = ui.Text("alias", base.getUser()); pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser()); // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA&mvcView=true", ui.Text("template", "insertPageField"), 640, 550); umbField.AltText = ui.Text("template", "insertPageField"); // TODO: Update icon MenuIconI umbDictionary = editorSource.Menu.NewIcon(); umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; umbDictionary.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY&mvcView=true", ui.Text("template", "insertDictionaryItem"), 640, 550); umbDictionary.AltText = "Insert umbraco dictionary item"; var macroSplitButton = new InsertMacroSplitButton { ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}", ClientCallbackOpenMacroModel = "function(alias) {editViewEditor.openMacroModal(alias);}" }; editorSource.Menu.InsertNewControl(macroSplitButton, 40); if (_template == null) { InitializeEditorForPartialView(); } else { InitializeEditorForTemplate(); } }
protected override void OnInit(EventArgs e) { _template = new Template(int.Parse(Request.QueryString["templateID"])); // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); Panel1.hasMenu = true; var editor = Panel1.NewTabPage(ui.Text("template")); editor.Controls.Add(Pane8); var props = Panel1.NewTabPage(ui.Text("properties")); props.Controls.Add(Pane7); SaveButton = Panel1.Menu.NewButton(); SaveButton.Text = ui.Text("save"); SaveButton.ButtonType = MenuButtonType.Primary; SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; Panel1.Text = ui.Text("edittemplate"); pp_name.Text = ui.Text("name", UmbracoUser); pp_alias.Text = ui.Text("alias", UmbracoUser); pp_masterTemplate.Text = ui.Text("mastertemplate", UmbracoUser); // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); umbField.AltText = ui.Text("template", "insertPageField"); // TODO: Update icon MenuIconI umbDictionary = editorSource.Menu.NewIcon(); umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; umbDictionary.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550); umbDictionary.AltText = "Insert umbraco dictionary item"; editorSource.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { MenuIconI umbContainer = editorSource.Menu.NewIcon(); umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); umbContainer.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpagePlaceholder.aspx?&id=" + _template.Id, ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320); MenuIconI umbContent = editorSource.Menu.NewIcon(); umbContent.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif"; umbContent.AltText = ui.Text("template", "insertContentArea"); umbContent.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/insertMasterpageContent.aspx?id=" + _template.Id, ui.Text("template", "insertContentArea"), 470, 300); } //Spit button editorSource.Menu.InsertSplitter(); editorSource.Menu.NewElement("div", "splitButtonPlaceHolder", "sbPlaceHolder", 40); // Help editorSource.Menu.InsertSplitter(); MenuIconI helpIcon = editorSource.Menu.NewIcon(); helpIcon.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + _template.Alias, ui.Text("template", "quickGuide"), 600, 580); helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; helpIcon.AltText = ui.Text("template", "quickGuide"); }
override protected void OnInit(EventArgs e) { base.OnInit(e); file = Request.QueryString["file"].TrimStart('/'); //need to change the editor type if it is XML if (file.EndsWith("xml")) editorSource.CodeBase = uicontrols.CodeArea.EditorType.XML; else if (file.EndsWith("master")) editorSource.CodeBase = uicontrols.CodeArea.EditorType.HTML; var editor = Panel1.NewTabPage(ui.Text("settings","script")); editor.Controls.Add(Pane7); var props = Panel1.NewTabPage(ui.Text("properties")); props.Controls.Add(Pane8); SaveButton = Panel1.Menu.NewButton(); SaveButton.Text = ui.Text("save"); SaveButton.ButtonType = MenuButtonType.Primary; SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; if (editorSource.CodeBase == uicontrols.CodeArea.EditorType.HTML) { // Editing buttons Panel1.Menu.InsertSplitter(); uicontrols.MenuIconI umbField = Panel1.Menu.NewIcon(); umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; umbField.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); umbField.AltText = ui.Text("template", "insertPageField"); // TODO: Update icon uicontrols.MenuIconI umbDictionary = Panel1.Menu.NewIcon(); umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; umbDictionary.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550); umbDictionary.AltText = "Insert umbraco dictionary item"; uicontrols.MenuIconI umbMacro = Panel1.Menu.NewIcon(); umbMacro.ImageURL = UmbracoPath + "/images/editor/insMacro.gif"; umbMacro.AltText = ui.Text("template", "insertMacro"); umbMacro.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530); // Help Panel1.Menu.InsertSplitter(); uicontrols.MenuIconI helpIcon = Panel1.Menu.NewIcon(); helpIcon.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=", ui.Text("template", "quickGuide"), 600, 580); helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; helpIcon.AltText = ui.Text("template", "quickGuide"); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); SaveButton = UmbracoPanel1.Menu.NewButton(); SaveButton.ToolTip = "Save Xslt File"; SaveButton.Text = ui.Text("save"); SaveButton.ButtonType = MenuButtonType.Primary; SaveButton.ID = "save"; SaveButton.CssClass = "client-side"; var code = UmbracoPanel1.NewTabPage("xslt"); code.Controls.Add(pane1); var props = UmbracoPanel1.NewTabPage("properties"); props.Controls.Add(pane2); var tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/images/editor/insField.GIF"; tmp.OnClickCommand = ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/developer/xslt/xsltinsertvalueof.aspx?objectId=" + editorSource.ClientID, "Insert value", 750, 250); //"umbracoInsertField(document.getElementById('editorSource'), 'xsltInsertValueOf', '','felt', 750, 230, '');"; tmp.AltText = "Insert xslt:value-of"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insMemberItem.GIF"; tmp.OnClickCommand = "UmbEditor.Insert('<xsl:variable name=\"\" select=\"', '\"/>\\n', '" + editorSource.ClientID + "'); return false;"; tmp.AltText = "Insert xsl:variable"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; tmp.OnClickCommand = "UmbEditor.Insert('<xsl:if test=\"CONDITION\">\\n', '\\n</xsl:if>\\n', '" + editorSource.ClientID + "'); return false;"; tmp.AltText = "Insert xsl:if"; tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insChildTemplateNew.GIF"; tmp.OnClickCommand = "UmbEditor.Insert('<xsl:for-each select=\"QUERY\">\\n', '\\n</xsl:for-each>\\n', '" + editorSource.ClientID + "'); return false;"; tmp.AltText = "Insert xsl:for-each"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/insFieldByLevel.GIF"; tmp.OnClickCommand = "UmbEditor.Insert('<xsl:choose>\\n<xsl:when test=\"CONDITION\">\\n', '\\n</xsl:when>\\n<xsl:otherwise>\\n</xsl:otherwise>\\n</xsl:choose>\\n', '" + editorSource.ClientID + "'); return false;"; tmp.AltText = "Insert xsl:choose"; editorSource.Menu.InsertSplitter(); tmp = editorSource.Menu.NewIcon(); tmp.ImageURL = SystemDirectories.Umbraco + "/images/editor/xslVisualize.GIF"; tmp.OnClickCommand = "xsltVisualize();"; tmp.AltText = "Visualize XSLT"; // Add source and filename var file = IOHelper.MapPath(SystemDirectories.Xslt + "/" + Request.QueryString["file"]); // validate file IOHelper.ValidateEditPath(file, SystemDirectories.Xslt); // validate extension IOHelper.ValidateFileExtension(file, new List<string>() { "xslt", "xsl" }); xsltFileName.Text = file.Replace(IOHelper.MapPath(SystemDirectories.Xslt), "").Substring(1).Replace(@"\", "/"); StreamReader SR; string S; SR = File.OpenText(file); S = SR.ReadToEnd(); SR.Close(); editorSource.Text = S; }