2
2
using System . Web . Mvc ;
3
3
using System . Web . Mvc . Html ;
4
4
using Our . Umbraco . DocTypeGridEditor . Extensions ;
5
+ using Our . Umbraco . DocTypeGridEditor . Web . Helpers ;
5
6
using Our . Umbraco . DocTypeGridEditor . Web . Mvc ;
6
7
using Umbraco . Core ;
7
8
using Umbraco . Core . Models ;
@@ -11,7 +12,8 @@ namespace Our.Umbraco.DocTypeGridEditor.Web.Extensions
11
12
{
12
13
public static class HtmlHelperExtensions
13
14
{
14
- public static HtmlString RenderDocTypeGridEditorItem ( this HtmlHelper helper ,
15
+ public static HtmlString RenderDocTypeGridEditorItem (
16
+ this HtmlHelper helper ,
15
17
IPublishedContent content ,
16
18
string editorAlias = "" ,
17
19
string viewPath = "" ,
@@ -28,10 +30,8 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
28
30
if ( ! string . IsNullOrWhiteSpace ( previewViewPath ) )
29
31
previewViewPath = previewViewPath . TrimEnd ( '/' ) + "/" ;
30
32
31
- var umbracoHelper = new UmbracoHelper ( UmbracoContext . Current ) ;
32
-
33
33
// 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 ) )
35
35
{
36
36
return helper . Action ( editorAlias , controllerName , new
37
37
{
@@ -42,7 +42,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
42
42
}
43
43
44
44
// 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 ) )
46
46
{
47
47
return helper . Action ( content . DocumentTypeAlias , controllerName , new
48
48
{
@@ -59,7 +59,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
59
59
var defaultControllerName = defaultController . Name . Substring ( 0 , defaultController . Name . LastIndexOf ( "Controller" ) ) ;
60
60
61
61
// 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 ) )
63
63
{
64
64
return helper . Action ( editorAlias , defaultControllerName , new
65
65
{
@@ -70,7 +70,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
70
70
}
71
71
72
72
// Try looking for a doc type alias action
73
- if ( umbracoHelper . SurfaceControllerExists ( defaultControllerName , content . DocumentTypeAlias , true ) )
73
+ if ( SurfaceControllerHelper . SurfaceControllerExists ( defaultControllerName , content . DocumentTypeAlias , true ) )
74
74
{
75
75
return helper . Action ( content . DocumentTypeAlias , defaultControllerName , new
76
76
{
0 commit comments