Skip to content

Commit

Permalink
fix file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud Nouraei committed Aug 31, 2020
1 parent 722af06 commit c54168f
Show file tree
Hide file tree
Showing 53 changed files with 2,269 additions and 1,452 deletions.
4 changes: 2 additions & 2 deletions DNN Platform/DotNetNuke.Web.Client/ClientResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,14 @@ public static void RegisterStyleSheet(Page page, string filePath, int priority,

if (fileExists || FileExists(page, filePath))
{
//START dnnsoftware.ir
//START Persian-DnnSoftware
if ((System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft && filePath.Contains(".css")) && !filePath.Contains("http"))
{
string locfile = filePath.Replace(".css", ".rtl.css");
if (FileExists(page, locfile))
filePath = locfile;
}
//END dnnsoftware.ir
//END Persian-DnnSoftware

var include = new DnnCssInclude { ForceProvider = provider, Priority = priority, FilePath = filePath, Name = name, Version = version };
var loader = page.FindControl("ClientResourceIncludes");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Web.UI.WebControls.Internal
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;


using DotNetNuke.Common.Utilities;
using DotNetNuke.Framework.JavaScriptLibraries;
using DotNetNuke.Web.Client.ClientResourceManagement;

using DotNetNuke.Web.Client.ClientResourceManagement;

/// <remarks>
/// This control is only for internal use, please don't reference it in any other place as it may be removed in future.
/// </remarks>
Expand Down Expand Up @@ -51,20 +51,20 @@ protected override void OnPreRender(EventArgs e)

JavaScript.RequestRegistration(CommonJs.jQuery);

ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/moment.min.js");
//START dnnsoftware.ir
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/DatePicker/persian.datepicker.js");
else
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/moment.min.js");
//START Persian-DnnSoftware
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/DatePicker/persian.datepicker.js");
else
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.js");
//END dnnsoftware.ir
//END Persian-DnnSoftware
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.jquery.js");
//START dnnsoftware.ir
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/components/DatePicker/persian.datepicker.css");
else
//START Persian-DnnSoftware
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/components/DatePicker/persian.datepicker.css");
else
ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.css");
//END dnnsoftware.ir
//END Persian-DnnSoftware

this.RegisterClientResources();
}
Expand Down
52 changes: 26 additions & 26 deletions DNN Platform/Library/Common/Utilities/Calendar.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Common.Utilities
{
using System.Globalization;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;


using DotNetNuke.Services.Localization;
using DotNetNuke.UI.Utilities;

using DotNetNuke.UI.Utilities;

public class Calendar
{
/// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -49,34 +49,34 @@ public static string InvokePopupCal(TextBox Field)

// Get the short date pattern for the culture
string FormatString = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;
//START dnnsoftware.ir
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
if (!Field.Page.ClientScript.IsClientScriptIncludeRegistered("PersianCalendar.js"))
{
ClientAPI.RegisterClientScriptBlock(Field.Page, "PersianCalendar.js", ("<script src=\"" + ClientAPI.ScriptPath + "PersianCalendar.js\"></script>"));
ClientAPI.RegisterClientScriptBlock(Field.Page, "PersianCalendar.css", ("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + ClientAPI.ScriptPath + "PersianCalendar.css\" />"));
}
//START Persian-DnnSoftware
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
if (!Field.Page.ClientScript.IsClientScriptIncludeRegistered("PersianCalendar.js"))
{
ClientAPI.RegisterClientScriptBlock(Field.Page, "PersianCalendar.js", ("<script src=\"" + ClientAPI.ScriptPath + "PersianCalendar.js\"></script>"));
ClientAPI.RegisterClientScriptBlock(Field.Page, "PersianCalendar.css", ("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + ClientAPI.ScriptPath + "PersianCalendar.css\" />"));
}
}
else
{
if (!Field.Page.ClientScript.IsClientScriptIncludeRegistered("PopupCalendar.js"))
{
ScriptManager.RegisterClientScriptInclude(Field.Page, Field.Page.GetType(), "PopupCalendar.js", ClientAPI.ScriptPath + "PopupCalendar.js");
else
{
if (!Field.Page.ClientScript.IsClientScriptIncludeRegistered("PopupCalendar.js"))
{
ScriptManager.RegisterClientScriptInclude(Field.Page, Field.Page.GetType(), "PopupCalendar.js", ClientAPI.ScriptPath + "PopupCalendar.js");
}
}
//END dnnsoftware.ir
//END Persian-DnnSoftware

string strToday = ClientAPI.GetSafeJSString(Localization.GetString("Today"));
string strClose = ClientAPI.GetSafeJSString(Localization.GetString("Close"));
string strCalendar = ClientAPI.GetSafeJSString(Localization.GetString("Calendar"));

//START dnnsoftware.ir
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
return "javascript:displayDatePicker('" + Field.ClientID + "');";
}
//END dnnsoftware.ir
//START Persian-DnnSoftware
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
return "javascript:displayDatePicker('" + Field.ClientID + "');";
}
//END Persian-DnnSoftware

return string.Concat("javascript:popupCal('Cal','", Field.ClientID, "','", FormatString, "','",
MonthNameString, "','", DayNameString, "','", strToday, "','", strClose, "','", strCalendar, "',",
Expand Down
32 changes: 16 additions & 16 deletions DNN Platform/Library/Common/Utilities/DateUtils.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Common.Utilities
{
using System;


using DotNetNuke.Data;
using DotNetNuke.Services.Localization;

using DotNetNuke.Services.Localization;

/// <summary>
/// Provides utility methods to work with Dates.
/// </summary>
Expand Down Expand Up @@ -97,16 +97,16 @@ public static DateTime GetDatabaseLocalTime()
/// <returns>String representing the required date for display.</returns>
public static string CalculateDateForDisplay(DateTime date)
{
//START dnnsoftware.ir
string tempdate = date.ToString("yyyy/MM/dd HH:mm:ss");
DateTime _date = GetDatabaseUtcTime();
TimeSpan utcTimeDifference;

if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
date = DateTime.Parse(tempdate);

utcTimeDifference = _date - date;
//END dnnsoftware.ir
//START Persian-DnnSoftware
string tempdate = date.ToString("yyyy/MM/dd HH:mm:ss");
DateTime _date = GetDatabaseUtcTime();
TimeSpan utcTimeDifference;

if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
date = DateTime.Parse(tempdate);

utcTimeDifference = _date - date;
//END Persian-DnnSoftware

//var utcTimeDifference = GetDatabaseUtcTime() - date;

Expand Down
4 changes: 2 additions & 2 deletions DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3101,7 +3101,7 @@ private void SecurityCheck(HttpApplication app)
// check for ".." escape characters commonly used by hackers to traverse the folder tree on the server
// the application should always use the exact relative location of the resource it is requesting

//START dnnsoftware.ir
//START Persian-DnnSoftware
var regx = new Regex("[\\\\/]\\.\\.[\\\\/]", RegexOptions.Compiled);
string url = server.UrlDecode(server.UrlDecode(request.Url.AbsolutePath)) ?? "";
if (!regx.Match(request.Url.AbsolutePath).Success && !regx.Match(url).Success)
Expand All @@ -3114,7 +3114,7 @@ private void SecurityCheck(HttpApplication app)
//{
// throw new HttpException(404, "Not Found");
//}
//END dnnsoftware.ir
//END Persian-DnnSoftware
}
}
}
24 changes: 12 additions & 12 deletions DNN Platform/Library/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
using System;
using System.Reflection;
using System.Runtime.CompilerServices;

using DotNetNuke.Application;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

// Review the values of the assembly attributes
[assembly: AssemblyTitle("DotNetNuke - dnnsoftware.ir")]
using DotNetNuke.Application;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

// Review the values of the assembly attributes
[assembly: AssemblyTitle("DotNetNuke - Persian-DnnSoftware")]
[assembly: AssemblyDescription("Open Source Web Application Framework")]
[assembly: CLSCompliant(true)]

[assembly: AssemblyStatus(ReleaseMode.Stable)]//dnnsoftware.ir
[assembly: AssemblyStatus(ReleaseMode.Stable)]//Persian-DnnSoftware

// Allow internal variables to be visible to testing projects
[assembly: InternalsVisibleTo("DotNetNuke.Tests.Core")]
Expand Down
20 changes: 10 additions & 10 deletions DNN Platform/Library/Security/Roles/RoleController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace DotNetNuke.Security.Roles
{
using System;
Expand All @@ -10,7 +10,7 @@ namespace DotNetNuke.Security.Roles
using System.Globalization;
using System.Linq;
using System.Xml;


using DotNetNuke.Common;
using DotNetNuke.Common.Internal;
using DotNetNuke.Common.Utilities;
Expand All @@ -27,7 +27,7 @@ namespace DotNetNuke.Security.Roles
using DotNetNuke.Services.Mail;
using DotNetNuke.Services.Messaging.Data;
using DotNetNuke.Services.Search.Entities;


/// <summary>
/// The RoleController class provides Business Layer methods for Roles.
/// </summary>
Expand Down Expand Up @@ -655,10 +655,10 @@ private static void SendNotification(UserInfo objUser, RoleInfo objRole, PortalS
preferredLocale = PortalSettings.DefaultLanguage;
}

//START dnnsoftware.ir
//var ci = new CultureInfo(preferredLocale);
var ci = DotNetNuke.Services.Localization.Persian.PersianController.NewCultureInfo(preferredLocale);
//END dnnsoftware.ir
//START Persian-DnnSoftware
//var ci = new CultureInfo(preferredLocale);
var ci = DotNetNuke.Services.Localization.Persian.PersianController.NewCultureInfo(preferredLocale);
//END Persian-DnnSoftware
UserRoleInfo objUserRole = RoleController.Instance.GetUserRole(PortalSettings.PortalId, objUser.UserID, objRole.RoleID);
Custom.Add(Null.IsNull(objUserRole.EffectiveDate)
? DateTime.Today.ToString("g", ci)
Expand Down
18 changes: 9 additions & 9 deletions DNN Platform/Library/Services/FileSystem/FileServerHandler.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.FileSystem
{
using System;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Web;


using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities;
Expand All @@ -17,8 +17,8 @@ namespace DotNetNuke.Services.FileSystem
using DotNetNuke.Entities.Users;
using DotNetNuke.Instrumentation;
using DotNetNuke.Services.FileSystem.EventArgs;
using DotNetNuke.Services.Localization;

using DotNetNuke.Services.Localization;

public class FileServerHandler : IHttpHandler
{
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(FileServerHandler));
Expand Down Expand Up @@ -75,10 +75,10 @@ public void ProcessRequest(HttpContext context)

if (LocaleController.Instance.IsEnabled(ref Language, _portalSettings.PortalId))
{
//START dnnsoftware.ir
//START Persian-DnnSoftware
//Localization.SetThreadCultures(new CultureInfo(Language), _portalSettings);
Localization.SetThreadCultures(DotNetNuke.Services.Localization.Persian.PersianController.NewCultureInfo(Language), _portalSettings);
//END dnnsoftware.ir
Localization.SetThreadCultures(DotNetNuke.Services.Localization.Persian.PersianController.NewCultureInfo(Language), _portalSettings);
//END Persian-DnnSoftware
Localization.SetLanguage(Language);
}

Expand Down
18 changes: 9 additions & 9 deletions DNN Platform/Library/Services/Localization/LocaleController.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.Localization
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;


using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.ComponentModel;
using DotNetNuke.Data;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Entities.Users;
using DotNetNuke.Services.Installer.Packages;

using DotNetNuke.Services.Installer.Packages;

/// <summary>
/// LocaleContrller provides method to manage all pages with localization content.
/// </summary>
Expand Down Expand Up @@ -59,10 +59,10 @@ public bool CanDeleteLanguage(int languageId)
/// <returns>culture list.</returns>
public List<CultureInfo> GetCultures(Dictionary<string, Locale> locales)
{
//START dnnsoftware.ir
//START Persian-DnnSoftware
//return locales.Values.Select(locale => new CultureInfo(locale.Code)).ToList();
return locales.Values.Select(locale => Persian.PersianController.NewCultureInfo(locale.Code)).ToList();
//END dnnsoftware.ir
return locales.Values.Select(locale => Persian.PersianController.NewCultureInfo(locale.Code)).ToList();
//END Persian-DnnSoftware
}

/// <summary>
Expand Down
Loading

0 comments on commit c54168f

Please sign in to comment.