Ejemplo n.º 1
0
        /// <summary>
        /// Save the Presentation.Table settings to the settings file
        /// </summary>
        /// <param name="tableNode">XML-node for the Presentation.Table settings</param>
        public void Save(XmlNode tableNode)
        {
            string  xpath;
            XmlNode node;

            xpath = "./tableTransformation";
            SettingsHelper.SetSettingValue(xpath, tableNode, TableTransformation.ToString());

            xpath = "./defaultLayout";
            SettingsHelper.SetSettingValue(xpath, tableNode, DefaultLayout.ToString());

            xpath = "./maxColumns";
            SettingsHelper.SetSettingValue(xpath, tableNode, MaxColumns.ToString());

            xpath = "./maxRows";
            SettingsHelper.SetSettingValue(xpath, tableNode, MaxRows.ToString());

            xpath = "./titleVisible";
            SettingsHelper.SetSettingValue(xpath, tableNode, TitleVisible.ToString());

            xpath = "./useStickyHeaderFullscreen";
            SettingsHelper.SetSettingValue(xpath, tableNode, UseStickyHeaderFullscreen.ToString());


            xpath = "./attributes";
            node  = SettingsHelper.GetNode(tableNode, xpath);
            _attributeSettings.Save(node);
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Creates the columns in the layout.
    /// </summary>
    /// <param name="cols">Number of columns</param>
    protected void CreateColumns(int cols)
    {
        // Wrapper
        Append("<div class=\"" + (IncludeContainingRow ? RowCSS : "") + " " + ContainerCSS + " " + (IsDesign || PortalContext.ViewMode == ViewModeEnum.Edit ? "editModeOverlay" : "") + "\">");

        for (int i = 1; i <= cols; i++)
        {
            // Set the width property
            string widthPropertyName         = "Column" + i + "Width";
            string additionalCSSPropertyName = "Column" + i + "AdditionalCSS";
            string colId = "col" + i;

            // Design mode container div
            if (IsDesign)
            {
                Append("<div ");
                // Design mode classes
                if (AllowDesignMode)
                {
                    Append(" class=\"LayoutLeftColumn\"");
                }

                Append(">");
            }

            // Actual Div
            Append("<div");

            // Column Width
            string thisColumnWidth         = ValidationHelper.GetString(GetValue("Column" + i + "Width"), "");
            string thisColumnAdditionalCSS = ValidationHelper.GetString(GetValue("Column" + i + "AdditionalCSS"), "");

            if (!String.IsNullOrEmpty(thisColumnWidth))
            {
                Append(" class=\"", ColumnCSSPrepend + thisColumnWidth, (String.IsNullOrWhiteSpace(thisColumnAdditionalCSS) ? "" : " " + thisColumnAdditionalCSS), "\"");
            }
            else
            {
                // Need to have some column width, if not defined, will set to full width
                Append(" class=\"", ColumnCSSPrepend + MaxColumns.ToString(), (String.IsNullOrWhiteSpace(thisColumnAdditionalCSS) ? "" : " " + thisColumnAdditionalCSS), "\"");
            }

            if (IsDesign)
            {
                Append(" id=\"", ShortClientID, "_", colId, "\"");
            }

            Append(">");

            // Add the zone
            AddZone(ID + "_" + i, "[" + i + "/" + Columns.ToString() + "] Column");

            // Close Column Div
            Append("</div>");

            if (IsDesign)
            {
                Append("</div>");
            }
        }

        // End wrapper
        Append("</div>");
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Prepares the layout of the web part.
    /// </summary>
    protected override void PrepareLayout()
    {
        StartLayout();

        if (IsDesign)
        {
            // Start Complete Wrapper
            Append("<div class=\"" + (IncludeContainingRow ? RowCSS + " " : "") + ContainerCSS + " LayoutTable\" style=\"margin-left: 0; margin-right: 0; " + (ViewModeIsDesign() ? "" : "margin-top:30px;") + "\">", "<div class=\"" + ColumnCSSPrepend + MaxColumns.ToString() + "\">");
            if (ViewModeIsDesign())
            {
                //Append("<tr><td class=\"LayoutHeader\">");
                Append("<div class=\"" + (IncludeContainingRow ? RowCSS + " " : "") + ContainerCSS + "\">", "<div class=\"" + ColumnCSSPrepend + MaxColumns.ToString() + " LayoutHeader\" style=\"padding-left:0; padding-right:0\">");

                // Add header container
                AddHeaderContainer();

                //Append("</td></tr>");
                Append("</div></div>");
            }
            Append("<div class=\"" + (IncludeContainingRow ? RowCSS + " " : "") + ContainerCSS + "\" style=\"" + (ViewModeIsDesign() ? "" : "margin:5px 0;") + "\">");
        }

        // Prepare automatic width
        int cols = Columns;

        // Encapsulating div
        if (IsDesign && AllowDesignMode)
        {
            Append("<div id=\"", ShortClientID, "_all\">");
        }
        else
        {
            Append("<div>");
        }

        // Create columns
        CreateColumns(Columns);


        // End of encapsulating div
        Append("<div style=\"clear: both;\"></div></div>");

        if (IsDesign)
        {
            // Design containing row
            Append("</div>");

            // Footer with actions
            if (AllowDesignMode)
            {
                // Start Footer Row Wrapper
                Append("<div class=\"" + (IncludeContainingRow ? RowCSS + " " : "") + ContainerCSS + " LayoutFooter cms-bootstrap\"><div class=\" " + ColumnCSSPrepend + MaxColumns.ToString() + " LayoutFooterContent\" style=\"min-height:35px;\">");

                // Pane actions
                Append("<div class=\"LayoutLeftActions\">");
                if (Columns < MaxColumns)
                {
                    AppendAddAction("Add Column", "Columns");
                }
                if (Columns > 0)
                {
                    AppendRemoveAction("Remove Column", "Columns");
                }
                Append("</div>");

                // End Footer Row Wrapper
                Append("</div></div>");
            }
            // End complete wrapper
            Append("</div></div>");
        }

        FinishLayout();
    }