Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NatashaZav committed Sep 11, 2013
2 parents 7c94ffd + d23e458 commit 66ab614
Show file tree
Hide file tree
Showing 544 changed files with 1,720 additions and 2,074 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
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
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 @@ -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 @@ -2,9 +2,9 @@

<Tests>

<settings name="BVT" browser="firefox" baseURL="ce712v3.dnndev.me" InstallerLanguage="en" UserName="host"
<settings name="BVT" browser="chrome" baseURL="ceBVTTrunk.lvh.me" InstallerLanguage="en" UserName="host"
Password="dnnhost" WebsiteName="My Website" Template="Default Template" Language="en" DatabaseSetup="Default"
DatabaseType="" DatabaseServerName="" DatabaseName="" DatabaseFilename="" ObjectQualifier="" Security=""
DatabaseType="" DatabaseServerName="(local)" DatabaseName="ceBVTTrunk" DatabaseFilename="" ObjectQualifier="dnn_" Security=""
DatabaseUserName="" DatabasePassword="" RunDatabaseAsDatabaseOwner="" />

<childSite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<settings
name = "Test1"
browser = "firefox"
browser = "chrome"
baseURL = "InstallerCETest1.lvh.me"
InstallerLanguage = "en"
Template = "Default Template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<settings
name = "Test3"
browser = "firefox"
browser = "chrome"
baseURL = "InstallerCETest3.lvh.me"
InstallerLanguage = "en"
Template = "Default Template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<settings
name = "Test2"
browser = "firefox"
browser = "chrome"
baseURL = "InstallerCETest2.lvh.me"
InstallerLanguage = "en"
Template = "Default Template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<settings
name = "Upgrade Test, Daily run"
browser = "chrome"
baseURL = "ee710v2.dnndev.me"
baseURL = "UpgradeCETest.dnndev.me"

UserName = "host"
Password = "dnnhost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public void AdvancedUrlProvider_ImprovedFriendlyUrl(Dictionary<string, string> t
public void AdvancedUrlProvider_SpaceEncoding(Dictionary<string, string> testFields)
{
var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "SpaceEncoding");
settings.ReplaceSpaceWith = " ";

string spaceEncoding = testFields.GetValue("SpaceEncoding");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Key, Value
UrlFormat, advanced
FriendlyAdminHostUrls, true
PageExtensionUsageType, AlwaysUse
Key, Value,
UrlFormat, advanced,
FriendlyAdminHostUrls, true,
PageExtensionUsageType, AlwaysUse,
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
Test, Scheme, SpaceEncoding, Page Name, Params, Expected Url,
Default 1QS, http://, , Home, &view=Show Code, http://{alias}/Home/view/Show%20Code.aspx
Plus 1QS, http://, +, Home, &view=Show Code, http://{alias}/Home/view/Show+Code.aspx
Unicode 1QS, http://, %20, Home, &view=Show Code, http://{alias}/Home/view/Show%20Code.aspx
Default 2QS, http://, , Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add%20Item/mid/100.aspx
Plus 2QS, http://, +, Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add+Item/mid/100.aspx
Unicode 2QS, http://, %20, Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add%20Item/mid/100.aspx
Test, Scheme, SpaceEncoding, Page Name, Params, Expected Url,
Default About Us, http://, , About Us, , http://{alias}/About%20Us.aspx
Plus About Us, http://, +, About Us, , http://{alias}/About+Us.aspx
Unicode About Us, http://, %20, About Us, , http://{alias}/About%20Us.aspx
Default 1QS, http://, , Home, &view=Show Code, http://{alias}/Home/view/Show%20Code.aspx
Plus 1QS, http://, +, Home, &view=Show Code, http://{alias}/Home/view/Show+Code.aspx
Unicode 1QS, http://, %20, Home, &view=Show Code, http://{alias}/Home/view/Show%20Code.aspx
Default 2QS, http://, , Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add%20Item/mid/100.aspx
Plus 2QS, http://, +, Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add+Item/mid/100.aspx
Unicode 2QS, http://, %20, Home, &ctl=Add Item&mid=100, http://{alias}/Home/ctl/Add%20Item/mid/100.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1>About Content Localization</h1>
<p>Content Localization allows Administrators and translators to create localized module content in multiple languages (cultures). </p>
<p>
<MadCap:snippetText src="../../../../Resources/Snippets/Prerequisite.flsnp" />More than one language must be deployed (<MadCap:xref href="../../Using the Control Panel/Admin Console/Languages/SuperUsers/01 InstallAvailableLanguages.html">See "Installing Available Languages"</MadCap:xref>) and enabled on the site, <MadCap:xref href="../../Using the Control Panel/Admin Console/Languages/Module Editors/Enabling-Disabling a Language.html">See "Enabling/Disabling a Language".</MadCap:xref></p>
Prerequisite. More than one language must be deployed (<MadCap:xref href="../../Using the Control Panel/Admin Console/Languages/SuperUsers/01 InstallAvailableLanguages.html">See "Installing Available Languages"</MadCap:xref>) and enabled on the site, <MadCap:xref href="../../Using the Control Panel/Admin Console/Languages/Module Editors/Enabling-Disabling a Language.html">See "Enabling/Disabling a Language".</MadCap:xref></p>
<p MadCap:conditions="Default.SuperUser Only">Content localization must also be allowed on the site by a SuperUser (<MadCap:xref href="../../Using the Control Panel/Host Console/Host Settings/Other Settings/Allowing-Disallowing Content Localization.html">See "Allowing/Disallowing Content Localization"</MadCap:xref>)</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="4" MadCap:lastHeight="2213" MadCap:lastWidth="839">
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="4" MadCap:lastHeight="2316" MadCap:lastWidth="771">
<head>
</head>
<body>
<h1>Creating Localized Pages for a Language</h1>
<p>How to create localized pages for a language that has been added to the site but does not yet have localized pages created. This can occur if localization was enabled when a language was disabled or if localization was enabled but not all pages were set as translatable, therefore the individual pages need to be <MadCap:annotation MadCap:createDate="2013-06-04T14:12:59.7208828+10:00" MadCap:creator="Lorraine" MadCap:initials="LO" MadCap:comment="Please explain when/how to use this. Is the title correct?" MadCap:editor="Lorraine" MadCap:editDate="2013-06-04T14:13:14.3837215+10:00">chosen</MadCap:annotation>. Users must be granted Edit Module/Add Content permissions to the Languages module.</p>
<p>
<MadCap:snippetText src="../../../../../Resources/Snippets/Prerequisite.flsnp" />Localized content must be enabled. <MadCap:xref href="../../../Using the Control Panel/Admin Console/Languages/Module Editors/01 Enabling Localized Content.html">See "Enabling Localized Content"</MadCap:xref></p>
<p> <MadCap:snippetText src="../../../../../Resources/Snippets/Prerequisite.flsnp" />Localized content must be enabled. <MadCap:xref href="../../../Using the Control Panel/Admin Console/Languages/Module Editors/01 Enabling Localized Content.html">See "Enabling Localized Content"</MadCap:xref></p>
<ol>
<li>Navigate to Admin &gt;&#160;Advanced Settings &gt; <img src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /> <![CDATA[ ]]><b>Languages</b> - OR&#160;- Go to a Languages module.</li>
<li>Navigate to Admin &gt;&#160;Advanced Settings &gt; <img src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /> <b>Languages</b> - OR&#160;- Go to a Languages module.</li>
<li> Select the <b>Languages</b> tab.</li>
<li><b>Optional.</b> In the <b>Enabled</b> column of the Culture grid, <MadCap:snippetText src="../../../../../Resources/Snippets/Check.flsnp" />beside the language if it is not yet enabled.</li>
<li>In the <b>Content Location - </b><img alt="" src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /> <![CDATA[ ]]><b> No of Pages</b> column of the Culture grid, click the <img alt="" src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /><b> Create Pages In This Language</b> button beside the required language.</li>
<li>In the <b>Content Location - </b><img alt="" src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /> <b> No of Pages</b> column of the Culture grid, click the <img alt="" src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /><b> Create Pages In This Language</b> button beside the required language.</li>
</ol>
<p>
<img alt="" src="../../../Resources/Images/Admin/Languages/Languages_LC_CreateLocalizedPages1.PNG" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h1>Making a Page Translatable</h1>
<p>How to make a page translatable by creating a translatable version of the page and all modules on that page in each of the enabled <MadCap:annotation MadCap:createDate="2013-06-25T17:41:08.2922321+10:00" MadCap:creator="Lorraine" MadCap:initials="LO" MadCap:comment="Please add correct permissions. Is it that Admin can do when no pages are localized but a translator can select a page one there is one/more localized pages?" MadCap:editor="Lorraine" MadCap:editDate="2013-06-25T17:41:08.7632590+10:00">languages</MadCap:annotation>. </p>
<p>
<MadCap:snippetText src="../../../Resources/Snippets/Prerequisite.flsnp" />A translation for a page can be created by either an Administrator or a translator. If this task is performed by an Administrator a translation will be made for each culture. Translators can use this feature to create translatable version of a page my language only. Translations for other cultures can later be added by other translators or Administrators using the Languages module. <MadCap:xref href="07 Adding Missing Translations.htm">See "Adding Missing Language Translations to a Page"</MadCap:xref></p>
Prerequisite. A translation for a page can be created by either an Administrator or a translator. If this task is performed by an Administrator a translation will be made for each culture. Translators can use this feature to create translatable version of a page my language only. Translations for other cultures can later be added by other translators or Administrators using the Languages module. <MadCap:xref href="07 Adding Missing Translations.htm">See "Adding Missing Language Translations to a Page"</MadCap:xref></p>
<h2>Using the Languages Module</h2>
<ol>
<li>Navigate to Admin &gt;&#160;Advanced Settings &gt; <img src="../../../Resources/Images/Icons/Languages_16x16_Standard.png" /> <![CDATA[ ]]><b>Languages</b> - OR&#160;- Go to a Languages module.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Changing Translatable Modules to Reference Modules</h1>
</p>
<ol MadCap:continue="true">
<li>
<MadCap:snippetText src="../../../Resources/Snippets/Update.flsnp" /> The selected module is now a reference copy of the default language module and the module name cannot be edited.</li>
Click the <b>Update</b> button. The selected module is now a reference copy of the default language module and the module name cannot be edited.</li>
</ol>
<p>
<img src="../../../Resources/Images/Admin/Languages/Languages_LC_ReferenceModule2.PNG" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Changing Reference Modules to Translatable Modules</h1>
</p>
<ol MadCap:continue="true">
<li>
<MadCap:snippetText src="../../../Resources/Snippets/Update.flsnp" />
Click the <b>Update</b> button.
</li>
</ol>
<p>
Expand Down
Loading

0 comments on commit 66ab614

Please sign in to comment.