private void SetupFooter() { CMSWebPartZone footerZone = plc.WebPartZones.FirstOrDefault(z => ((z.ZoneType == WebPartZoneTypeEnum.Footer) || (z.ZoneType == WebPartZoneTypeEnum.DialogFooter))); if ((footerZone != null) && footerZone.IsVisible) { // Wrap the footer content into footer div footerZone.ContentBefore = contentEndTag + footerBeginTag + footerZone.ContentBefore; // Close 'UIFooter' footerZone.ContentAfter += footerEndTag; } else { // Close 'UIContent' plcFooter.Append(contentEndTag); // Display the dialog footer panel only in the top dialog frame var displayDialogFooter = UIContext.IsDialog && (UIContext.RootElementID == UIContext.UIElement.ElementID); if (displayDialogFooter) { // Wrap the footer content into the footer div plcFooter.Append(footerBeginTag); // Render default dialog footer var footerContent = LoadUserControl("~/CMSModules/AdminControls/Controls/UIControls/DialogFooter.ascx"); plcFooter.Append(footerContent); // Close 'UIFooter' plcFooter.Append(footerEndTag); } } }
private void SetupFooter() { CMSWebPartZone footerZone = plc.WebPartZones.FirstOrDefault(z => ((z.ZoneType == WebPartZoneTypeEnum.Footer) || (z.ZoneType == WebPartZoneTypeEnum.DialogFooter))); if ((footerZone != null) && footerZone.IsVisible) { // Wrap the footer content into footer div footerZone.ContentBefore = contentEndTag + footerBeginTag + footerZone.ContentBefore; // Close 'UIFooter' footerZone.ContentAfter += footerEndTag; } else { // Close 'UIContent' ltlFooterBefore.Text += contentEndTag; // Display the dialog footer panel only in the top dialog frame if (UIContext.IsRootDialog) { ltlFooterBefore.Text += footerBeginTag; plcFooter.Visible = true; ltlFooterAfter.Text += footerEndTag; } } }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { StartLayout(true); // Add the zone zone = AddZone(ID + "_zone", ID, pnlZone); zone.LayoutType = ZoneLayoutTypeEnum.Free; zone.CssClass += " WireframeArea"; zone.ZoneWidth = Width; zone.ZoneHeight = Height; FinishLayout(false); }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { StartLayout(true); // Add the zone zone = AddZone(ID + "_zone", ID, pnlZone); zone.LayoutType = ZoneLayoutTypeEnum.Free; zone.CssClass += " WireframeArea"; zone.ZoneWidth = Width; zone.ZoneHeight = Height; FinishLayout(false); }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { StartLayout(); if (IsDesign) { Append("<table class=\"LayoutTable\" cellspacing=\"0\" style=\"width: 100%;\">"); if (ViewModeIsDesign()) { Append("<tr><td class=\"LayoutHeader\">"); // Add header container AddHeaderContainer(); Append("</td></tr>"); } Append("<tr><td>"); } // Content before zones Append(BeforeZones); string separator = Separator; string before = BeforeZone; string after = AfterZone; string zoneclass = ZoneCSSClass; string zonewidth = ZoneWidth; // Render the zones for (int i = 1; i <= Zones; i++) { if (i > 1) { Append(separator); } Append("<div"); // Zone class if (!String.IsNullOrEmpty(zoneclass)) { Append(" class=\"", zoneclass, "\""); } // Zone width if (!String.IsNullOrEmpty(zonewidth)) { Append(" style=\"width: ", zonewidth, "\";"); } Append(">", before); // Add the zone CMSWebPartZone zone = AddZone(ID + "_" + i, "[" + i + "]"); Append(after, "</div>"); } // Content after zones Append(AfterZones); if (IsDesign) { Append("</td></tr>"); // Footer if (AllowDesignMode) { Append("<tr><td class=\"LayoutFooter cms-bootstrap\" colspan=\"2\"><div class=\"LayoutFooterContent\">"); // Zone actions AppendRemoveAction(ResHelper.GetString("Layout.RemoveZone"), "Zones"); Append(" "); AppendAddAction(ResHelper.GetString("Layout.AddZone"), "Zones"); Append("</div></td></tr>"); } Append("</table>"); } // Register scripts string[] scripts = ScriptFiles.Split('\r', '\n'); foreach (string script in scripts) { // Register the script file string sfile = script.Trim(); if (!String.IsNullOrEmpty(sfile)) { ScriptHelper.RegisterScriptFile(Page, sfile); } } // Add init script string resolvedInitScript = MacroResolver.Resolve(InitScript); if (!string.IsNullOrEmpty(resolvedInitScript)) { ScriptHelper.RegisterStartupScript(this, typeof(string), ShortClientID + "_Init", ScriptHelper.GetScript(resolvedInitScript)); } // Register CSS files string[] cssFiles = CSSFiles.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); Array.ForEach(cssFiles, cssFile => CssRegistration.RegisterCssLink(Page, cssFile.Trim())); // Add inline CSS string inlinecss = MacroResolver.Resolve(InlineCSS); if (!string.IsNullOrEmpty(inlinecss)) { // Add css to page header CssRegistration.RegisterCssBlock(Page, "zonesWithEffectInlineCss_" + ClientID, inlinecss); } FinishLayout(); }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { StartLayout(); Append("<div"); // Width string width = this.Width; if (!string.IsNullOrEmpty(width)) { Append(" style=\"width: ", width, "\""); } if (IsDesign) { Append(" id=\"", ShortClientID, "_env\">"); Append("<table class=\"LayoutTable\" cellspacing=\"0\" style=\"width: 100%;\">"); if (this.ViewMode == ViewModeEnum.Design) { Append("<tr><td class=\"LayoutHeader\" colspan=\"2\">"); // Add header container AddHeaderContainer(); Append("</td></tr>"); } Append("<tr><td style=\"width: 100%;\">"); } else { Append(">"); } // Header panel Panel pnlHeader = new Panel(); pnlHeader.ID = "pnlH"; pnlHeader.CssClass = this.HeaderCSSClass; pnlHeader.EnableViewState = false; // Header label Label lblHeader = new Label(); lblHeader.CssClass = this.HeaderCSSClass; lblHeader.ID = "lblH"; pnlHeader.Controls.Add(lblHeader); // Header image Image imgHeader = new Image(); imgHeader.CssClass = this.ImageCSSClass; imgHeader.ID = "imgH"; pnlHeader.Controls.Add(imgHeader); AddControl(pnlHeader); // Content panel Panel pnlContent = new Panel(); pnlContent.CssClass = this.ContentCSSClass; pnlContent.ID = "pnlC"; AddControl(pnlContent); // Add the zone CMSWebPartZone zone = AddZone(this.ID + "_zone", this.ID, pnlContent); // Add the extender CollapsiblePanelExtender cp = new CollapsiblePanelExtender(); cp.ID = "extCP"; cp.TargetControlID = pnlContent.ID; cp.ExpandControlID = pnlHeader.ID; cp.CollapseControlID = pnlHeader.ID; cp.TextLabelID = lblHeader.ID; cp.ImageControlID = imgHeader.ID; cp.ExpandDirection = (this.ExpandDirection.Equals("horz", StringComparison.InvariantCultureIgnoreCase) ? CollapsiblePanelExpandDirection.Horizontal : CollapsiblePanelExpandDirection.Vertical); // Texts string expText = ResHelper.LocalizeString(ExpandedText); string colText = ResHelper.LocalizeString(CollapsedText); cp.ExpandedText = expText; cp.CollapsedText = colText; if (String.IsNullOrEmpty(expText) && String.IsNullOrEmpty(colText)) { lblHeader.Visible = false; } // Images string expImage = this.ExpandedImage; string colImage = this.CollapsedImage; if (!String.IsNullOrEmpty(expImage) && !String.IsNullOrEmpty(colImage)) { cp.ExpandedImage = expImage; cp.CollapsedImage = colImage; } else { imgHeader.Visible = false; } // Sizes int expSize = this.ExpandedSize; if (expSize > 0) { cp.ExpandedSize = expSize; } int collapsed = this.CollapsedSize; if (collapsed >= 0) { cp.CollapsedSize = this.CollapsedSize; } cp.Collapsed = this.Collapsed; if (!IsDesign) { cp.AutoCollapse = this.AutoCollapse; if (this.AutoExpand) { cp.AutoExpand = true; // Ensure some collapsed size if (collapsed < 0) { cp.CollapsedSize = 10; } } } cp.ScrollContents = this.ScrollContent; // Add the extender this.Controls.Add(cp); if (IsDesign) { Append("</td>"); // Width resizer if (AllowDesignMode) { Append("<td class=\"HorizontalResizer\" onmousedown=\"", GetHorizontalResizerScript("env", "Width"), " return false;\"> </td>"); } Append("</tr></table>"); } Append("</div>"); FinishLayout(); }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { string location = Location; bool alwaysVisible = !String.IsNullOrEmpty(location); StartLayout(); if (IsDesign) { Append("<table class=\"LayoutTable\" cellspacing=\"0\">"); if (ViewMode == ViewModeEnum.Design) { Append("<tr><td class=\"LayoutHeader\" colspan=\"2\">"); // Add header container AddHeaderContainer(); Append("</td></tr>"); } Append("<tr><td>"); } string style = null; // Width string width = Width; if (!String.IsNullOrEmpty(width)) { style += " width: " + width + ";"; } // Height string height = Height; if (!String.IsNullOrEmpty(height)) { style += " height: " + height + ";"; } string cssclass = ZoneCSSClass; // Render the envelope if needed bool renderEnvelope = IsDesign || !String.IsNullOrEmpty(style) || !String.IsNullOrEmpty(cssclass); if (renderEnvelope) { Append("<div"); if (IsDesign) { Append(" id=\"", ShortClientID, "_env\""); } if (!String.IsNullOrEmpty(style)) { Append(" style=\"", style, "\""); } if (!String.IsNullOrEmpty(cssclass)) { Append(" class=\"", cssclass, "\""); } Append(">"); } if (alwaysVisible) { // Add the extender AlwaysVisibleControlExtender av = new AlwaysVisibleControlExtender(); av.TargetControlID = "pnlEx"; av.ID = "avExt"; // Horizontal location if (location.EndsWithCSafe("left", true)) { av.HorizontalSide = HorizontalSide.Left; } else if (location.EndsWithCSafe("center", true)) { av.HorizontalSide = HorizontalSide.Center; } else if (location.EndsWithCSafe("right", true)) { av.HorizontalSide = HorizontalSide.Right; } // Horizontal location if (location.StartsWithCSafe("top", true)) { av.VerticalSide = VerticalSide.Top; } else if (location.StartsWithCSafe("middle", true)) { av.VerticalSide = VerticalSide.Middle; } else if (location.StartsWithCSafe("bottom", true)) { av.VerticalSide = VerticalSide.Bottom; } // Offsets av.HorizontalOffset = HorizontalOffset; av.VerticalOffset = VerticalOffset; av.ScrollEffectDuration = ScrollEffectDuration / 1000f; // Add the extender Controls.Add(av); } // Add the zone CMSWebPartZone zone = AddZone(ID + "_zone", ID); if (renderEnvelope) { Append("</div>"); } if (IsDesign) { //zone.CssClass = "ZoneWebPartZone"; //zone.HeaderContainer = this.TitleContainer; Append("</td>"); // Resizers if (AllowDesignMode) { // Vertical resizer Append("<td class=\"HorizontalResizer\" onmousedown=\"", GetHorizontalResizerScript("env", "Width", false, null), " return false;\"> </td></tr><tr>"); // Horizontal resizer Append("<td class=\"VerticalResizer\" onmousedown=\"", GetVerticalResizerScript("env", "Height"), " return false;\"> </td>"); Append("<td class=\"BothResizer\" onmousedown=\"", GetBothResizerScript("env", "Width", "Height"), " return false;\"> </td>"); } Append("</tr></table>"); } // Panel for extender PlaceHolder pnlEx = new PlaceHolder(); pnlEx.ID = "pnlEx"; //pnlEx.Visible = false; AddControl(pnlEx); FinishLayout(); }
/// <summary> /// Prepares the layout of the web part. /// </summary> protected override void PrepareLayout() { StartLayout(); if (IsDesign) { Append("<table class=\"LayoutTable\" cellspacing=\"0\">"); if (ViewModeIsDesign()) { Append("<tr><td class=\"LayoutHeader\" colspan=\"2\">"); // Add header container AddHeaderContainer(); Append("</td></tr>"); } Append("<tr><td>"); } string style = null; // Width string width = Width; if (!String.IsNullOrEmpty(width)) { style += " width: " + width + ";"; } // Height string height = Height; if (!String.IsNullOrEmpty(height)) { style += " height: " + height + ";"; } string cssclass = ZoneCSSClass; // Render the envelope if needed bool renderEnvelope = IsDesign || !String.IsNullOrEmpty(style) || !String.IsNullOrEmpty(cssclass); if (renderEnvelope) { Append("<div"); if (IsDesign) { Append(" id=\"", ShortClientID, "_env\""); } if (!String.IsNullOrEmpty(style)) { Append(" style=\"", style, "\""); } if (!String.IsNullOrEmpty(cssclass)) { Append(" class=\"", cssclass, "\""); } Append(">"); } // Add the zone CMSWebPartZone zone = AddZone(ID + "_zone", ID); if (renderEnvelope) { Append("</div>"); } if (IsDesign) { Append("</td>"); // Resizers if (AllowDesignMode) { // Vertical resizer Append("<td class=\"HorizontalResizer\" onmousedown=\"", GetHorizontalResizerScript("env", "Width", false, null), " return false;\"> </td></tr><tr>"); // Horizontal resizer Append("<td class=\"VerticalResizer\" onmousedown=\"", GetVerticalResizerScript("env", "Height"), " return false;\"> </td>"); Append("<td class=\"BothResizer\" onmousedown=\"", GetBothResizerScript("env", "Width", "Height"), " return false;\"> </td>"); } Append("</tr></table>"); } // Panel for extender PlaceHolder pnlEx = new PlaceHolder(); pnlEx.ID = "pnlEx"; //pnlEx.Visible = false; AddControl(pnlEx); FinishLayout(); }