Ejemplo n.º 1
0
        /// <summary>
        /// Adds the block move.
        /// </summary>
        private void AddBlockMove()
        {
            // Add Zone Selection Popup (for moving blocks to another zone)
            ModalDialog modalBlockMove = new ModalDialog();
            modalBlockMove.ID = "modal-block-move";
            modalBlockMove.Title = "Move Block";
            modalBlockMove.OnOkScript = "saveBlockMove();";
            this.Form.Controls.Add( modalBlockMove );

            HtmlGenericControl fsZoneSelect = new HtmlGenericControl( "fieldset" );
            fsZoneSelect.ClientIDMode = ClientIDMode.Static;
            fsZoneSelect.Attributes.Add( "id", "fsZoneSelect" );
            modalBlockMove.Content.Controls.Add( fsZoneSelect );

            HtmlGenericControl legend = new HtmlGenericControl( "legend" );
            legend.InnerText = "New Location";
            fsZoneSelect.Controls.Add( legend );

            LabeledDropDownList ddlZones = new LabeledDropDownList();
            ddlZones.ClientIDMode = ClientIDMode.Static;
            ddlZones.ID = "block-move-zone";
            ddlZones.LabelText = "Zone";
            foreach ( var zone in Zones )
                ddlZones.Items.Add( new ListItem( zone.Value.Key, zone.Value.Value.ID ) );
            fsZoneSelect.Controls.Add( ddlZones );

            LabeledRadioButtonList rblLocation = new LabeledRadioButtonList();
            rblLocation.RepeatLayout = RepeatLayout.UnorderedList;
            rblLocation.ClientIDMode = ClientIDMode.Static;
            rblLocation.ID = "block-move-Location";
            rblLocation.CssClass = "inputs-list";
            rblLocation.Items.Add( new ListItem( "Current Page" ) );
            rblLocation.Items.Add( new ListItem( string.Format( "All Pages Using the '{0}' Layout", CurrentPage.Layout ) ) );
            rblLocation.LabelText = "Parent";
            fsZoneSelect.Controls.Add( rblLocation );
        }
Ejemplo n.º 2
0
        private void AddBlockMove()
        {
            // Add Zone Selection Popup (for moving blocks to another zone)
            HtmlGenericControl divBlockMove = new HtmlGenericControl( "div" );
            divBlockMove.ClientIDMode = ClientIDMode.Static;
            divBlockMove.Attributes.Add( "id", "modal-block-move" );
            divBlockMove.Attributes.Add( "class", "modal hide fade" );
            this.Form.Controls.Add( divBlockMove );

            HtmlGenericControl divBlockMoveHeader = new HtmlGenericControl( "div" );
            divBlockMoveHeader.Attributes.Add( "class", "modal-header" );
            divBlockMove.Controls.Add( divBlockMoveHeader );

            HtmlGenericControl aClose = new HtmlGenericControl( "a" );
            aClose.Attributes.Add( "href", "#" );
            aClose.Attributes.Add( "class", "close" );
            aClose.InnerHtml = "&times;";
            divBlockMoveHeader.Controls.Add( aClose );

            HtmlGenericControl hTitle = new HtmlGenericControl( "h3" );
            hTitle.InnerText = "Move Block";
            divBlockMoveHeader.Controls.Add( hTitle );

            HtmlGenericControl divBlockMoveBody = new HtmlGenericControl( "div" );
            divBlockMoveBody.Attributes.Add( "class", "modal-body" );
            divBlockMove.Controls.Add( divBlockMoveBody );

            HtmlGenericControl fsZoneSelect = new HtmlGenericControl( "fieldset" );
            fsZoneSelect.ClientIDMode = ClientIDMode.Static;
            fsZoneSelect.Attributes.Add( "id", "fsZoneSelect" );
            divBlockMoveBody.Controls.Add( fsZoneSelect );

            HtmlGenericControl legend = new HtmlGenericControl( "legend" );
            legend.InnerText = "New Location";
            fsZoneSelect.Controls.Add( legend );

            LabeledDropDownList ddlZones = new LabeledDropDownList();
            ddlZones.ClientIDMode = ClientIDMode.Static;
            ddlZones.ID = "block-move-zone";
            ddlZones.LabelText = "Zone";
            foreach ( var zone in Zones )
                ddlZones.Items.Add( new ListItem( zone.Value.Key, zone.Value.Value.ID ) );
            fsZoneSelect.Controls.Add( ddlZones );

            LabeledRadioButtonList rblLocation = new LabeledRadioButtonList();
            rblLocation.RepeatLayout = RepeatLayout.UnorderedList;
            rblLocation.ClientIDMode = ClientIDMode.Static;
            rblLocation.ID = "block-move-Location";
            rblLocation.CssClass = "inputs-list";
            rblLocation.Items.Add( new ListItem( "Current Page" ) );
            rblLocation.Items.Add( new ListItem( string.Format( "All Pages Using the '{0}' Layout", PageInstance.Layout ) ) );
            rblLocation.LabelText = "Parent";
            fsZoneSelect.Controls.Add( rblLocation );

            HtmlGenericControl divBlockMoveFooter = new HtmlGenericControl( "div" );
            divBlockMoveFooter.Attributes.Add( "class", "modal-footer" );
            divBlockMove.Controls.Add( divBlockMoveFooter );

            HtmlGenericControl modalSecondary = new HtmlGenericControl( "a" );
            modalSecondary.ID = "block-move-cancel";
            modalSecondary.Attributes.Add( "href", "#" );
            modalSecondary.Attributes.Add( "class", "btn secondary" );
            modalSecondary.InnerText = "Cancel";
            divBlockMoveFooter.Controls.Add( modalSecondary );

            HtmlGenericControl modalPrimary = new HtmlGenericControl( "a" );
            modalPrimary.ID = "block-move-save";
            modalPrimary.Attributes.Add( "href", "#" );
            modalPrimary.Attributes.Add( "class", "btn primary" );
            modalPrimary.InnerText = "Save";
            divBlockMoveFooter.Controls.Add( modalPrimary );
        }