Skip to content

Commit

Permalink
Merge branch 'persian/v9.13.3-persian' into persian/v9.13.4-persian
Browse files Browse the repository at this point in the history
  • Loading branch information
mnouraei committed Oct 5, 2024
2 parents 5def7cc + 35fb3ba commit ad88d16
Show file tree
Hide file tree
Showing 154 changed files with 27,339 additions and 298 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<Content Include="08.00.00.txt" />
<Content Include="App_LocalResources\ViewConsole.ascx.resx" />
<Content Include="console.png" />
<Content Include="module.rtl.css" />
<Content Include="Scripts\jquery.console.js" />
<Content Include="releaseNotes.txt" />
</ItemGroup>
Expand Down
82 changes: 82 additions & 0 deletions DNN Platform/Admin Modules/Dnn.Modules.Console/module.rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* Persian-DnnSoftware */
.console { width:95%; height:95%; }
.console select { margin-right:0px;margin-bottom:4px; }

.console-none div { height:30px; margin:2px; width:180px; padding:5px; cursor:pointer; text-align:right; float:right; }
.console-none h3 { margin: 0px 28px 2px 2px; padding-top:5px; font-size:1em; line-height: 1.4em; font-weight: normal }
.console-none div div { display:none; }

.console-none-detail div { padding:10px; clear:both; cursor:pointer; }
.console-none-detail h3 { margin: 2px 28px 2px 2px; padding-top:5px; font-size:1em; }
.console-none-detail div div { margin: 2px 28px 2px 2px; padding:0px; clear:none; }

.console-small div { height:30px; margin:2px; width:180px; padding:5px; cursor:pointer; text-align:right; float:right; }
.console-small img { padding:4px; float:right; }
.console-small h3 { margin: 0px 28px 2px 2px; padding-top:5px; font-size:1em; line-height: 1.4em; font-weight: normal }
.console-small div div { display:none; }

.console-small-detail div { padding:10px; clear:both; cursor:pointer; }
.console-small-detail img { padding:4px; float:right; }
.console-small-detail h3 { margin: 2px 28px 2px 2px; padding:0px; font-size:1em; }
.console-small-detail div div { margin: 2px 28px 2px 2px; padding:0px; clear:none; }

.console-large div { margin:10px; width:130px; height:90px !important; padding:0px; cursor:pointer; text-align:center; float:right; }
.console-large img { float:none; padding: 10px 0px 0px 0px; }
.console-large h3 { margin:2px; width:130px; text-align:center; overflow:hidden; font-size:1em; line-height: 1.4em; padding-top:5px; font-weight: normal }
.console-large div div { display:none; }

.console-large-detail div { margin:0px; padding:15px; clear:both; cursor:pointer; }
.console-large-detail img { padding:0px; float:right; }
.console-large-detail h3 { margin: 2px 44px 2px 2px; padding: 0px; font-size:1em; }
.console-large-detail div div { margin: 2px 44px 2px 2px; padding:0px; clear:none; }

.console-mouseon { background-color:#ebedf0; } /*#f1f6f9*/

/*------------------------------------------------*/
/* DEFAULT PROFILE STYLE */
/*------------------------------------------------*/

.UserProfileControls ul li {
list-style-type: none;
}

/*------------------------------------------------*/
/* PROFILE STYLE */
/*------------------------------------------------*/
.console.profile {
/*width: 250px;*/
width:100% !important; /* updated for responsive*/
height: auto;
background-color: #484848; /* Menu Background Color */
}

.console.profile .console-none div {
cursor: pointer;
cursor: pointer;
float: right;
height: auto;
/*width: 250px;*/
width:100% !important; /* updated for responsive*/
padding: 0px;
margin: 0px;
text-align: right;
}

.console.profile .console-none h3 {
padding: 10px 40px 10px 8px;
margin: 0;
border-bottom: solid 1px #fff;
background: url('../../images/arrow-right-white.png') 18px center no-repeat;
color: #eee;
font-size: 13px;
line-height: 1;
font-weight: bold;
}

.console.profile .console-none div div {
display: none;
}

.console.profile .console-mouseon {
background-color: #70b1c7; /* Menu Hover Background Color */
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<Content Include="connector.htm" />
<Content Include="Images\GoogleTagManager_32X32_Standard.png" />
<Content Include="License.txt" />
<Content Include="Module.rtl.css" />
<Content Include="ReleaseNotes.txt" />
<Content Include="Scripts\connector.js" />
</ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions DNN Platform/Connectors/GoogleTagManager/Module.rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* Persian-DnnSoftware */
body {
}
.snippetTree {
float: right;
min-width: 17%;
}
.dnnDisabled {

}
13 changes: 13 additions & 0 deletions DNN Platform/DotNetNuke.Web.Client/ClientResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,19 @@ public static void RegisterStyleSheet(Page page, string filePath, int priority,
return;
}

/* START Persian-DnnSoftware */
/* if ((System.Globalization.CultureInfo.CurrentCulture.TextInfo.IsRightToLeft && filePath.Contains(".css")) && !filePath.Contains("http")) //Comment for 404 Page Bug Fix, CurrentCulture => CurrentUICulture */
if ((System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft && filePath.Contains(".css")) && !filePath.Contains("http"))
{
string locfile = filePath.Replace(".css", ".rtl.css");
if (FileExists(page, locfile))
{
filePath = locfile;
}
}

/* END Persian-DnnSoftware */

var include = new DnnCssInclude { ForceProvider = provider, Priority = priority, FilePath = filePath, Name = name, Version = version };
if (htmlAttributes != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,35 @@ public DateTime? SelectedDate
/// <inheritdoc/>
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);

JavaScript.RequestRegistration(CommonJs.jQuery);

ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/moment.min.js");
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.js");
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.jquery.js");

ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.css");

base.OnPreRender(e);

JavaScript.RequestRegistration(CommonJs.jQuery);

ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/moment.min.js");
/* START Persian-DnnSoftware */
if (CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft)
{
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/persian.datepicker.js");
}
else
{
ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.js");
}

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

/* END Persian-DnnSoftware */

this.RegisterClientResources();
}

Expand Down
26 changes: 24 additions & 2 deletions DNN Platform/Library/Common/Utilities/Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,36 @@ public static string InvokePopupCal(TextBox field)

// Get the short date pattern for the culture
string formatString = DateTimeFormatInfo.CurrentInfo.ShortDatePattern;
if (!field.Page.ClientScript.IsClientScriptIncludeRegistered("PopupCalendar.js"))
/* START Persian-DnnSoftware */
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
ScriptManager.RegisterClientScriptInclude(field.Page, field.Page.GetType(), "PopupCalendar.js", ClientAPI.ScriptPath + "PopupCalendar.js");
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");
}
}

/* 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 Persian-DnnSoftware */
if (System.Globalization.CultureInfo.CurrentCulture.ToString() == "fa-IR")
{
return "javascript:displayDatePicker('" + field.ClientID + "');";
}

/* END Persian-DnnSoftware */
return
$"javascript:popupCal('Cal','{field.ClientID}','{formatString}','{monthNameString}','{dayNameString}','{strToday}','{strClose}','{strCalendar}',{(int)DateTimeFormatInfo.CurrentInfo.FirstDayOfWeek});";
}
Expand Down
16 changes: 14 additions & 2 deletions DNN Platform/Library/Common/Utilities/DateUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,20 @@ public static DateTime GetDatabaseLocalTime()
/// <param name="date">DateTime in UTC.</param>
/// <returns>String representing the required date for display.</returns>
public static string CalculateDateForDisplay(DateTime date)
{
var utcTimeDifference = GetDatabaseUtcTime() - date;
{
/* START Persian-DnnSoftware */
string tempdate = date.ToString("yyyy/MM/dd HH:mm:ss");
DateTime date1 = GetDatabaseUtcTime();
TimeSpan utcTimeDifference;

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

utcTimeDifference = date1 - date;
/* END Persian-DnnSoftware */
/* var utcTimeDifference = GetDatabaseUtcTime() - date; */

if (utcTimeDifference.TotalSeconds < 60)
{
Expand Down
69 changes: 55 additions & 14 deletions DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,16 @@ private static void Handle404OrException(FriendlyUrlSettings settings, HttpConte

if (context != null)
{
/* START Persian-DnnSoftware */
/* 404 Page RLT Bug Fix */
var portalInfo = PortalController.Instance.GetPortal(Host.HostPortalID);
if (portalInfo.CultureCode == "fa-IR")
{
var newCulture = Services.Localization.Persian.PersianController.NewCultureInfo(portalInfo.CultureCode);
System.Threading.Thread.CurrentThread.CurrentUICulture = newCulture;
}

/* END Persian-DnnSoftware */
HttpRequest request = context.Request;
HttpResponse response = context.Response;
HttpServerUtility server = context.Server;
Expand Down Expand Up @@ -762,7 +772,16 @@ private static void Handle404OrException(FriendlyUrlSettings settings, HttpConte

// 881 : spoof the basePage object so that the client dependency framework
// is satisfied it's working with a page-based handler
IHttpHandler spoofPage = new CDefault();
/* START Persian-DnnSoftware */
/* 404 Page RLT Bug Fix */
/* IHttpHandler spoofPage = new CDefault(); */
var spoofPage = new CDefault();
if (portalInfo.CultureCode == "fa-IR")
{
spoofPage.Culture = "fa-IR";
}

/* END Persian-DnnSoftware */
context.Handler = spoofPage;
server.Transfer("~/" + errUrl, true);
}
Expand Down Expand Up @@ -1393,28 +1412,39 @@ private static string MakeUrlWithAlias(Uri requestUri, PortalAliasInfo alias)
/// </remarks>
private static bool IgnoreRequestForInstall(string physicalPath, string refererPath, string requestedDomain, string refererDomain)
{
if (physicalPath.EndsWith("install.aspx", true, CultureInfo.InvariantCulture)
/* START Persian-DnnSoftware */
try
{
/* END Persian-DnnSoftware */
if (physicalPath.EndsWith("install.aspx", true, CultureInfo.InvariantCulture)
|| physicalPath.EndsWith("installwizard.aspx", true, CultureInfo.InvariantCulture)
|| physicalPath.EndsWith("upgradewizard.aspx", true, CultureInfo.InvariantCulture)
|| Globals.Status == Globals.UpgradeStatus.Install
|| Globals.Status == Globals.UpgradeStatus.Upgrade)
{
return true;
}
{
return true;
}

// 954 : DNN 7.0 compatibility
// check for /default.aspx which is default Url launched from the Upgrade/Install wizard page
// 961 : check domain as well as path for the referer
if (physicalPath.EndsWith(Globals.glbDefaultPage, true, CultureInfo.InvariantCulture) == false
// 954 : DNN 7.0 compatibility
// check for /default.aspx which is default Url launched from the Upgrade/Install wizard page
// 961 : check domain as well as path for the referer
if (physicalPath.EndsWith(Globals.glbDefaultPage, true, CultureInfo.InvariantCulture) == false
&& refererPath != null
&& string.Compare(requestedDomain, refererDomain, StringComparison.OrdinalIgnoreCase) == 0
&& (refererPath.EndsWith("install.aspx", true, CultureInfo.InvariantCulture)
|| refererPath.EndsWith("installwizard.aspx", true, CultureInfo.InvariantCulture)
|| refererPath.EndsWith("upgradewizard.aspx", true, CultureInfo.InvariantCulture)))
{
return true;
}

/* START Persian-DnnSoftware */
}
catch (Exception)
{
return true;
}

/* END Persian-DnnSoftware */
return false;
}

Expand Down Expand Up @@ -3115,12 +3145,23 @@ private void SecurityCheck(HttpApplication app)
// URL validation
// 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
var strURL = request.Url.AbsolutePath;
var strDoubleDecodeURL = server.UrlDecode(server.UrlDecode(request.Url.AbsolutePath)) ?? string.Empty;
if (UrlSlashesRegex.Match(strURL).Success || UrlSlashesRegex.Match(strDoubleDecodeURL).Success)
/* START Persian-DnnSoftware */
var regx = new Regex("[\\\\/]\\.\\.[\\\\/]", RegexOptions.Compiled);
string url = server.UrlDecode(server.UrlDecode(request.Url.AbsolutePath)) ?? string.Empty;
if (!regx.Match(request.Url.AbsolutePath).Success && !regx.Match(url).Success)
{
throw new HttpException(404, "Not Found");
return;
}

app.Context.Response.Redirect(app.Context.Request.Url.Host.ToString(), true);

// var strURL = request.Url.AbsolutePath;
// var strDoubleDecodeURL = server.UrlDecode(server.UrlDecode(request.Url.AbsolutePath)) ?? string.Empty;
// if (UrlSlashesRegex.Match(strURL).Success || UrlSlashesRegex.Match(strDoubleDecodeURL).Success)
// {
// throw new HttpException(404, "Not Found");
// }
/* END Persian-DnnSoftware */
}
}
}
4 changes: 2 additions & 2 deletions DNN Platform/Library/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// associated with an assembly.

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

[assembly: AssemblyStatus(ReleaseMode.Alpha)]
[assembly: AssemblyStatus(ReleaseMode.Stable)]/* Persian-DnnSoftware */

// Allow internal variables to be visible to testing projects
[assembly: InternalsVisibleTo("DotNetNuke.Tests.Core")]
Expand Down
5 changes: 4 additions & 1 deletion DNN Platform/Library/Security/Roles/RoleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,10 @@ private static void SendNotification(UserInfo objUser, RoleInfo objRole, PortalS
preferredLocale = portalSettings.DefaultLanguage;
}

var ci = new CultureInfo(preferredLocale);
/* 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
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public void ProcessRequest(HttpContext context)

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

Expand Down
Loading

0 comments on commit ad88d16

Please sign in to comment.