mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
reverting file annotations
This commit is contained in:
@@ -23,22 +23,22 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
|||||||
private object _display;
|
private object _display;
|
||||||
private object _layout;
|
private object _layout;
|
||||||
|
|
||||||
public Localizer T {
|
public Localizer T {
|
||||||
get {
|
get {
|
||||||
// first time used, create it
|
// first time used, create it
|
||||||
if (_localizer == NullLocalizer.Instance) {
|
if(_localizer == NullLocalizer.Instance) {
|
||||||
|
|
||||||
// if the Model is a shape, get localization scopes from binding sources
|
// if the Model is a shape, get localization scopes from binding sources
|
||||||
// e.g., Logon.cshtml in a theme, overriging Users/Logon.cshtml, needs T to
|
// e.g., Logon.cshtml in a theme, overriging Users/Logon.cshtml, needs T to
|
||||||
// fallback to the one in Users
|
// fallback to the one in Users
|
||||||
var shape = Model as IShape;
|
var shape = Model as IShape;
|
||||||
if (shape != null && shape.Metadata.BindingSources.Count > 1) {
|
if(shape != null && shape.Metadata.BindingSources.Count > 1) {
|
||||||
var localizers = shape.Metadata.BindingSources.Reverse().Select(scope => LocalizationUtilities.Resolve(ViewContext, scope)).ToList();
|
var localizers = shape.Metadata.BindingSources.Reverse().Select(scope => LocalizationUtilities.Resolve(ViewContext, scope)).ToList();
|
||||||
_localizer = (text, args) => {
|
_localizer = (text, args) => {
|
||||||
foreach (var localizer in localizers) {
|
foreach(var localizer in localizers) {
|
||||||
var hint = localizer(text, args);
|
var hint = localizer(text, args);
|
||||||
// if not localized using this scope, use next scope
|
// if not localized using this scope, use next scope
|
||||||
if (hint.Text != text) {
|
if(hint.Text != text) {
|
||||||
return hint;
|
return hint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return _localizer;
|
return _localizer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public dynamic Display { get { return _display; } }
|
public dynamic Display { get { return _display; } }
|
||||||
@@ -79,7 +79,7 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IAuthorizer _authorizer;
|
private IAuthorizer _authorizer;
|
||||||
public IAuthorizer Authorizer {
|
public IAuthorizer Authorizer {
|
||||||
get {
|
get {
|
||||||
return _authorizer ?? (_authorizer = WorkContext.Resolve<IAuthorizer>());
|
return _authorizer ?? (_authorizer = WorkContext.Resolve<IAuthorizer>());
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
|||||||
|
|
||||||
public void SetMeta(string name = null, string content = null, string httpEquiv = null, string charset = null) {
|
public void SetMeta(string name = null, string content = null, string httpEquiv = null, string charset = null) {
|
||||||
var metaEntry = new MetaEntry();
|
var metaEntry = new MetaEntry();
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(name)) {
|
if (!String.IsNullOrEmpty(name)) {
|
||||||
metaEntry.Name = name;
|
metaEntry.Name = name;
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ namespace Orchard.Mvc.ViewEngines.Razor {
|
|||||||
base.InitHelpers();
|
base.InitHelpers();
|
||||||
|
|
||||||
WorkContext = ViewContext.GetWorkContext();
|
WorkContext = ViewContext.GetWorkContext();
|
||||||
|
|
||||||
_display = DisplayHelperFactory.CreateHelper(ViewContext, this);
|
_display = DisplayHelperFactory.CreateHelper(ViewContext, this);
|
||||||
_layout = WorkContext.Layout;
|
_layout = WorkContext.Layout;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user