22using System . Web . Mvc ;
33using System . Web . Mvc . Html ;
44using Our . Umbraco . DocTypeGridEditor . Extensions ;
5+ using Our . Umbraco . DocTypeGridEditor . Web . Helpers ;
56using Our . Umbraco . DocTypeGridEditor . Web . Mvc ;
67using Umbraco . Core ;
78using Umbraco . Core . Models ;
@@ -11,7 +12,8 @@ namespace Our.Umbraco.DocTypeGridEditor.Web.Extensions
1112{
1213 public static class HtmlHelperExtensions
1314 {
14- public static HtmlString RenderDocTypeGridEditorItem ( this HtmlHelper helper ,
15+ public static HtmlString RenderDocTypeGridEditorItem (
16+ this HtmlHelper helper ,
1517 IPublishedContent content ,
1618 string editorAlias = "" ,
1719 string viewPath = "" ,
@@ -28,10 +30,8 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
2830 if ( ! string . IsNullOrWhiteSpace ( previewViewPath ) )
2931 previewViewPath = previewViewPath . TrimEnd ( '/' ) + "/" ;
3032
31- var umbracoHelper = new UmbracoHelper ( UmbracoContext . Current ) ;
32-
3333 // Try looking for surface controller with action named after the editor alias
34- if ( ! editorAlias . IsNullOrWhiteSpace ( ) && umbracoHelper . SurfaceControllerExists ( controllerName , editorAlias , true ) )
34+ if ( ! editorAlias . IsNullOrWhiteSpace ( ) && SurfaceControllerHelper . SurfaceControllerExists ( controllerName , editorAlias , true ) )
3535 {
3636 return helper . Action ( editorAlias , controllerName , new
3737 {
@@ -42,7 +42,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
4242 }
4343
4444 // Try looking for surface controller with action named after the doc type alias alias
45- if ( umbracoHelper . SurfaceControllerExists ( controllerName , content . DocumentTypeAlias , true ) )
45+ if ( SurfaceControllerHelper . SurfaceControllerExists ( controllerName , content . DocumentTypeAlias , true ) )
4646 {
4747 return helper . Action ( content . DocumentTypeAlias , controllerName , new
4848 {
@@ -59,7 +59,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
5959 var defaultControllerName = defaultController . Name . Substring ( 0 , defaultController . Name . LastIndexOf ( "Controller" ) ) ;
6060
6161 // Try looking for an action named after the editor alias
62- if ( ! editorAlias . IsNullOrWhiteSpace ( ) && umbracoHelper . SurfaceControllerExists ( defaultControllerName , editorAlias , true ) )
62+ if ( ! editorAlias . IsNullOrWhiteSpace ( ) && SurfaceControllerHelper . SurfaceControllerExists ( defaultControllerName , editorAlias , true ) )
6363 {
6464 return helper . Action ( editorAlias , defaultControllerName , new
6565 {
@@ -70,7 +70,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
7070 }
7171
7272 // Try looking for a doc type alias action
73- if ( umbracoHelper . SurfaceControllerExists ( defaultControllerName , content . DocumentTypeAlias , true ) )
73+ if ( SurfaceControllerHelper . SurfaceControllerExists ( defaultControllerName , content . DocumentTypeAlias , true ) )
7474 {
7575 return helper . Action ( content . DocumentTypeAlias , defaultControllerName , new
7676 {
0 commit comments