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