Skip to content

Commit

Permalink
Merge pull request #871 from Sitefinity/loginRedirectsML#866
Browse files Browse the repository at this point in the history
Login redirects ml#866
  • Loading branch information
Boyko-Karadzhov committed Feb 27, 2015
2 parents d4abaed + 9ab8aa6 commit 9bb63c5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Telerik.Sitefinity.Frontend/Mvc/Helpers/HyperLinkHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using System;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
using Telerik.Sitefinity.Frontend.Mvc.Models;
using Telerik.Sitefinity.Localization.UrlLocalizationStrategies;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Web;
using Telerik.Sitefinity.Web.DataResolving;

Expand Down Expand Up @@ -76,5 +81,37 @@ public static string GetDetailPageUrl(ItemViewModel item, Guid detailsPageId, bo

return url;
}

/// <summary>
/// Gets the full page URL.
/// </summary>
/// <param name="pageId">The page identifier.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings")]
public static string GetFullPageUrl(Guid pageId)
{
if (pageId != Guid.Empty)
{
var siteMap = SitefinitySiteMap.GetCurrentProvider();

SiteMapNode node;
var sitefinitySiteMap = siteMap as SiteMapBase;
if (sitefinitySiteMap != null)
{
node = sitefinitySiteMap.FindSiteMapNodeFromKey(pageId.ToString(), false);
}
else
{
node = siteMap.FindSiteMapNodeFromKey(pageId.ToString());
}

if (node != null)
{
return UrlPath.ResolveUrl(node.Url, true);
}
}

return null;
}
}
}

0 comments on commit 9bb63c5

Please sign in to comment.