コード例 #1
0
        protected override void OnInit(EventArgs e)
        {
            // Tab setup
            packageInfo = TabView1.NewTabPage("Package Properties");
            packageInfo.Controls.Add(Pane1);
            packageInfo.Controls.Add(Pane5);
            packageInfo.Controls.Add(Pane1_1);
            packageInfo.Controls.Add(Pane1_2);
            packageInfo.Controls.Add(Pane1_3);


            packageContents = TabView1.NewTabPage("Package Contents");
            packageContents.Controls.Add(Pane2);
            packageContents.Controls.Add(Pane2_1);
            packageContents.Controls.Add(Pane2_2);
            packageContents.Controls.Add(Pane2_3);
            packageContents.Controls.Add(Pane2_4);
            packageContents.Controls.Add(Pane2_5);
            packageContents.Controls.Add(Pane2_6);
            packageContents.Controls.Add(Pane2_7);

            packageFiles = TabView1.NewTabPage("Package Files");
            packageFiles.Controls.Add(Pane3);
            packageFiles.Controls.Add(Pane3_1);
            packageFiles.Controls.Add(Pane3_2);

            packageActions = TabView1.NewTabPage("Package Actions");
            packageActions.Controls.Add(Pane4);

            //var pubs = TabView1.Menu.NewButton();
            //pubs.Text = Services.TextService.Localize("publish");
            //pubs.CommandName = "publish";
            //pubs.Command += new CommandEventHandler(saveOrPublish);
            //pubs.ID = "saveAndPublish";

            //var saves = TabView1.Menu.NewButton();
            //saves.Text = Services.TextService.Localize("save");
            //saves.CommandName = "save";
            //saves.Command += new CommandEventHandler(saveOrPublish);
            //saves.ButtonType = Umbraco.Web._Legacy.Controls.MenuButtonType.Primary;
            //saves.ID = "save";



            base.OnInit(e);
        }
コード例 #2
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            // Tab setup
            InfoTabPage = TabView1.NewTabPage("Macro Properties");
            InfoTabPage.Controls.Add(Pane1);
            InfoTabPage.Controls.Add(Pane1_2);
            InfoTabPage.Controls.Add(Pane1_3);
            InfoTabPage.Controls.Add(Pane1_4);

            Parameters = TabView1.NewTabPage("Parameters");
            Parameters.Controls.Add(Panel2);

            //var save = TabView1.Menu.NewButton();
            //save.ButtonType = MenuButtonType.Primary;
            //save.Text = Services.TextService.Localize("save");
            //save.ID = "save";
            //save.Click += Save_Click;
        }
コード例 #3
0
        private void setupInfoPane()
        {
            InfoTabPage = TabView1.NewTabPage("Info");
            InfoTabPage.Controls.Add(pnlInfo);

            InfoTabPage.Style.Add("text-align", "center");

            ImageButton Save = InfoTabPage.Menu.NewImageButton();

            Save.Click += new System.Web.UI.ImageClickEventHandler(save_click);

            Save.ImageUrl      = UmbracoPath + "/images/editor/save.gif";
            Save.AlternateText = ui.Text("save");
            var listOfIcons = new List <ListItem>();

            // Get icons
            // nh css file update, add support for css sprites
            foreach (string iconClass in cms.businesslogic.CMSNode.DefaultIconClasses)
            {
                ListItem li = new ListItem(helper.SpaceCamelCasing((iconClass.Substring(1, iconClass.Length - 1))).Replace("Spr Tree", "").Trim(), iconClass);
                li.Attributes.Add("class", "spriteBackground sprTree " + iconClass.Trim('.'));
                li.Attributes.Add("style", "padding-left:20px !important; background-repeat:no-repeat;");

                if (!this.Page.IsPostBack && li.Value == cType.IconUrl)
                {
                    li.Selected = true;
                }
                listOfIcons.Add(li);
            }

            DirectoryInfo dirInfo = new DirectoryInfo(UmbracoContext.Current.Server.MapPath(SystemDirectories.Umbraco + "/images/umbraco"));

            FileInfo[] fileInfo = dirInfo.GetFiles();
            for (int i = 0; i < fileInfo.Length; i++)
            {
                // NH: don't show the sprite file
                if (fileInfo[i].Name != "sprites.png" && fileInfo[i].Name != "sprites_ie6.gif")
                {
                    ListItem li = new ListItem(fileInfo[i].Name + " (deprecated)", fileInfo[i].Name);
                    li.Attributes.Add("title", this.ResolveClientUrl(SystemDirectories.Umbraco + "/images/umbraco/" + fileInfo[i].Name));

                    if (li.Value == cType.IconUrl)
                    {
                        li.Selected = true;
                    }
                    listOfIcons.Add(li);
                }
            }

            ddlIcons.Items.AddRange(listOfIcons.OrderBy(o => o.Text).ToArray());

            // Get thumbnails
            dirInfo  = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Umbraco + "/images/thumbnails"));
            fileInfo = dirInfo.GetFiles();
            for (int i = 0; i < fileInfo.Length; i++)
            {
                ListItem li = new ListItem(fileInfo[i].Name);
                li.Attributes.Add("title", this.ResolveClientUrl(SystemDirectories.Umbraco + "/images/thumbnails/" + fileInfo[i].Name));
                if (!this.Page.IsPostBack && li.Value == cType.Thumbnail)
                {
                    li.Selected = true;
                }
                ddlThumbnails.Items.Add(li);
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", @"
function refreshDropDowns() {
    jQuery('#" + ddlIcons.ClientID + @"').msDropDown({ showIcon: true, style: 'width:250px;' });
    jQuery('#" + ddlThumbnails.ClientID + @"').msDropDown({ showIcon: false, rowHeight: '130', visibleRows: '2', style: 'width:250px;' });
}
jQuery(function() { refreshDropDowns(); });
", true);

            txtName.Text     = cType.GetRawText();
            txtAlias.Text    = cType.Alias;
            description.Text = cType.GetRawDescription();
        }