PageRenderTime 53ms CodeModel.GetById 38ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/BlogEngine/BlogEngine.NET/admin/Settings/Advanced.aspx

#
ASP.NET | 192 lines | 181 code | 11 blank | 0 comment | 5 complexity | 13d8e5c99545201ddf60f5a940898ba4 MD5 | raw file
  1<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Advanced.aspx.cs" Inherits="admin.Settings.Advanced" %>
  2<%@ Register src="Menu.ascx" tagname="TabMenu" tagprefix="menu" %>
  3
  4<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" Runat="Server"> 
  5    <script type="text/javascript">
  6        $(document).ready(function () {
  7            var frm = document.forms.aspnetForm;
  8            $(frm).validate({
  9                onsubmit: false
 10            });
 11
 12            $("#btnSave").click(function (evt) {
 13                if ($(frm).valid())
 14                    SaveSettings();
 15
 16                evt.preventDefault();
 17            });
 18        });
 19        function SaveSettings() {
 20            $('.loader').show();
 21			
 22            var dto = { 
 23				"enableCompression": $("[id$='_cbEnableCompression']").attr('checked'),
 24				"removeWhitespaceInStyleSheets": $("[id$='_cbRemoveWhitespaceInStyleSheets']").attr('checked'),
 25				"compressWebResource": $("[id$='_cbCompressWebResource']").attr('checked'),
 26				"enableOpenSearch": $("[id$='_cbEnableOpenSearch']").attr('checked'),
 27				"requireSslForMetaWeblogApi": $("[id$='_cbRequireSslForMetaWeblogApi']").attr('checked'),
 28				"wwwSubdomain": $('.rblSubdomain input:radio:checked').val(),
 29				"enableTrackBackSend": $("[id$='_cbEnableTrackBackSend']").attr('checked'),
 30				"enableTrackBackReceive": $("[id$='_cbEnableTrackBackReceive']").attr('checked'),
 31				"enablePingBackSend": $("[id$='_cbEnablePingBackSend']").attr('checked'),
 32				"enablePingBackReceive": $("[id$='_cbEnablePingBackReceive']").attr('checked'),
 33				"enableErrorLogging": $("[id$='_cbEnableErrorLogging']").attr('checked'),
 34				"allowRemoteFileDownloads": $("[id$='_cbAllowRemoteFileDownloads']").attr('checked'),
 35				"remoteTimeout": $("[id$='_txtRemoteTimeout']").attr('value'),
 36				"remoteMaxFileSize": $("[id$='_txtRemoteMaxFileSize']").attr('value'),
 37				"galleryFeedUrl": $("[id$='_txtGalleryFeed']").attr('value')                
 38			};
 39			
 40            $.ajax({
 41                url: SiteVars.ApplicationRelativeWebRoot + "admin/Settings/Advanced.aspx/Save",
 42                type: "POST",
 43                dataType: "json",
 44                contentType: "application/json; charset=utf-8",
 45                data: JSON.stringify(dto),
 46                beforeSend: onAjaxBeforeSend,
 47                success: function (result) {
 48                    var rt = result.d;
 49                    if (rt.Success)
 50                        ShowStatus("success", rt.Message);
 51                    else
 52                        ShowStatus("warning", rt.Message);
 53                }
 54            });
 55            $('.loader').hide();
 56            return false;
 57        }
 58
 59        function warnProviderChange() {
 60            if ($('#ddlProvider').val() == $('#hdnProvider').val()) {
 61                ShowStatus("warning", "No provider change detected, operation cancelled.");
 62                return false;
 63            }
 64            return confirm('***CRITIAL WARNING***\r\n\r\nAre you sure you wish to modify your Storage Provider?\r\n\r\nWhen you modify your' +
 65                           ' storage provider all your uploaded files will be archived, and then moved into your selected provider. Once the move has been completed old File Storage will be deleted.' +
 66                           '\r\n\r\nThis operation could take 2-3 minutes where your application may seem unresponsive.\r\n\r\nIt is advised to backup ' +
 67                           'your File Storage locally before completing this request.\r\n\r\nDo NOT refresh the page while your provider is being modified. ' +
 68                           '\r\n\r\nAre you sure you wish to continue?');
 69        }
 70        function warnBackupTime() {
 71            return confirm('***CRITICAL WARNING***\r\n\r\nYou have selected to backup your file system.' +
 72                           ' This operation will archive all your current files and allow you to download the archive to your local machine.\r\n\r\n' +
 73                           'This operation (depending on the file storage size) could take 2-3 minutes.' +
 74                           ' During this time you MUST NOT refresh or reload your browser.\r\n\r\nAre you sure you wish to continue?');
 75        }
 76    </script>
 77     
 78	<div class="content-box-outer">
 79		<div class="content-box-right">
 80			<menu:TabMenu ID="TabMenu" runat="server" />
 81		</div>
 82		<div class="content-box-left">
 83
 84           <h1><%=Resources.labels.advancedSettings %></h1>
 85
 86                <ul class="fl leftaligned">
 87                    <li>
 88                        <label class="lbl" for=""><%=Resources.labels.enableTrackbacks %></label>
 89                            <asp:CheckBox runat="server" ID="cbEnableTrackBackSend" /><label><%=Resources.labels.send %></label>
 90                            &nbsp;&nbsp;
 91                            <asp:CheckBox runat="server" ID="cbEnableTrackBackReceive" /><label><%=Resources.labels.receive %></label>
 92                    </li>
 93                    <li>
 94                        <label for="" class="lbl"><%=Resources.labels.enablePingbacks %></label>
 95                            <asp:CheckBox runat="server" ID="cbEnablePingBackSend" /><label><%=Resources.labels.send %></label>
 96                            &nbsp;&nbsp;
 97                            <asp:CheckBox runat="server" ID="cbEnablePingBackReceive" /><label><%=Resources.labels.receive %></label>
 98                    </li>
 99                    <li>
100                        <label class="lbl" for="<%=rblWwwSubdomain.ClientID %>"><%=Resources.labels.handleWwwSubdomain %></label>
101                            <asp:RadioButtonList runat="server" CssClass="rblSubdomain" ID="rblWwwSubdomain" RepeatLayout="flow" RepeatDirection="horizontal">
102                                <asp:ListItem Text="<%$ Resources:labels, remove %>" Value="remove" />
103                                <asp:ListItem Text="<%$ Resources:labels, enforce %>" Value="add" />
104                                <asp:ListItem Text="<%$ Resources:labels, ignore %>" Value="" Selected="true" />
105                            </asp:RadioButtonList>
106                    </li>
107                    <li>
108                        <label class="lbl"><%=Resources.labels.otherSettings %></label>
109                        <asp:CheckBox runat="server" ID="cbEnableCompression" />
110                        <label for="<%=cbEnableCompression.ClientID %>"><%=Resources.labels.enableHttpCompression %></label>
111                        <span class="insetHelp">(<%=Resources.labels.enableHttpCompressionDescription %>)</span>
112                    </li>
113                    <li>
114                        <span class="filler"></span>
115                        <asp:CheckBox runat="server" ID="cbRemoveWhitespaceInStyleSheets" />
116                        <label for="<%=cbRemoveWhitespaceInStyleSheets.ClientID %>"><%=Resources.labels.trimStylesheet %></label>
117                        <span class="insetHelp">(<%=Resources.labels.trimStylesheetDescription %>)</span>
118                    </li>
119                    <li>
120                        <span class="filler"></span>
121                        <asp:CheckBox runat="server" ID="cbCompressWebResource" />
122                        <label for="<%=cbCompressWebResource.ClientID %>"><%=Resources.labels.compressWebResource %></label>
123                        <span class="insetHelp">(<%=Resources.labels.compressWebResourceDescription%>)</span>
124                    </li>
125                    <li>
126                        <span class="filler"></span>
127                        <asp:CheckBox runat="server" ID="cbEnableOpenSearch" />
128                        <label for="<%=cbEnableOpenSearch.ClientID %>"><%=Resources.labels.enableOpenSearch %></label>
129                        <span class="insetHelp">(<%=Resources.labels.enableOpenSearchDescription %>)</span>
130                    </li>
131                    <li>
132                        <span class="filler"></span>
133                        <asp:CheckBox runat="server" ID="cbRequireSslForMetaWeblogApi" />
134                        <label for="<%=cbRequireSslForMetaWeblogApi.ClientID %>"><%=Resources.labels.requireSslForMetaWeblogApi %></label>
135                        <span class="insetHelp">(<%=Resources.labels.requireSslForMetaWeblogApiDescription%>)</span>
136                    </li>
137                    <li>
138                        <span class="filler"></span>
139                        <asp:CheckBox runat="server" ID="cbEnableErrorLogging" />
140                        <label for="<%=cbEnableErrorLogging.ClientID %>"><%=Resources.labels.enableErrorLogging %></label>
141                        <span class="insetHelp">(<%=Resources.labels.enableErrorLoggingDescription%>)</span>
142                    </li>
143                    <li>
144                        <label class="lbl" for="<%=txtGalleryFeed.ClientID %>"><%=Resources.labels.galleryFeedUrl%></label>
145                        <asp:TextBox Width="300" runat="server" ID="txtGalleryFeed" />
146                        <span class="belowHelp"><label><%=Resources.labels.galleryFeedUrlDescription%></label></span>
147                    </li>
148                </ul>
149                <h2><%=Resources.labels.securitySettings %></h2>
150
151                <ul class="fl leftaligned">
152                    <li>
153                        <label class="lbl" for="<%=txtRemoteTimeout.ClientID %>"><%=Resources.labels.remoteTimeout %></label>
154                        <asp:TextBox runat="server" Width="80" ID="txtRemoteTimeout" />
155                        <span class="belowHelp"><label for="<%=txtRemoteTimeout.ClientID %>"><%=Resources.labels.remoteTimeoutDescription %></label></span>
156                    </li>
157                    <li>
158                        <label class="lbl" for="<%=txtRemoteMaxFileSize.ClientID %>"><%=Resources.labels.maximumRemoteFileSize%></label>
159                        <asp:TextBox runat="server" ID="txtRemoteMaxFileSize" />
160                        <span class="belowHelp"><label><%=Resources.labels.maximumRemoteFileSizeDescription%></label></span>
161                    </li>
162                    <li>
163                        <span class="filler"></span>
164                        <asp:CheckBox runat="server" ID="cbAllowRemoteFileDownloads" /><label for="<%=cbAllowRemoteFileDownloads.ClientID %>"><%=Resources.labels.allowRemoteFileDownloads %></label>
165                        <span class="insetHelp"><%=Resources.labels.allowRemoteFileDownloadsDescription%></span>
166                    </li>
167                </ul>
168                <h2><%=Resources.labels.filestorage %></h2>
169                <p>
170                    Modifying your File Storage settings may cause data loss. This operation will move all your files from one storage provider to another storage provider. It is recommended to backup your File storage into a recoverable archive.
171                </p>
172                <ul class="fl leftaligned">
173                    <li>
174                        <label class="lbl">Backup File Storage</label>
175                        <asp:Button runat="server" ID="btnDownloadArchive" OnClick="btnDownloadArchive_Click" Text="Start Backup" CssClass="btn rounded" OnClientClick="return warnBackupTime();" />
176                    </li>
177                    <li>
178                        <label class="lbl">Change File Storage Provider</label>
179                        <asp:DropDownList runat="server" ID="ddlProvider" ClientIDMode="Static" /><br />
180                        <asp:HiddenField runat="server" ID="hdnProvider" ClientIDMode="Static" />
181                        <label class="lbl"></label>
182                        <asp:Label runat="server" ID="providerError" ForeColor="Red" Visible="false" />
183                        <asp:Button runat="server" ID="btnChangeProvider" OnClick="btnChangeProvider_Click" Text="Change Provider" CssClass="btn rounded" OnClientClick="return warnProviderChange();" />
184                    </li>
185                </ul>
186            <div class="action_buttons">
187                <input type="submit" id="btnSave" class="btn primary rounded" value="<%=Resources.labels.saveSettings %>" />
188            </div>
189		</div>
190	</div>       
191</asp:Content>
192