diff --git a/src/Umbraco.Core/RazorDataTypeModelStaticMappingItem.cs b/src/Umbraco.Core/Configuration/RazorDataTypeModelStaticMappingItem.cs
similarity index 91%
rename from src/Umbraco.Core/RazorDataTypeModelStaticMappingItem.cs
rename to src/Umbraco.Core/Configuration/RazorDataTypeModelStaticMappingItem.cs
index cfbd7bd254..b69a8d9fe0 100644
--- a/src/Umbraco.Core/RazorDataTypeModelStaticMappingItem.cs
+++ b/src/Umbraco.Core/Configuration/RazorDataTypeModelStaticMappingItem.cs
@@ -1,9 +1,6 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-namespace Umbraco.Core
+namespace Umbraco.Core.Configuration
{
//NOTE: This is used in the old DynamicNode for performing value conversions/mappings for certain data types.
diff --git a/src/Umbraco.Core/IThumbnailProvider.cs b/src/Umbraco.Core/Media/IThumbnailProvider.cs
similarity index 54%
rename from src/Umbraco.Core/IThumbnailProvider.cs
rename to src/Umbraco.Core/Media/IThumbnailProvider.cs
index c05f50bb62..a5be69b72e 100644
--- a/src/Umbraco.Core/IThumbnailProvider.cs
+++ b/src/Umbraco.Core/Media/IThumbnailProvider.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Umbraco.Core
+namespace Umbraco.Core.Media
{
public interface IThumbnailProvider
{
diff --git a/src/Umbraco.Core/Templates/TemplateUtilities.cs b/src/Umbraco.Core/Templates/TemplateUtilities.cs
new file mode 100644
index 0000000000..cb3fdb0f85
--- /dev/null
+++ b/src/Umbraco.Core/Templates/TemplateUtilities.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace Umbraco.Core.Templates
+{
+ internal class TemplateUtilities
+ {
+
+ public static string ParseInternalLinks(string pageContents)
+ {
+ // Parse internal links
+ MatchCollection tags = Regex.Matches(pageContents, @"href=""[/]?(?:\{|\%7B)localLink:([0-9]+)(?:\}|\%7D)", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
+ foreach (Match tag in tags)
+ if (tag.Groups.Count > 0)
+ {
+ string id = tag.Groups[1].Value; //.Remove(tag.Groups[1].Value.Length - 1, 1);
+ string newLink = library.NiceUrl(int.Parse(id));
+ pageContents = pageContents.Replace(tag.Value.ToString(), "href=\"" + newLink);
+ }
+ return pageContents;
+ }
+
+
+ }
+}
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index 59142f2652..9c024e782f 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -131,6 +131,7 @@
+
@@ -154,9 +155,9 @@
-
+
-
+
diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs
index 6ed1e49a41..5ed103fe9b 100644
--- a/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs
+++ b/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs
@@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Text;
using Umbraco.Core;
+using Umbraco.Core.Media;
namespace Umbraco.Web.Media.ThumbnailProviders
{
diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/ThumbnailProvidersResolver.cs b/src/Umbraco.Web/Media/ThumbnailProviders/ThumbnailProvidersResolver.cs
index 52c8d4ac66..10e019111b 100644
--- a/src/Umbraco.Web/Media/ThumbnailProviders/ThumbnailProvidersResolver.cs
+++ b/src/Umbraco.Web/Media/ThumbnailProviders/ThumbnailProvidersResolver.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Web;
using Umbraco.Core;
+using Umbraco.Core.Media;
using Umbraco.Core.ObjectResolution;
using umbraco.BusinessLogic;
using umbraco.BusinessLogic.Utils;
diff --git a/src/Umbraco.Web/AreaRegistrationExtensions.cs b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs
similarity index 95%
rename from src/Umbraco.Web/AreaRegistrationExtensions.cs
rename to src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs
index 1ee790de62..c867a0823d 100644
--- a/src/Umbraco.Web/AreaRegistrationExtensions.cs
+++ b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
-using System.Text.RegularExpressions;
using System.Web.Mvc;
using System.Web.Routing;
using Umbraco.Core;
using Umbraco.Core.Configuration;
-namespace Umbraco.Web
+namespace Umbraco.Web.Mvc
{
internal static class AreaRegistrationExtensions
{
diff --git a/src/Umbraco.Web/RouteValueDictionaryExtensions.cs b/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs
similarity index 94%
rename from src/Umbraco.Web/RouteValueDictionaryExtensions.cs
rename to src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs
index 5989dbe295..445441aafa 100644
--- a/src/Umbraco.Web/RouteValueDictionaryExtensions.cs
+++ b/src/Umbraco.Web/Mvc/RouteValueDictionaryExtensions.cs
@@ -3,7 +3,7 @@ using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
-namespace Umbraco.Web
+namespace Umbraco.Web.Mvc
{
internal static class RouteValueDictionaryExtensions
{
diff --git a/src/Umbraco.Web/ViewContextExtensions.cs b/src/Umbraco.Web/Mvc/ViewContextExtensions.cs
similarity index 93%
rename from src/Umbraco.Web/ViewContextExtensions.cs
rename to src/Umbraco.Web/Mvc/ViewContextExtensions.cs
index 3d15b0d95d..30dcccbbbb 100644
--- a/src/Umbraco.Web/ViewContextExtensions.cs
+++ b/src/Umbraco.Web/Mvc/ViewContextExtensions.cs
@@ -1,6 +1,6 @@
using System.Web.Mvc;
-namespace Umbraco.Web
+namespace Umbraco.Web.Mvc
{
internal static class ViewContextExtensions
{
diff --git a/src/Umbraco.Web/ViewDataContainerExtensions.cs b/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs
similarity index 94%
rename from src/Umbraco.Web/ViewDataContainerExtensions.cs
rename to src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs
index b5a9843c5e..5e9ad89b9d 100644
--- a/src/Umbraco.Web/ViewDataContainerExtensions.cs
+++ b/src/Umbraco.Web/Mvc/ViewDataContainerExtensions.cs
@@ -1,6 +1,6 @@
using System.Web.Mvc;
-namespace Umbraco.Web
+namespace Umbraco.Web.Mvc
{
internal static class ViewDataContainerExtensions
{
diff --git a/src/Umbraco.Web/PluginManagerExtensions.cs b/src/Umbraco.Web/PluginManagerExtensions.cs
index 07a3ce9127..a477f33da8 100644
--- a/src/Umbraco.Web/PluginManagerExtensions.cs
+++ b/src/Umbraco.Web/PluginManagerExtensions.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Threading;
using Umbraco.Core;
+using Umbraco.Core.Media;
using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
using umbraco;
diff --git a/src/Umbraco.Web/LegacyRequestInitializer.cs b/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs
similarity index 96%
rename from src/Umbraco.Web/LegacyRequestInitializer.cs
rename to src/Umbraco.Web/Routing/LegacyRequestInitializer.cs
index 0621520d5b..b6373d410b 100644
--- a/src/Umbraco.Web/LegacyRequestInitializer.cs
+++ b/src/Umbraco.Web/Routing/LegacyRequestInitializer.cs
@@ -1,7 +1,7 @@
using System;
using System.Web;
-namespace Umbraco.Web
+namespace Umbraco.Web.Routing
{
///
/// A legacy class for old style handling of URL requests
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 377fb352f1..16e2f99fd4 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -240,7 +240,7 @@
Properties\SolutionInfo.cs
-
+
@@ -321,8 +321,8 @@
-
-
+
+
@@ -342,14 +342,14 @@
-
+
-
+
diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs
index 7d96407157..e626b07e76 100644
--- a/src/Umbraco.Web/UmbracoHelper.cs
+++ b/src/Umbraco.Web/UmbracoHelper.cs
@@ -168,6 +168,9 @@ namespace Umbraco.Web
RenderFieldEncodingType encoding = RenderFieldEncodingType.Unchanged,
string formatString = "")
{
+ Mandate.ParameterNotNull(currentPage, "currentPage");
+ Mandate.ParameterNotNullOrEmpty(fieldAlias, "fieldAlias");
+
//TODO: This is real nasty and we should re-write the 'item' and 'ItemRenderer' class but si fine for now
var attributes = new Dictionary
diff --git a/src/umbraco.businesslogic/Razor/RazorDataTypeModelStaticMappingItem.cs b/src/umbraco.businesslogic/Razor/RazorDataTypeModelStaticMappingItem.cs
index fab1d4d291..8cb7f1adb3 100644
--- a/src/umbraco.businesslogic/Razor/RazorDataTypeModelStaticMappingItem.cs
+++ b/src/umbraco.businesslogic/Razor/RazorDataTypeModelStaticMappingItem.cs
@@ -8,7 +8,7 @@ namespace umbraco.MacroEngines
[Obsolete("use Umbraco.Core.RazorDataTypeModelStaticMappingItem instead")]
public class RazorDataTypeModelStaticMappingItem
{
- private readonly Umbraco.Core.RazorDataTypeModelStaticMappingItem _realMappingItem = new Umbraco.Core.RazorDataTypeModelStaticMappingItem();
+ private readonly Umbraco.Core.Configuration.RazorDataTypeModelStaticMappingItem _realMappingItem = new Umbraco.Core.Configuration.RazorDataTypeModelStaticMappingItem();
public string Raw
{