PageRenderTime 32ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://pigeoncms.googlecode.com/
ASP.NET | 202 lines | 173 code | 29 blank | 0 comment | 0 complexity | 590a681122197622c339a14b7977856d MD5 | raw file
  1<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Default.ascx.cs" Inherits="Controls_CategoriesAdmin" %>
  2<%@ Register src="~/Controls/PermissionsControl.ascx" tagname="PermissionsControl" tagprefix="uc1" %>
  3
  4<script type="text/javascript">
  5// <!CDATA[
  6
  7function pageLoad(sender, args) 
  8{
  9    $("div.fancy a").fancybox({
 10        'width': '75%',
 11        'height': '75%',
 12        'type': 'iframe',
 13        'hideOnContentClick': false,
 14        onClosed: function() { }
 15    });
 16}
 17
 18var deleteQuestion = '<%=PigeonCms.Utility.GetLabel("RECORD_DELETE_QUESTION") %>';
 19
 20// ]]>
 21</script>
 22
 23<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
 24<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="Upd1">
 25    <ProgressTemplate>
 26        <div class="loading"><%=PigeonCms.Utility.GetLabel("LblLoading", "loading") %></div>
 27    </ProgressTemplate>
 28</asp:UpdateProgress>
 29
 30<asp:UpdatePanel ID="Upd1" runat="server">
 31<ContentTemplate>
 32
 33    <asp:Label ID="LblErr" runat="server" Text="" CssClass="error"></asp:Label>
 34    <asp:Label ID="LblOk" runat="server" Text="" CssClass="success"></asp:Label>
 35
 36    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
 37
 38        <asp:View ID="ViewSee" runat="server">
 39            <div class="adminToolbar">
 40                <asp:Button ID="BtnNew" runat="server" Text="<%$ Resources:PublicLabels, CmdNew %>" CssClass="button" OnClick="BtnNew_Click" />
 41            </div>
 42            <fieldset class="adminFilters">
 43                    <%=PigeonCms.Utility.GetLabel("LblFilters", "Filters") %>&nbsp;
 44                    <asp:DropDownList runat="server" ID="DropEnabledFilter" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropEnabledFilter_SelectedIndexChanged">
 45                    </asp:DropDownList>
 46                    <asp:DropDownList ID="DropSectionsFilter" runat="server" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropSectionsFilter_SelectedIndexChanged">
 47                    </asp:DropDownList>
 48            </fieldset>
 49            <br />
 50            <asp:GridView ID="Grid1" runat="server" AllowPaging="True" AllowSorting="false" Width="100%" AutoGenerateColumns="False"
 51                DataSourceID="ObjDs1" DataKeyNames="Id" OnRowCommand="Grid1_RowCommand" OnRowCreated="Grid1_RowCreated" OnRowDataBound="Grid1_RowDataBound">
 52                <Columns>
 53                                  
 54                    <asp:TemplateField ItemStyle-Width="10" Visible="false">
 55                        <ItemTemplate>
 56                        <asp:ImageButton ID="LnkSel" CommandName="Select" CommandArgument='<%#Eval("Id") %>' 
 57                        runat="server" SkinID="ImgEditFile" />                
 58                        </ItemTemplate>
 59                    </asp:TemplateField>
 60                    
 61                    <asp:TemplateField HeaderText="<%$ Resources:PublicLabels, LblTitle %>" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
 62                        <ItemTemplate>
 63                            <asp:LinkButton ID="LnkTitle" runat="server" CausesValidation="false" 
 64                            CommandName="Select" CommandArgument='<%#Eval("Id") %>'></asp:LinkButton>
 65                        </ItemTemplate>
 66                    </asp:TemplateField>
 67
 68                    <asp:TemplateField HeaderText="<%$ Resources:PublicLabels, LblSection %>" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
 69                        <ItemTemplate>
 70                            <asp:Literal ID="LitSectionTitle" runat="server" />
 71                        </ItemTemplate>
 72                    </asp:TemplateField>
 73                    
 74                    <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25" ItemStyle-BorderStyle="None">
 75                        <ItemTemplate>
 76                            <asp:ImageButton ID="ImgMoveUp" CommandName="MoveUp" CommandArgument='<%#Eval("Id") %>'
 77                            SkinID="ImgSortAsc" runat="server" />
 78                            <asp:ImageButton ID="ImgMoveDown" CommandName="MoveDown" CommandArgument='<%#Eval("Id") %>'
 79                            SkinID="ImgSortDesc" runat="server" />
 80                        </ItemTemplate>
 81                    </asp:TemplateField>
 82
 83                    <asp:BoundField DataField="Ordering" HeaderText="<%$ Resources:PublicLabels, LblOrder %>" SortExpression="Ordering" ItemStyle-HorizontalAlign="Right" />
 84                        
 85                    <asp:TemplateField HeaderText="<%$ Resources:PublicLabels, LblEnabled %>" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
 86                        <ItemTemplate>
 87                            <asp:ImageButton runat="server" ID="ImgEnabledOk" CommandName="ImgEnabledOk" CommandArgument='<%#Eval("Id") %>' SkinID="ImgOk" Visible="false" />
 88                            <asp:ImageButton runat="server" ID="ImgEnabledKo" CommandName="ImgEnabledKo" CommandArgument='<%#Eval("Id") %>' SkinID="ImgUnchecked" Visible="false" />
 89                        </ItemTemplate>
 90                    </asp:TemplateField>
 91
 92                    <asp:TemplateField HeaderText="Access type" SortExpression="AccessType">
 93                        <ItemTemplate>
 94                        <asp:Literal ID="LitAccessTypeDesc" runat="server" Text=""></asp:Literal>
 95                        </ItemTemplate>
 96                    </asp:TemplateField>
 97                    
 98                    <asp:TemplateField HeaderText="Access Level" SortExpression="AccessCode, AccessLevel">
 99                        <ItemTemplate>
100                        <asp:Literal ID="LitAccessLevel" runat="server" Text=""></asp:Literal>
101                        </ItemTemplate>
102                    </asp:TemplateField>
103                    
104                    <asp:TemplateField HeaderText="Files" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="60">
105                        <ItemTemplate>
106                            <div class="fancy">
107                                <asp:HyperLink runat="server" ID="LnkUploadFiles">
108                                <asp:Image ID="FilesUpload" runat="server" SkinID="ImgUpload" AlternateText="Gestione files" Visible="true" ToolTip="Gestione files" />
109                                </asp:HyperLink>
110                            </div>
111                            <span><asp:Literal ID="LitFilesCount" runat="server" Text=""></asp:Literal></span>
112                        </ItemTemplate>
113                    </asp:TemplateField>
114                    
115                    <asp:TemplateField HeaderText="Immagini" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="60">
116                        <ItemTemplate>
117                            <div class="fancy">
118                                <asp:HyperLink runat="server" ID="LnkUploadImg">
119                                <asp:Image ID="ImgUpload" runat="server" SkinID="ImgUpload" AlternateText="Gestione immagini" Visible="true" ToolTip="Gestione immagini" />
120                                </asp:HyperLink>
121                            </div>
122                            <span><asp:Literal ID="LitImgCount" runat="server" Text=""></asp:Literal></span>
123                        </ItemTemplate>
124                    </asp:TemplateField>
125                    
126                    <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10">
127                        <ItemTemplate>
128                        <asp:ImageButton ID="LnkDel" CommandName="DeleteRow" CommandArgument='<%#Eval("Id") %>' 
129                        runat="server" SkinID="ImgDelFile" 
130                        OnClientClick="return confirm(deleteQuestion);"  />
131                        </ItemTemplate>
132                    </asp:TemplateField>
133                    
134                    <asp:BoundField DataField="Id" HeaderText="ID" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" />
135                </Columns>
136            </asp:GridView>
137            
138            <asp:ObjectDataSource ID="ObjDs1" runat="server" SortParameterName="sort"
139                SelectMethod="GetByFilter" TypeName="PigeonCms.CategoriesManager" 
140                OnObjectCreating="ObjDs1_ObjectCreating"                
141                OnSelecting="ObjDs1_Selecting">
142                <SelectParameters>
143                    <asp:Parameter Name="filter" Type="Object" />
144                    <asp:Parameter Name="sort" Type="String" DefaultValue="Ordering" />
145                </SelectParameters>
146                <DeleteParameters>
147                    <asp:Parameter Name="Id" Type="Int32" />
148                </DeleteParameters>
149            </asp:ObjectDataSource>
150        </asp:View>
151   
152
153        <asp:View ID="ViewInsert" runat="server">
154            <div class="adminToolbar">
155                <asp:Button ID="BtnSave" runat="server" Text="<%$ Resources:PublicLabels, CmdSave %>" CssClass="button" OnClick="BtnSave_Click" />
156                <asp:Button ID="BtnCancel" runat="server" Text="<%$ Resources:PublicLabels, CmdCancel %>" CssClass="button" OnClick="BtnCancel_Click" />
157            </div>
158            <div class="col width-60">
159                <fieldset class="adminForm">
160                    <legend></legend>
161                    <table class="adminTable">
162                    <tr>
163                        <td class="key"><%=base.GetLabel("LblSection", "Section", DropSections, true)%></td>
164                        <td>
165                            <asp:DropDownList ID="DropSections" runat="server" CssClass="adminMediumText"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
166                        </td>
167                    </tr>
168                    <tr>
169                        <td class="key"><%=base.GetLabel("LblTitle", "Title", null, true)%></td>
170                        <td>
171                            <asp:Panel runat="server" ID="PanelTitle"></asp:Panel>
172                        </td>
173                    </tr>
174                    <tr>
175                        <td class="key"><%=base.GetLabel("LblDescription", "Description", null, true)%></td>
176                        <td>
177                            <asp:Panel runat="server" ID="PanelDescription"></asp:Panel>
178                        </td>
179                    </tr>
180                    <tr>
181                        <td class="key"><%=base.GetLabel("LblEnabled", "Enabled", ChkEnabled, true)%></td>
182                        <td>
183                            <asp:CheckBox ID="ChkEnabled" runat="server" Enabled="true" />
184                        </td>
185                    </tr>
186                    </table>
187                </fieldset>
188            </div>
189
190            <div class="col width-40">
191
192                <fieldset class="adminForm">
193                    <uc1:PermissionsControl ID="PermissionsControl1" runat="server" />
194                </fieldset>
195
196            </div>
197
198        </asp:View>
199    </asp:MultiView>
200
201</ContentTemplate>
202</asp:UpdatePanel>