Skip to content
This repository was archived by the owner on Aug 4, 2019. It is now read-only.

Commit 9deee8c

Browse files
committed
bumped to version 2.01.24
1 parent 8894d28 commit 9deee8c

26 files changed

+1166
-1340
lines changed

DNN 9/Browser/Browser.aspx.cs

Lines changed: 100 additions & 204 deletions
Large diffs are not rendered by default.

DNN 9/Browser/FileUploader.ashx.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,7 @@ private void UploadWholeFile(HttpContext context, List<FilesUploadStatus> status
192192
while (File.Exists(Path.Combine(this.StorageFolder.PhysicalPath, fileName)))
193193
{
194194
counter++;
195-
fileName = string.Format(
196-
"{0}_{1}{2}",
197-
fileNameNoExtenstion,
198-
counter,
199-
Path.GetExtension(file.FileName));
195+
fileName = $"{fileNameNoExtenstion}_{counter}{Path.GetExtension(file.FileName)}";
200196
}
201197
}
202198

DNN 9/Browser/ProcessImage.ashx.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,38 +81,38 @@ public void ProcessRequest(HttpContext context)
8181
var viewPortH = float.Parse(context.Request["viewPortH"]);
8282
var viewPortW = float.Parse(context.Request["viewPortW"]);
8383

84-
bool bSaveFile;
84+
bool saveFile;
8585

8686
try
8787
{
88-
bSaveFile = bool.Parse(context.Request["saveFile"]);
88+
saveFile = bool.Parse(context.Request["saveFile"]);
8989
}
9090
catch (Exception)
9191
{
92-
bSaveFile = false;
92+
saveFile = false;
9393
}
9494

95-
string sNewFileName = null;
95+
string newFileName = null;
9696

9797
if (!string.IsNullOrEmpty(context.Request["newFileName"]))
9898
{
99-
sNewFileName = context.Request["newFileName"];
99+
newFileName = context.Request["newFileName"];
100100
}
101101

102-
var pWidth = imageW;
103-
var pHeight = imageH;
102+
var width = imageW;
103+
var height = imageH;
104104

105105
var img = (Bitmap)Image.FromFile(context.Server.MapPath(imgSource));
106106

107107
// Resize
108-
var imageP = this.ResizeImage(img, Convert.ToInt32(pWidth), Convert.ToInt32(pHeight));
108+
var imageP = this.ResizeImage(img, Convert.ToInt32(width), Convert.ToInt32(height));
109109

110110
// Rotate if angle is not 0.00 or 360
111111
if (angle > 0.0F && angle < 360.00F)
112112
{
113113
imageP = (Bitmap)RotateImage(imageP, angle);
114-
pWidth = imageP.Width;
115-
pHeight = imageP.Height;
114+
width = imageP.Width;
115+
height = imageP.Height;
116116
}
117117

118118
// Calculate Coords of the Image into the ViewPort
@@ -121,26 +121,26 @@ public void ProcessRequest(HttpContext context)
121121
float srcY;
122122
float dstY;
123123

124-
if (pWidth > viewPortW)
124+
if (width > viewPortW)
125125
{
126-
srcX = Math.Abs(imageX - Math.Abs((imageW - pWidth) / 2));
126+
srcX = Math.Abs(imageX - Math.Abs((imageW - width) / 2));
127127
dstX = 0;
128128
}
129129
else
130130
{
131131
srcX = 0;
132-
dstX = imageX + ((imageW - pWidth) / 2);
132+
dstX = imageX + ((imageW - width) / 2);
133133
}
134134

135-
if (pHeight > viewPortH)
135+
if (height > viewPortH)
136136
{
137-
srcY = Math.Abs(imageY - Math.Abs((imageH - pHeight) / 2));
137+
srcY = Math.Abs(imageY - Math.Abs((imageH - height) / 2));
138138
dstY = 0;
139139
}
140140
else
141141
{
142142
srcY = 0;
143-
dstY = imageY + ((imageH - pHeight) / 2);
143+
dstY = imageY + ((imageH - height) / 2);
144144
}
145145

146146
// Get Image viewed into the ViewPort
@@ -149,20 +149,20 @@ public void ProcessRequest(HttpContext context)
149149
// Get Selector Portion
150150
imageP = ImageCopy(imageP, 0, 0, selectorX, selectorY, selectorW, selectorH);
151151

152-
if (bSaveFile)
152+
if (saveFile)
153153
{
154154
context.Response.ContentType = "text/plain";
155155

156156
var sourceFilePath = context.Server.MapPath(imgSource);
157-
var sourceFolder = sourceFilePath.Remove(sourceFilePath.LastIndexOf("\\"));
157+
var sourceFolder = sourceFilePath.Remove(sourceFilePath.LastIndexOf("\\", StringComparison.Ordinal));
158158

159159
if (PortalSettings.Current != null && !this.HasWritePermission(
160160
PathUtils.Instance.GetRelativePath(PortalSettings.Current.PortalId, sourceFolder)))
161161
{
162162
throw new SecurityException("You don't have write permission to save files under this folder.");
163163
}
164164

165-
imageP.Save(GenerateName(sNewFileName, context.Server.MapPath(imgSource)));
165+
imageP.Save(GenerateName(newFileName, context.Server.MapPath(imgSource)));
166166
}
167167
else
168168
{
@@ -214,9 +214,8 @@ private static string GenerateName(string sNewFileName, string sSourceFullPath)
214214
var sNewFilePath = !string.IsNullOrEmpty(sNewFileName)
215215
? Path.Combine(sSourcePath, sNewFileName + sExtension)
216216
: Path.Combine(
217-
sSourcePath,
218-
string.Format(
219-
"{0}_crop{1}", Path.GetFileNameWithoutExtension(sSourceFullPath), sExtension));
217+
sSourcePath,
218+
$"{Path.GetFileNameWithoutExtension(sSourceFullPath)}_crop{sExtension}");
220219

221220
var iCounter = 0;
222221

@@ -227,7 +226,8 @@ private static string GenerateName(string sNewFileName, string sSourceFullPath)
227226
var sFileNameNoExt = Path.GetFileNameWithoutExtension(sNewFilePath);
228227

229228
sNewFilePath = Path.Combine(
230-
sSourcePath, string.Format("{0}_{1}{2}", sFileNameNoExt, iCounter, sExtension));
229+
sSourcePath,
230+
$"{sFileNameNoExt}_{iCounter}{sExtension}");
231231
}
232232

233233
return sNewFilePath;

DNN 9/CKEditorOptions.ascx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
</HeaderTemplate>
344344
<ItemTemplate>
345345
<li class='ui-state-default ui-corner-all<%# DataBinder.Eval(Container.DataItem, "Button").ToString().Equals("-") ? " separator" : string.Empty%>'>
346-
<img alt='<%# DataBinder.Eval(Container.DataItem, "Button").ToString()%>' class="itemIcon" src='<%# this.ResolveUrl(string.Format("~/Providers/HtmlEditorProviders/CKEditor/icons/{0}", DataBinder.Eval(Container.DataItem, "Icon")))%>'/>&nbsp;
346+
<img alt='<%# DataBinder.Eval(Container.DataItem, "Button").ToString()%>' class="itemIcon" src='<%# this.ResolveUrl($"~/Providers/HtmlEditorProviders/CKEditor/icons/{DataBinder.Eval(Container.DataItem, "Icon")}")%>'/>&nbsp;
347347
<span class="item"><%# DataBinder.Eval(Container.DataItem, "Button").ToString()%></span>
348348
</li>
349349
</ItemTemplate>
@@ -374,7 +374,7 @@
374374
<ItemTemplate>
375375
<li class='groupButton ui-state-default ui-corner-all<%# DataBinder.Eval(Container.DataItem, "Button").ToString().Equals("-") ? " separator" : string.Empty%><%# DataBinder.Eval(Container.DataItem, "Button").ToString().Equals("/") ? " rowBreak" : string.Empty%>'>
376376
<span class="ui-icon ui-icon-cancel" title='<%= DotNetNuke.Services.Localization.Localization.GetString("DeleteToolbarButton.Text", this.ResXFile, this.LangCode) %>'></span>
377-
<img alt='<%# DataBinder.Eval(Container.DataItem, "Button").ToString()%>' class="itemIcon" src='<%# this.ResolveUrl(string.Format("~/Providers/HtmlEditorProviders/CKEditor/icons/{0}", DataBinder.Eval(Container.DataItem, "Button").ToString().Equals("/") ? "PageBreak.png" : DataBinder.Eval(Container.DataItem, "Icon"))) %>'/>&nbsp;
377+
<img alt='<%# DataBinder.Eval(Container.DataItem, "Button").ToString()%>' class="itemIcon" src='<%# this.ResolveUrl($"~/Providers/HtmlEditorProviders/CKEditor/icons/{(DataBinder.Eval(Container.DataItem, "Button").ToString().Equals("/") ? "PageBreak.png" : DataBinder.Eval(Container.DataItem, "Icon"))}") %>'/>&nbsp;
378378
<span class="item"><%# DataBinder.Eval(Container.DataItem, "Button").ToString()%></span>
379379
</li>
380380
</ItemTemplate>

0 commit comments

Comments
 (0)