mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge pull request #5199 from vairam-svs/1.x
Remove Duplicate code that could be cleanedup for better maintenance.
This commit is contained in:
@@ -127,24 +127,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(name, content, httpEquiv, charset);
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(name)) {
|
|
||||||
metaEntry.Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(content)) {
|
|
||||||
metaEntry.Content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(httpEquiv)) {
|
|
||||||
metaEntry.HttpEquiv = httpEquiv;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(charset)) {
|
|
||||||
metaEntry.Charset = charset;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetMeta(metaEntry);
|
SetMeta(metaEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,24 +78,7 @@ namespace Orchard.Mvc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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(name, content, httpEquiv, charset);
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(name)) {
|
|
||||||
metaEntry.Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(content)) {
|
|
||||||
metaEntry.Content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(httpEquiv)) {
|
|
||||||
metaEntry.HttpEquiv = httpEquiv;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(charset)) {
|
|
||||||
metaEntry.Charset = charset;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetMeta(metaEntry);
|
SetMeta(metaEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,4 +165,4 @@ namespace Orchard.Mvc {
|
|||||||
|
|
||||||
public class ViewPage : ViewPage<dynamic> {
|
public class ViewPage : ViewPage<dynamic> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,24 +67,7 @@ namespace Orchard.Mvc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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(name, content, httpEquiv, charset);
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(name)) {
|
|
||||||
metaEntry.Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(content)) {
|
|
||||||
metaEntry.Content = content;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(httpEquiv)) {
|
|
||||||
metaEntry.HttpEquiv = httpEquiv;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(charset)) {
|
|
||||||
metaEntry.Charset = charset;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetMeta(metaEntry);
|
SetMeta(metaEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,6 +5,29 @@ using System.Web.Mvc;
|
|||||||
namespace Orchard.UI.Resources {
|
namespace Orchard.UI.Resources {
|
||||||
public class MetaEntry {
|
public class MetaEntry {
|
||||||
private readonly TagBuilder _builder = new TagBuilder("meta");
|
private readonly TagBuilder _builder = new TagBuilder("meta");
|
||||||
|
|
||||||
|
public MetaEntry() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public MetaEntry(string name = null, string content = null, string httpEquiv = null, string charset = null) {
|
||||||
|
if (!String.IsNullOrEmpty(name)) {
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(content)) {
|
||||||
|
Content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(httpEquiv)) {
|
||||||
|
HttpEquiv = httpEquiv;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(charset)) {
|
||||||
|
Charset = charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static MetaEntry Combine(MetaEntry meta1, MetaEntry meta2, string contentSeparator) {
|
public static MetaEntry Combine(MetaEntry meta1, MetaEntry meta2, string contentSeparator) {
|
||||||
var newMeta = new MetaEntry();
|
var newMeta = new MetaEntry();
|
||||||
|
Reference in New Issue
Block a user