Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenguyen committed Sep 11, 2013
2 parents 9ac303f + 66ab614 commit 307208e
Show file tree
Hide file tree
Showing 569 changed files with 1,948 additions and 2,213 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.suo
*.user
*.sln.docstates
*.local.sln

# Build results
[Rr]elease
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,22 @@ private static ArrayList GetModulesByDefinition(int portalID, string friendlyNam
private ModuleInfo GetSearchModule()
{
var arrModules = GetModulesByDefinition(PortalSettings.PortalId, "Search Results");
ModuleInfo findModule = null;
if (arrModules.Count > 1)
{
return arrModules.Cast<ModuleInfo>().FirstOrDefault(searchModule => searchModule.CultureCode == PortalSettings.CultureCode);
findModule = arrModules.Cast<ModuleInfo>().FirstOrDefault(searchModule => searchModule.CultureCode == PortalSettings.CultureCode);
}

if (arrModules.Count == 1)
{
return ((ModuleInfo)arrModules[0]);
}

return null;
return findModule ?? (ModuleInfo) arrModules[0];
}

private Hashtable GetSearchModuleSettings()
{
if (ActiveModule != null && ActiveModule.ModuleDefinition.FriendlyName == "Search Results")
{
return ActiveModule.ModuleSettings;
}

var searchModule = GetSearchModule();
return searchModule != null ? searchModule.ModuleSettings : null;
}
Expand Down Expand Up @@ -554,6 +555,7 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex,
SearchTypeIds = searchTypeIds,
ModuleDefIds = moduleDefids,
BeginModifiedTimeUtc = beginModifiedTimeUtc,
EndModifiedTimeUtc = beginModifiedTimeUtc > DateTime.MinValue ? DateTime.MaxValue : DateTime.MinValue,
PageIndex = pageIndex,
PageSize = pageSize,
SortField = (SortFields) sortOption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,24 @@ protected override void OnPreRender(EventArgs e)
if (InternalPortalId.HasValue)
{
Services.Parameters.Add("PortalId", InternalPortalId.Value.ToString(CultureInfo.InvariantCulture));
}
}

Services.Parameters.Add("includeDisabled", IncludeDisabledTabs.ToString().ToLowerInvariant());
Services.Parameters.Add("includeAllTypes", IncludeAllTabTypes.ToString().ToLowerInvariant());

base.OnPreRender(e);
}

/// <summary>
/// Whether include pages which are disabled.
/// </summary>
public bool IncludeDisabledTabs { get; set; }

/// <summary>
/// Whether include pages which tab type is not normal.
/// </summary>
public bool IncludeAllTabTypes { get; set; }

public int PortalId
{
get
Expand Down
26 changes: 7 additions & 19 deletions DNN Platform/Library/Common/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2769,31 +2769,19 @@ public static TabType GetURLType(string URL)
{
return TabType.Normal;
}
else
if (URL.ToLower().StartsWith("mailto:") == false && URL.IndexOf("://") == -1 && URL.StartsWith("~") == false && URL.StartsWith("\\\\") == false && URL.StartsWith("/") == false)
{
if (URL.ToLower().StartsWith("mailto:") == false && URL.IndexOf("://") == -1 && URL.StartsWith("~") == false && URL.StartsWith("\\\\") == false && URL.StartsWith("/") == false)
if (Regex.IsMatch(URL, @"^\d+$"))
{
if (Regex.IsMatch(URL, @"^\d+$"))
{
return TabType.Tab;
}
else
{
if (URL.ToLower().StartsWith("userid="))
{
return TabType.Member;
}
else
{
return TabType.File;
}
}
return TabType.Tab;
}
else
if (URL.ToLower().StartsWith("userid="))
{
return TabType.Url;
return TabType.Member;
}
return TabType.File;
}
return TabType.Url;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Library/Common/Utilities/HtmlUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public static string AbsoluteToRelativeUrls(string html, IEnumerable<string> ali
searchAlias = string.Format("{0}/", portalAlias);
}
string protocol = PortalSettings.Current.SSLEnabled ? "https://" : "http://";
Regex exp = new Regex(string.Format("(href=&quot;){0}{1}(.*?&quot;)", protocol, searchAlias));
Regex exp = new Regex(string.Format("(href=&quot;){0}{1}(.*?&quot;)", protocol, searchAlias), RegexOptions.IgnoreCase);

if(portalAlias.Contains("/"))
{
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Library/Common/Utilities/UrlController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void UpdateUrl(int PortalID, string Url, string UrlType, int Clicks, Date
{
if (GetUrl(PortalID, Url) == null)
{
DataProvider.Instance().AddUrl(PortalID, Url);
DataProvider.Instance().AddUrl(PortalID, Url.Replace(@"\", @"/"));
}
}
UrlTrackingInfo objURLTracking = GetUrlTracking(PortalID, Url, ModuleID);
Expand Down
4 changes: 2 additions & 2 deletions DNN Platform/Library/Entities/Portals/PortalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ public string DefaultPortalAlias
foreach (var alias in TestablePortalAliasController.Instance.GetPortalAliasesByPortalId(PortalId).Where(alias => alias.IsPrimary))
{
return alias.HTTPAlias;
}
}
return String.Empty;
}
}
}

public string DefaultPortalContainer
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Library/Entities/Tabs/TabController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private void CreateTabRedirect(TabInfo tab)
var settings = PortalController.GetCurrentPortalSettings();


if (settings != null && tab.TabUrls.Count(u => u.HttpStatus == "200") == 0)
if (settings != null && tab.TabID != settings.HomeTabId && tab.TabUrls.Count(u => u.HttpStatus == "200") == 0)
{
var domainRoot = Globals.AddHTTP(settings.PortalAlias.HTTPAlias);

Expand Down
6 changes: 6 additions & 0 deletions DNN Platform/Library/Entities/Urls/FriendlyUrlController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,12 @@ public static string CleanNameForUrl(string urlName, FriendlyUrlOptions options,
replacedUnwantedChars = true;
}
ch = replaceWith; //in list of replacment chars

//If we still have a space ensure its encoded
if (ch == " ")
{
ch = options.SpaceEncoding;
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions DNN Platform/Library/Services/FileSystem/FileServerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public void ProcessRequest(HttpContext context)
}
if (!String.IsNullOrEmpty(URL))
{
URL = URL.Replace(@"\", @"/");

//update clicks, this must be done first, because the url tracker works with unmodified urls, like tabid, fileid etc
var objUrls = new UrlController();
objUrls.UpdateUrlTracking(_portalSettings.PortalId, URL, ModuleId, -1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ private void AddSearchDocumentInternal(SearchDocument searchDocument, bool autoC
{
Requires.NotNull("SearchDocument", searchDocument);
Requires.NotNullOrEmpty("UniqueKey", searchDocument.UniqueKey);
Requires.NotNullOrEmpty("Title", searchDocument.Title);
Requires.NotNegative("SearchTypeId", searchDocument.SearchTypeId);
Requires.PropertyNotEqualTo("searchDocument", "SearchTypeId", searchDocument.SearchTypeId, 0);
Requires.PropertyNotEqualTo("searchDocument", "ModifiedTimeUtc", searchDocument.ModifiedTimeUtc.ToString(CultureInfo.InvariantCulture), DateTime.MinValue.ToString(CultureInfo.InvariantCulture));
Expand Down
9 changes: 7 additions & 2 deletions DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ private SitemapUrl GetPageUrl(TabInfo objTab, string language)
var pageUrl = new SitemapUrl();
pageUrl.Url = Globals.NavigateURL(objTab.TabID, objTab.IsSuperTab, ps, "", language);

if (pageUrl.Url.ToLower().IndexOf(ps.PortalAlias.HTTPAlias.ToLower()) == -1)
string portalAlias = !String.IsNullOrEmpty(ps.DefaultPortalAlias)
? ps.DefaultPortalAlias
: ps.PortalAlias.HTTPAlias;

if (pageUrl.Url.ToLower().IndexOf(portalAlias.ToLower(), StringComparison.Ordinal) == -1)
{
// code to fix a bug in dnn5.1.2 for navigateurl
if ((HttpContext.Current != null))
Expand All @@ -106,9 +110,10 @@ private SitemapUrl GetPageUrl(TabInfo objTab, string language)
else
{
// try to use the portalalias
pageUrl.Url = Globals.AddHTTP(ps.PortalAlias.HTTPAlias.ToLower()) + pageUrl.Url;
pageUrl.Url = Globals.AddHTTP(portalAlias.ToLower()) + pageUrl.Url;
}
}

pageUrl.Priority = GetPriority(objTab);
pageUrl.LastModified = objTab.LastModifiedOnDate;
var modCtrl = new ModuleController();
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Modules/Groups/GroupListControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected override void Render(HtmlTextWriter output)
if (DisplayCurrentUserGroups)
whereCls.Add(grp => currentUser.IsInRole(grp.RoleName));
else
whereCls.Add(grp => grp.IsPublic || currentUser.IsInRole(grp.RoleName));
whereCls.Add(grp => grp.IsPublic || currentUser.IsInRole(grp.RoleName) || currentUser.IsInRole(PortalSettings.AdministratorRoleName));

if (!string.IsNullOrEmpty(SearchFilter))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
var url = "";
var userId = self.UserId();
if (userId != undefined) {
url = profileUrl.replace(profileUrlUserToken, self.UserId().toString());
url = profileUrl.replace(new RegExp(profileUrlUserToken, "gi"), self.UserId().toString());
}
return url;
}, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,7 @@ protected void Panel_PreRender(object sender, EventArgs e)
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorModuleId", moduleid.ToString(), true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorTabId", tabId.ToString(), true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorPortalId", portalId.ToString(), true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "sslEnabled", PortalSettings.SSLEnabled.ToString().ToLowerInvariant(), true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorHomeDirectory", PortalSettings.HomeDirectory, true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorPortalGuid", PortalSettings.GUID.ToString(), true);
ClientAPI.RegisterClientVariable(HtmlEditorControl.Page, "editorEnableUrlLanguage", PortalSettings.EnableUrlLanguage.ToString(), true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI.Editor" TagPrefix="tools" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI.Widgets" TagPrefix="widgets" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI.Dialogs" TagPrefix="dialogs" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="DotNetNuke.RadEditorProvider" Namespace="DotNetNuke.Providers.RadEditorProvider" TagPrefix="provider" %>

Expand Down Expand Up @@ -36,8 +34,7 @@
return regexp.test(s);
}
function _PageOnSite_Change(obj) {
function _PageOnSite_Change(obj) {
if (obj) {
var linkTextTextBox = $get("LinkText");
var linkUrlTextBox = $get("LinkURL");
Expand All @@ -56,15 +53,13 @@
}
}
function GetLinkClickURL(linkUrl) {
// Data is provided in the DialogParams format
var linkClickURL = linkUrl;
var trackClicksCheckbox = $get("TrackLink")
var trackUserCheckbox = $get("TrackUser")
var trackClicksCheckbox = $get("TrackLink");
var trackUserCheckbox = $get("TrackUser");
if (linkClickURL != "http:///" && linkClickURL != "http://") {
if (linkClickURL != "http:///" && linkClickURL != "https://") {
$.ajax({
type: 'POST',
Expand Down Expand Up @@ -193,7 +188,7 @@
return;
}
var href = "http://"; //"link"
var href = (_sslEnabled == "true") ? "https://" : "http://"; //"link"
if (currentLink.href) {
href = GetLinkClickURL(currentHref);
Expand Down Expand Up @@ -610,6 +605,7 @@
var _homeDirectory = parent.dnn.getVar('editorHomeDirectory');
var _portalGuid = parent.dnn.getVar('editorPortalGuid');
var _enableUrlLanguage = parent.dnn.getVar('editorEnableUrlLanguage');
var _sslEnabled = parent.dnn.getVar('sslEnabled');
</script>

<table cellpadding="0" cellspacing="0" class="reDialog LinkManager NoMarginDialog" style="width: 392px;">
Expand Down Expand Up @@ -923,7 +919,7 @@
</td>
</tr>
<tr>
<td class="reLabelCell" style="vertical-algin: top; text-align: right; width: 90px;">
<td class="reLabelCell" style="vertical-align: top; text-align: right; width: 90px;">
&nbsp;
</td>
<td class="reControlCell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@
<Content Include="LinkClickUrlHandler.ashx" />
<None Include="DotNetNuke.RadEditorProvider.dnn" />
<None Include="RadSpell\en-US.tdf" />
<Content Include="Dialogs\LinkManager.ascx" />
<Content Include="Dialogs\LinkManager.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="module.css" />
<Content Include="ReleaseNotes.txt" />
<Content Include="SpellCheckHandler.ashx" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,15 @@ public override void HandleRequest()
case "GetLinkInfo":
if (dialogParams.Track)
{
link = link.Replace(@"\", @"/");

//this section is for when the user clicks ok in the dialog box, we actually create a record for the linkclick urls.
if (! (dialogParams.LinkUrl.ToLower().Contains("linkclick.aspx")))
{
dialogParams.LinkClickUrl = GetLinkClickURL(ref dialogParams, ref link);
}

_urlController.UpdateUrl(dialogParams.PortalId, link, GetURLType(DotNetNuke.Common.Globals.GetURLType(link)), dialogParams.TrackUser, true, dialogParams.ModuleId, false);
_urlController.UpdateUrl(dialogParams.PortalId, link, GetURLType(Globals.GetURLType(link)), dialogParams.TrackUser, true, dialogParams.ModuleId, false);

}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,19 @@ public void SearchController_Add_Does_Not_Throw_On_Empty_Url()
Assert.DoesNotThrow(() => _internalSearchController.AddSearchDocument(doc));
}

[Test]
public void SearchController_Add_Does_Not_Throw_On_Empty_Title()
{
var doc = new SearchDocument
{
UniqueKey = Guid.NewGuid().ToString(),
SearchTypeId = OtherSearchTypeId,
ModifiedTimeUtc = DateTime.UtcNow
};

Assert.DoesNotThrow(() => _internalSearchController.AddSearchDocument(doc));
}

#endregion

#region IsActive Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ public void Clear(By locator)
FindElement(locator).Clear();
}

public void WaitAndClear(By locator)
{
Trace.WriteLine(BasePage.TraceLevelElement + "Wait and Clear the input field");
WaitForElement(locator).Clear();
}

public void Click(By locator)
{
Trace.WriteLine(BasePage.TraceLevelElement + "Find and Click: '" + locator + "'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public ExtensionsPage(IWebDriver driver) : base(driver)

public static string ModulesPanel = "//h2[@id='Panel-Modules']";
public static string ModulesAccordion = ModulesPanel + "/a";
public static string ModulesExtensionsList = ModulesPanel + "/following-sibling :: //tr[contains(@class, 'Item')]";
public static string ModulesExtensionsList = ModulesPanel + "/following-sibling :: *//tr[contains(@class, 'Item')]";
public static string CoreLanguagePacksPanel = "//h2[@id='Panel-Core Language Packs']";
public static string CoreLanguagePacksAccordion = CoreLanguagePacksPanel + "/a";
public static string CoreLanguagePacksList = CoreLanguagePacksPanel + "/following-sibling :: *//tr[contains(@class, 'Item')]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@

namespace DNNSelenium.Common.BaseClasses
{
public class ControlPanelIDs
public class ControlPanelIDs
{
public static string CompanyLogo = "//a/img[@id = 'dnn_dnnLOGO_imgLogo']";
public static string AwesomeCycles = "Awesome-Cycles-Logo.png";
public static string AnovaMobility = "logo_Anova.png";

public static string PageTitleID = "//span[contains(@id, 'dnnTITLE_titleLabel')]";
public static string PageHeaderID = "//span[@id= 'dnn_dnnBreadcrumb_lblBreadCrumb']/a[last()]";

Expand All @@ -18,7 +22,10 @@ public class ControlPanelIDs

public static string SocialRegisterLink = "//a[@id='dnn_userLogin_registerLink']";
public static string SocialLoginLink = "//a[@id='dnn_userLogin_loginLink']";
public static string SocialLogoutLink = "";
public static string SocialUserLink = "//a[@id = 'dnn_dnnUser_userNameLink']";

public static string SocialUserMenu = "//ul[@class = 'userMenu']";
public static string SocialLogoutLink = "//a[@id = 'dnn_userLogin_logoffLink']";

public static string MessageLink = "dnn_dnnUser_messageLink";
public static string NotificationLink = "dnn_dnnUser_notificationLink";
Expand Down
Loading

0 comments on commit 307208e

Please sign in to comment.