2012-12-30 03:11:21 +03:00
|
|
|
|
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
|
|
|
|
|
|
{
|
2013-02-23 23:00:31 +06:00
|
|
|
|
|
2012-12-30 03:11:21 +03:00
|
|
|
|
/// <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});
|
2013-02-23 23:00:31 +06:00
|
|
|
|
return result.TrimEnd("SavePartialView").EnsureEndsWith('/');
|
2012-12-30 03:11:21 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-02-09 04:05:01 +06:00
|
|
|
|
/// <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 });
|
2013-02-23 23:00:31 +06:00
|
|
|
|
return result.TrimEnd("PublishDocument").EnsureEndsWith('/');
|
2013-02-09 04:05:01 +06:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-02-19 06:30:19 -01:00
|
|
|
|
/// <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");
|
|
|
|
|
|
}
|
2012-12-30 03:11:21 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|