PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/pigeoncms/Modules/PigeonCms.StaticPagesAdmin/views/Default.ascx

http://pigeoncms.googlecode.com/
ASP.NET | 134 lines | 118 code | 16 blank | 0 comment | 2 complexity | 6b92480f0a51eea1440a047f299d5a2a MD5 | raw file
  1<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Default.ascx.cs" Inherits="Controls_StaticPagesAdmin" %>
  2<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  3<%@ Register src="~/Controls/ContentEditorControl.ascx" tagname="ContentEditorControl" tagprefix="uc1" %>
  4<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
  5
  6
  7<script type="text/javascript">
  8// <!CDATA[
  9
 10function ismaxlength(obj){
 11    var mlength=obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : "";
 12    if (obj.getAttribute && obj.value.length > mlength)
 13        obj.value=obj.value.substring(0, mlength);
 14}
 15
 16//use in popup version
 17function closePopup() { parent.$.fancybox.close(); }
 18
 19// ]]>
 20</script>
 21
 22<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="Upd1">
 23    <ProgressTemplate>
 24        <div class="loading"><%=PigeonCms.Utility.GetLabel("LblLoading", "loading") %></div>
 25    </ProgressTemplate>
 26</asp:UpdateProgress>
 27    
 28<asp:UpdatePanel ID="Upd1" runat="server">
 29<ContentTemplate>
 30
 31    <asp:Label ID="LblErr" runat="server" Text="" CssClass="errore"></asp:Label>
 32    <asp:Label ID="LblOk" runat="server" Text="" CssClass="success"></asp:Label>
 33
 34    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" 
 35        onactiveviewchanged="MultiView1_ActiveViewChanged">
 36    
 37        <asp:View ID="ViewSee" runat="server">
 38            <div class="adminToolbar">
 39                <asp:Button ID="BtnNew" runat="server" Text="<%$ Resources:PublicLabels, CmdNew %>" CssClass="button" OnClick="BtnNew_Click" />
 40            </div>
 41            <br />
 42            <asp:GridView ID="Grid1" Width="100%" runat="server" AllowPaging="True" AllowSorting="false" AutoGenerateColumns="False"
 43                DataSourceID="ObjDs1" DataKeyNames="PageName" OnRowCommand="Grid1_RowCommand" OnRowCreated="Grid1_RowCreated">
 44                <Columns>
 45                    <asp:TemplateField>
 46                        <ItemTemplate>
 47                        <asp:ImageButton ID="LnkSel" CommandName="Select" CommandArgument='<%#Eval("pageName") %>' 
 48                        runat="server" SkinID="ImgEditFile" />                
 49                        </ItemTemplate>
 50                    </asp:TemplateField>
 51                    <asp:BoundField DataField="PageName" HeaderText="Nome" SortExpression="PageName" />
 52                    <asp:BoundField DataField="PageTitle" HeaderText="Titolo" SortExpression="PageTitle" />
 53                    <asp:TemplateField HeaderText="Visibile" SortExpression="Visible">
 54                        <ItemTemplate>
 55                        <asp:CheckBox ID="CheckBox1" Enabled="false" Checked='<%#Eval("Visible") %>' runat="server" />                
 56                        </ItemTemplate>
 57                    </asp:TemplateField>
 58                    <asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderStyle-Width="20">
 59                        <ItemTemplate>
 60                        <asp:ImageButton ID="LnkDel" CommandName="DeleteRow" CommandArgument='<%#Eval("pageName") %>' runat="server" SkinID="ImgDelFile" 
 61                        OnClientClick="return confirm('Cancellare la riga?');"  />
 62                        </ItemTemplate>
 63                    </asp:TemplateField>
 64                </Columns>
 65            </asp:GridView>
 66            
 67            <asp:ObjectDataSource ID="ObjDs1" runat="server" SortParameterName="sort"
 68                SelectMethod="GetByFilter" TypeName="PigeonCms.StaticPagesManager" OnSelecting="ObjDs1_Selecting">
 69                <SelectParameters>
 70                    <asp:Parameter Name="filter" Type="Object" />
 71                    <asp:Parameter Name="sort" Type="String" DefaultValue="PageName" />
 72                </SelectParameters>
 73                <DeleteParameters>
 74                    <asp:Parameter Name="pageName" Type="String" />
 75                </DeleteParameters>
 76            </asp:ObjectDataSource>
 77        </asp:View>
 78   
 79
 80        <asp:View ID="ViewInsert" runat="server">
 81        
 82            <div class="adminToolbar">
 83                <asp:Button ID="BtnSave" runat="server" Text="<%$ Resources:PublicLabels, CmdSave %>" 
 84                    CssClass="button" OnClick="BtnSave_Click" />
 85                <asp:Button ID="BtnApply" runat="server" Text="<%$ Resources:PublicLabels, CmdApply %>" 
 86                    CssClass="button" OnClick="BtnApply_Click" />
 87                <asp:Button ID="BtnCancel" runat="server" Text="<%$ Resources:PublicLabels, CmdCancel %>" 
 88                    CssClass="button" OnClick="BtnCancel_Click" />
 89            </div>
 90            
 91            <div class="col width-100">
 92            <fieldset class="adminForm">
 93                <legend></legend>
 94                <asp:TextBox ID="TxtId" runat="server" Enabled="false" visible="false"></asp:TextBox>
 95                <table class="adminTable">
 96                <tr>
 97                    <td class="key"><%=base.GetLabel("LblName", "Name", TxtPageName, true)%></td>
 98                    <td style="width: 571px">
 99                        <asp:TextBox ID="TxtPageName" MaxLength="50" runat="server" Enabled="false" Width="255px"></asp:TextBox></td>
100                </tr>
101                <tr>
102                    <td class="key"><%=base.GetLabel("LblTitle", "Title", null, true)%></td>
103                    <td class="listItemAlternate">
104                        <asp:Panel runat="server" ID="PanelPageTitle"></asp:Panel>
105                    </td>
106                </tr>            
107                <tr>
108                    <td class="key"><%=base.GetLabel("LblShowTitle", "Show title", ChkShowPageTitle, true)%></td>
109                    <td class="listItemAlternate">
110                        <asp:CheckBox ID="ChkShowPageTitle" runat="server" Enabled="true" />
111                    </td>
112                </tr>
113                <tr>
114                    <td class="key"><%=base.GetLabel("LblVisible", "Visible", ChkVisibile, true)%></td>
115                    <td class="listItemAlternate">
116                        <asp:CheckBox ID="ChkVisibile" runat="server" Enabled="true" />
117                    </td>
118                </tr>
119                <tr>
120                    <td class="key" colspan="2"><%=base.GetLabel("LblContent", "Content", null, true)%></td>
121                </tr>
122                <tr>
123                    <td style="vertical-align:top;" colspan="2">
124                        <asp:Panel runat="server" ID="PanelPageContent"></asp:Panel>
125                    </td>
126                </tr>
127                </table>
128            </fieldset>
129            </div>
130        </asp:View>
131    </asp:MultiView>
132
133</ContentTemplate>
134</asp:UpdatePanel>