Files
Umbraco-CMS/src/Umbraco.Core/UrlHelperExtensions.cs
Shannon Deminick b374dcf2c2 fixed issue with test project's invalid references (for web api). Added UmbracoAuthorizedApiController, change the
examine mgmt tools to use web api, got the dashboard displaying all relavent properties for indexers.
2013-02-27 05:24:45 +06:00

50 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Umbraco.Core.Configuration;
namespace Umbraco.Core
{
/// <summary>
/// Extension methods for UrlHelper
/// </summary>
public static class UrlHelperExtensions
{
/// <summary>
/// Returns the base path (not including the 'action') of the MVC controller "SaveFileController"
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string GetSaveFileServicePath(this UrlHelper url)
{
var result = url.Action("SavePartialView", "SaveFile", new {area = GlobalSettings.UmbracoMvcArea});
return result.TrimEnd("SavePartialView").EnsureEndsWith('/');
}
/// <summary>
/// Returns the base path (not including the 'action') of the MVC controller "BulkPublishController"
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string GetBulkPublishServicePath(this UrlHelper url)
{
var result = url.Action("PublishDocument", "BulkPublish", new { area = GlobalSettings.UmbracoMvcArea });
return result.TrimEnd("PublishDocument").EnsureEndsWith('/');
}
/// <summary>
/// Returns the base path (not including the 'action') of the MVC controller "CoreStringsController"
/// </summary>
/// <param name="url">The url helper.</param>
/// <returns>The base path of the controller.</returns>
public static string GetCoreStringsControllerPath(this UrlHelper url)
{
var result = url.Action("ToSafeAlias", "CoreStrings", new { area = GlobalSettings.UmbracoMvcArea });
return result.TrimEnd("ToSafeAlias");
}
}
}