PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://pigeoncms.googlecode.com/
ASP.NET | 361 lines | 330 code | 31 blank | 0 comment | 4 complexity | c8da4514c33e71e543dee9e25616c41d MD5 | raw file
  1<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Default.ascx.cs" Inherits="Controls_MenuAdmin" %>
  2<%@ Register src="~/Controls/ModuleParams.ascx" tagname="ModuleParams" tagprefix="uc1" %>
  3<%@ Register src="~/Controls/PermissionsControl.ascx" tagname="PermissionsControl" tagprefix="uc1" %>
  4
  5<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
  6<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="Upd1">
  7    <ProgressTemplate>
  8        <div class="loading"><%=PigeonCms.Utility.GetLabel("LblLoading", "loading") %></div>
  9    </ProgressTemplate>
 10</asp:UpdateProgress>
 11
 12<script type="text/javascript">
 13function preloadTitle(sourceControlName, targetControl)
 14{
 15    if (targetControl.value == "")
 16        targetControl.value = document.getElementById(sourceControlName).value;
 17}
 18
 19function preloadAlias(sourceControlName, targetControl)
 20{
 21    var res = document.getElementById(sourceControlName).value;
 22    if (targetControl.value == "")
 23    {
 24        res = res.toLowerCase();
 25        res = res.replace(/\ /g,'-');    //replace all occurs
 26        targetControl.value = res;
 27    }
 28}
 29
 30function changeModueleTypes() {
 31    var elemname = '#<%=DropModuleTypes.ClientID %>';
 32    $(elemname).removeAttr('disabled');
 33    $(elemname).removeClass('locked');
 34    $('#lnkchange').hide();
 35}
 36
 37function pageLoad(sender, args) {
 38    $("div.fancy a").fancybox({
 39        'width': '80%',
 40        'height': '80%',
 41        'type': 'iframe',
 42        'hideOnContentClick': false,
 43        onClosed: function() { }
 44    });
 45}
 46</script>
 47
 48<asp:UpdatePanel ID="Upd1" runat="server">
 49<ContentTemplate>
 50    
 51    <asp:Label ID="LblErr" runat="server" Text="" CssClass="error"></asp:Label>
 52    <asp:Label ID="LblOk" runat="server" Text="" CssClass="success"></asp:Label>
 53    
 54    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" OnActiveViewChanged="MultiView1_ActiveViewChanged">
 55    
 56        <asp:View ID="ViewSee" runat="server">
 57            <div class="adminToolbar">
 58                <%=PigeonCms.Utility.GetLabel("LblCreateNew", "Create new", DropNewItem)%>&nbsp;
 59                <asp:DropDownList runat="server" ID="DropNewItem"  AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropNewItem_SelectedIndexChanged">
 60                </asp:DropDownList>
 61            </div>
 62            <fieldset class="adminFilters">
 63                <%=PigeonCms.Utility.GetLabel("LblFilters")%>&nbsp;
 64                <asp:DropDownList ID="DropMenuTypesFilter" runat="server" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropMenuTypesFilter_SelectedIndexChanged"></asp:DropDownList>
 65                <asp:DropDownList ID="DropPublishedFilter" runat="server" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropPublishedFilter_SelectedIndexChanged"></asp:DropDownList>
 66                <asp:DropDownList ID="DropMasterPageFilter" runat="server" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropMasterPageFilter_SelectedIndexChanged"></asp:DropDownList>
 67                <asp:DropDownList ID="DropModuleTypesFilter" runat="server" AutoPostBack="true" CssClass="adminMediumText" OnSelectedIndexChanged="DropModuleTypesFilter_SelectedIndexChanged"></asp:DropDownList>
 68            </fieldset>
 69            <br />
 70            <asp:GridView ID="Grid1" runat="server" Width="100%" AllowPaging="True" AllowSorting="false" AutoGenerateColumns="False"
 71                DataSourceID="ObjDs1" DataKeyNames="Id"  OnRowCommand="Grid1_RowCommand" OnRowCreated="Grid1_RowCreated" OnRowDataBound="Grid1_RowDataBound">
 72                <Columns>
 73                    <asp:TemplateField ItemStyle-Width="10">
 74                        <ItemTemplate>
 75                        <asp:ImageButton ID="LnkSel" CommandName="Select" CommandArgument='<%#Eval("Id") %>' 
 76                            runat="server" SkinID="ImgEditFile" />
 77                        </ItemTemplate>
 78                    </asp:TemplateField>
 79                    <asp:BoundField DataField="MenuType" Visible="false" HeaderText="MenuType" SortExpression="MenuType" />
 80                    <asp:TemplateField HeaderText="Name" SortExpression="Name">
 81                        <ItemTemplate>
 82                        <asp:Literal ID="LitName" runat="server" Text=""></asp:Literal>
 83                        </ItemTemplate>
 84                    </asp:TemplateField>                    
 85                    <asp:BoundField DataField="Title" HeaderText="Titolo" SortExpression="Title" Visible="false" />
 86                    <asp:BoundField DataField="Alias" HeaderText="Alias" SortExpression="Alias" />
 87                    <asp:BoundField DataField="CssClass" HeaderText="Css Class" SortExpression="CssClass" />
 88                    <asp:BoundField DataField="CurrThemeStored" HeaderText="Theme" SortExpression="CurrThemeStored" />
 89                    <asp:BoundField DataField="CurrMasterpageStored" HeaderText="Masterpage" SortExpression="CurrMasterpageStored" />
 90                    
 91                    <asp:TemplateField HeaderText="Module name">
 92                        <ItemTemplate>
 93                        <asp:Literal ID="LitModuleNameDesc" runat="server" Text=""></asp:Literal>
 94                        </ItemTemplate>
 95                    </asp:TemplateField>
 96                    
 97                    <asp:TemplateField ItemStyle-Width="10" ItemStyle-HorizontalAlign="Center" HeaderText="Module content">
 98                        <ItemTemplate>
 99                            <div class="fancy">
100                            <asp:HyperLink runat="server" ID="LnkModuleContent" Visible="false">
101                            <asp:Image ID="ImgAttribute" runat="server" SkinID="ImgAttributes" AlternateText="" Visible="true" />
102                            </asp:HyperLink>
103                            </div>
104                        </ItemTemplate>
105                    </asp:TemplateField>
106                    
107                    <asp:TemplateField HeaderText="Visible" ItemStyle-HorizontalAlign="Center">
108                        <ItemTemplate>
109                            <asp:ImageButton runat="server" ID="ImgVisibleOk" CommandName="ImgVisibleOk" CommandArgument='<%#Eval("Id") %>' SkinID="ImgOk" Visible="false" />
110                            <asp:ImageButton runat="server" ID="ImgVisibleKo" CommandName="ImgVisibleKo" CommandArgument='<%#Eval("Id") %>' SkinID="ImgUnchecked" Visible="false" />
111                        </ItemTemplate>
112                    </asp:TemplateField>
113                    <asp:TemplateField HeaderText="Published" ItemStyle-HorizontalAlign="Center">
114                        <ItemTemplate>
115                            <asp:ImageButton runat="server" ID="ImgPublishedOk" CommandName="ImgPublishedOk" CommandArgument='<%#Eval("Id") %>' SkinID="ImgOk" Visible="false" />
116                            <asp:ImageButton runat="server" ID="ImgPublishedKo" CommandName="ImgPublishedKo" CommandArgument='<%#Eval("Id") %>' SkinID="ImgUnchecked" Visible="false" />
117                        </ItemTemplate>
118                    </asp:TemplateField>
119
120                    <asp:TemplateField HeaderText="Access type">
121                        <ItemTemplate>
122                        <asp:Literal ID="LitAccessTypeDesc" runat="server" Text=""></asp:Literal>
123                        </ItemTemplate>
124                    </asp:TemplateField>
125                    
126                    <asp:TemplateField HeaderText="Access Level" SortExpression="AccessCode, AccessLevel">
127                        <ItemTemplate>
128                        <asp:Literal ID="LitAccessLevel" runat="server" Text=""></asp:Literal>
129                        </ItemTemplate>
130                    </asp:TemplateField>
131                    
132                    <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25" ItemStyle-BorderStyle="None">
133                        <ItemTemplate>
134                            <asp:ImageButton ID="ImgMoveUp" CommandName="MoveUp" CommandArgument='<%#Eval("Id") %>'
135                            SkinID="ImgSortAsc" runat="server" />
136                            <asp:ImageButton ID="ImgMoveDown" CommandName="MoveDown" CommandArgument='<%#Eval("Id") %>'
137                            SkinID="ImgSortDesc" runat="server" />
138                        </ItemTemplate>
139                    </asp:TemplateField>
140                    <asp:BoundField DataField="Ordering" HeaderText="Order" SortExpression="Ordering" ItemStyle-HorizontalAlign="Right" />
141
142                    <asp:TemplateField HeaderText="Copy" Visible="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="25">
143                        <ItemTemplate>
144                            <asp:ImageButton ID="LnkCopy" CommandName="CopyRow" CommandArgument='<%#Eval("Id") %>' runat="server" 
145                                SkinID="ImgCopy" />
146                        </ItemTemplate>
147                    </asp:TemplateField>
148
149                    <asp:TemplateField HeaderText="Core" SortExpression="IsCore" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
150                        <ItemTemplate>
151                        <asp:CheckBox Enabled="false" Checked='<%#Eval("IsCore") %>' runat="server" />
152                        </ItemTemplate>
153                    </asp:TemplateField>                    
154                    
155                    <asp:TemplateField HeaderText="Del" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="25">
156                        <ItemTemplate>
157                            <asp:ImageButton ID="LnkDel" CommandName="DeleteRow" CommandArgument='<%#Eval("Id") %>' runat="server" 
158                                SkinID="ImgDelFile" OnClientClick="return confirm('Cancellare la riga?');"  />
159                        </ItemTemplate>
160                    </asp:TemplateField>
161                    
162                    <asp:BoundField DataField="Id" HeaderText="ID" SortExpression="Id" />
163                </Columns>
164            </asp:GridView>
165            
166            <asp:ObjectDataSource ID="ObjDs1" runat="server" SortParameterName="" OnSelecting="ObjDs1_Selecting"
167                SelectMethod="GetTree" TypeName="PigeonCms.MenuManager">
168                <SelectParameters>
169                    <asp:Parameter Name="filter" Type="object" />
170                    <asp:Parameter Name="level" Type="Int32" DefaultValue="-1" />
171                    <asp:Parameter Name="separatorText" Type="String" DefaultValue="--" />
172                </SelectParameters>
173                <DeleteParameters>
174                    <asp:Parameter Name="Id" Type="Int32" />
175                </DeleteParameters>
176            </asp:ObjectDataSource>
177        </asp:View>
178   
179
180        <asp:View ID="ViewInsert" runat="server">
181
182            <div class="adminToolbar">
183                <asp:Button ID="BtnSave" runat="server" Text="<%$ Resources:PublicLabels, CmdSave %>" CssClass="button" OnClick="BtnSave_Click" />
184                <asp:Button ID="BtnApply" runat="server" Text="<%$ Resources:PublicLabels, CmdApply %>" CssClass="button" OnClick="BtnApply_Click" />
185                <asp:Button ID="BtnCancel" CausesValidation="false" runat="server" Text="<%$ Resources:PublicLabels, CmdCancel %>" CssClass="button" OnClick="BtnCancel_Click" />
186            </div>
187            
188            <div class="col width-50">
189                <fieldset class="adminForm">
190                <legend><%=base.GetLabel("LblDetails", "Details") %></legend>
191                <table cellspacing="0" class="adminTable">
192                <tr>
193                    <td class="key"><%=base.GetLabel("LblMenuType", "Menu type", LitMenuType, true)%></td>
194                    <td><asp:Literal ID="LitMenuType" runat="server"></asp:Literal></td>
195                </tr>
196                <tr>
197                    <td class="key"><%=base.GetLabel("LblContentType", "Content type", DropModuleTypes, true)%></td>
198                    <td>
199                        <asp:DropDownList ID="DropModuleTypes" CssClass="adminMediumText locked" runat="server"
200                        AutoPostBack="true" OnSelectedIndexChanged="DropModuleTypes_SelectedIndexChanged"></asp:DropDownList>
201                        <a href="javascript:void(0)" onclick="changeModueleTypes();" id="lnkchange" runat="server">
202                        <%=base.GetLabel("LblChange", "change", null, true) %>
203                        </a>
204                    </td>
205                </tr>                
206                <tr>
207                    <td class="key"><%=base.GetLabel("LblName", "Name", TxtName, true)%></td>
208                    <td>
209                        <asp:TextBox ID="TxtName" MaxLength="200" runat="server" CssClass="adminMediumText"></asp:TextBox>
210                        <asp:RequiredFieldValidator ID="ReqName" ControlToValidate="TxtName" runat="server" Text="*"></asp:RequiredFieldValidator>
211                    </td>
212                </tr>
213                <tr>
214                    <td class="key"><%=base.GetLabel("LblTitle", "Title", null, true)%></td>
215                    <td>
216                        <asp:Panel runat="server" ID="PanelTitle"></asp:Panel>
217                    </td>
218                </tr>
219                <tr>
220                    <td class="key"><%=base.GetLabel("LblTitleWindow", "Window's title", null, true)%></td>
221                    <td>
222                        <asp:Panel runat="server" ID="PanelTitleWindow"></asp:Panel>
223                    </td>
224                </tr>
225                <tr>
226                    <td class="key"><%=base.GetLabel("LblAlias", "Alias", TxtAlias, true)%></td>
227                    <td>
228                        <asp:TextBox ID="TxtAlias" Rows="3" runat="server" CssClass="adminMediumText"></asp:TextBox>
229                        <asp:RequiredFieldValidator ID="ReqAlias" ControlToValidate="TxtAlias" runat="server" Text="*"></asp:RequiredFieldValidator>
230                    </td>
231                </tr>
232                <tr>
233                    <td class="key"><%=base.GetLabel("LblRoute", "Route", DropRouteId, true)%></td>
234                    <td>
235                        <asp:DropDownList ID="DropRouteId" CssClass="adminMediumText" runat="server">
236                        </asp:DropDownList>
237                    </td>
238                </tr>                
239                <tr>
240                    <td class="key"><%=base.GetLabel("LblLink", "Link", TxtLink, true)%></td>
241                    <td>
242                        <asp:TextBox ID="TxtLink" MaxLength="200" runat="server" CssClass="adminMediumText"></asp:TextBox>
243                    </td>
244                </tr>
245                <tr>
246                    <td class="key"><%=base.GetLabel("LblRedirectTo", "Redirect to", DropReferMenuId, true)%></td>
247                    <td>
248                        <asp:DropDownList ID="DropReferMenuId" CssClass="adminMediumText" runat="server">
249                        </asp:DropDownList>
250                    </td>
251                </tr>
252                <tr>
253                    <td class="key"><%=base.GetLabel("LblParentItem", "Parent item", ListParentId, true)%></td>
254                    <td>
255                        <asp:ListBox ID="ListParentId" SelectionMode="Single" Rows="18" runat="server" CssClass="adminMediumText">
256                        </asp:ListBox>
257                    </td>
258                </tr>
259                <tr>
260                    <td class="key"><%=base.GetLabel("LblCssClass", "Css class", TxtCssClass, true)%></td>
261                    <td>
262                        <asp:TextBox ID="TxtCssClass" MaxLength="50" runat="server" CssClass="adminMediumText"></asp:TextBox>
263                    </td>
264                </tr>
265                <tr>
266                    <td class="key"><%=base.GetLabel("LblTheme", "Theme", DropCurrTheme, true)%></td>
267                    <td>
268                        <asp:DropDownList ID="DropCurrTheme" CssClass="adminMediumText" runat="server">
269                        </asp:DropDownList>
270                    </td>
271                </tr>
272                <tr>
273                    <td class="key"><%=base.GetLabel("LblMasterpage", "Masterpage", DropCurrMasterPage, true)%></td>
274                    <td>
275                        <asp:DropDownList ID="DropCurrMasterPage" CssClass="adminMediumText" runat="server">
276                        </asp:DropDownList>
277                    </td>
278                </tr>
279                </table>
280                </fieldset>
281                
282                <fieldset class="adminForm">
283                    <legend><%=base.GetLabel("LblOptions", "Options") %></legend>
284                    
285                    <table cellspacing="0" class="adminTable">
286                    <tr>
287                        <td class="key"><%=base.GetLabel("LblVisible", "Visible", ChkVisible, true)%></td>
288                        <td>
289                            <asp:CheckBox ID="ChkVisible" runat="server" Enabled="true" />
290                        </td>
291                    </tr>
292                    <tr>
293                        <td class="key"><%=base.GetLabel("LblPublished", "Published", ChkPublished, true)%></td>
294                        <td>
295                            <asp:CheckBox ID="ChkPublished" runat="server" Enabled="true" />
296                        </td>
297                    </tr>
298                    <tr>
299                        <td class="key"><%=base.GetLabel("LblOverrideTitle", "Override window title", ChkOverridePageTitle, true)%></td>
300                        <td>
301                            <asp:CheckBox ID="ChkOverridePageTitle" runat="server" Enabled="true" />
302                        </td>
303                    </tr> 
304                    <tr>
305                        <td class="key"><%=base.GetLabel("LblShowModuleTitle", "Show module title", ChkShowModuleTitle, true)%></td>
306                        <td>
307                            <asp:CheckBox ID="ChkShowModuleTitle" runat="server" Enabled="true" />                        
308                        </td>
309                    </tr>
310                    </table>
311                </fieldset>
312            </div>
313            
314            <div class="col width-50">
315                <fieldset class="adminForm recordInfo">
316                    <legend><%=base.GetLabel("LblRecordInfo", "Record info") %></legend>
317                    <table cellspacing="0" class="adminTable">
318                        <tr>
319                            <td class="key"><strong>ID</strong></td>
320                            <td><asp:Label ID="LblId" runat="server" Text=""></asp:Label></td>
321                        </tr>
322                        <tr>
323                            <td class="key"><strong>Module Id</strong></td>
324                            <td><asp:Label ID="LblModuleId" runat="server" Text=""></asp:Label></td>
325                        </tr>
326                        <tr>
327                            <td class="key"><strong>Core</strong></td>
328                            <td>
329                                <asp:CheckBox ID="ChkIsCore" runat="server" Enabled="false" />
330                            </td>
331                        </tr>
332                    </table>
333                </fieldset>
334                
335                <fieldset class="adminForm">
336                    <uc1:PermissionsControl ID="PermissionsControl1" runat="server" />
337                </fieldset>
338                
339                <fieldset class="adminForm">
340                    <legend><%=base.GetLabel("LblViews", "Views") %></legend>
341                    <table cellspacing="0" class="adminTable">
342                    <tr>
343                        <td class="key"><%=base.GetLabel("LblViews", "Views", null, true)%></td>
344                        <td>
345                            <asp:DropDownList ID="DropViews" runat="server" CssClass="adminMediumText">
346                            </asp:DropDownList>
347                        </td>
348                    </tr>                   
349                    </table>
350                </fieldset>
351                
352                <fieldset class="adminForm">
353                    <legend><%=base.GetLabel("LblParameters", "Parameters") %></legend>
354                    <uc1:ModuleParams ID="ModuleParams1" runat="server" />
355                </fieldset>
356            </div>
357        </asp:View>
358    </asp:MultiView>
359
360</ContentTemplate>
361</asp:UpdatePanel>