mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
- tags in Theme.txt.
- Hide the themes that have the hidden tag set in their Theme.txt when looking at the available themes in the themes admin. --HG-- branch : dev
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Orchard.Core.Themes.Models {
|
|||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
public string HomePage { get; set; }
|
public string HomePage { get; set; }
|
||||||
|
public string Tags { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@@ -8,5 +8,6 @@ namespace Orchard.Core.Themes.Records {
|
|||||||
public virtual string Version { get; set; }
|
public virtual string Version { get; set; }
|
||||||
public virtual string Author { get; set; }
|
public virtual string Author { get; set; }
|
||||||
public virtual string HomePage { get; set; }
|
public virtual string HomePage { get; set; }
|
||||||
|
public virtual string Tags { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -74,6 +74,7 @@ namespace Orchard.Core.Themes.Services {
|
|||||||
HomePage = descriptor.HomePage ?? String.Empty,
|
HomePage = descriptor.HomePage ?? String.Empty,
|
||||||
ThemeName = descriptor.Name,
|
ThemeName = descriptor.Name,
|
||||||
Version = descriptor.Version ?? String.Empty,
|
Version = descriptor.Version ?? String.Empty,
|
||||||
|
Tags = descriptor.Tags ?? String.Empty
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,9 +84,7 @@ namespace Orchard.Core.Themes.Services {
|
|||||||
public IEnumerable<ITheme> GetInstalledThemes() {
|
public IEnumerable<ITheme> GetInstalledThemes() {
|
||||||
List<ITheme> themes = new List<ITheme>();
|
List<ITheme> themes = new List<ITheme>();
|
||||||
foreach (var descriptor in _extensionManager.AvailableExtensions()) {
|
foreach (var descriptor in _extensionManager.AvailableExtensions()) {
|
||||||
//todo: (heskew) filter out Admin themes in a different manner - eventually we'll need a way to select the admin theme so there should be a clear separation
|
if (String.Equals(descriptor.ExtensionType, "Theme", StringComparison.OrdinalIgnoreCase)) {
|
||||||
if (String.Equals(descriptor.ExtensionType, "Theme", StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& !(descriptor.Name.EndsWith("Admin", StringComparison.OrdinalIgnoreCase))) {
|
|
||||||
Theme theme = new Theme {
|
Theme theme = new Theme {
|
||||||
Author = descriptor.Author ?? String.Empty,
|
Author = descriptor.Author ?? String.Empty,
|
||||||
Description = descriptor.Description ?? String.Empty,
|
Description = descriptor.Description ?? String.Empty,
|
||||||
@@ -93,14 +92,16 @@ namespace Orchard.Core.Themes.Services {
|
|||||||
HomePage = descriptor.HomePage ?? String.Empty,
|
HomePage = descriptor.HomePage ?? String.Empty,
|
||||||
ThemeName = descriptor.Name,
|
ThemeName = descriptor.Name,
|
||||||
Version = descriptor.Version ?? String.Empty,
|
Version = descriptor.Version ?? String.Empty,
|
||||||
|
Tags = descriptor.Tags ?? String.Empty
|
||||||
};
|
};
|
||||||
|
if (!theme.Tags.Contains("hidden")) {
|
||||||
themes.Add(theme);
|
themes.Add(theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return themes;
|
return themes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void InstallTheme(HttpPostedFileBase file) {
|
public void InstallTheme(HttpPostedFileBase file) {
|
||||||
_extensionManager.InstallExtension("Theme", file);
|
_extensionManager.InstallExtension("Theme", file);
|
||||||
}
|
}
|
||||||
|
@@ -2,5 +2,5 @@
|
|||||||
author: Jonathan Wall
|
author: Jonathan Wall
|
||||||
description: The Orchard Theme for setup and failure conditions.
|
description: The Orchard Theme for setup and failure conditions.
|
||||||
version: 1.0
|
version: 1.0
|
||||||
tags: Orchard
|
tags: hidden
|
||||||
homepage: http://www.orchardproject.net
|
homepage: http://www.orchardproject.net
|
@@ -1,5 +1,6 @@
|
|||||||
name: The Admin
|
name: The Admin
|
||||||
version: 1.0
|
version: 1.0
|
||||||
author: Jon Wall
|
author: Jon Wall
|
||||||
|
tags: hidden, admin
|
||||||
description: An admin theme not to be used for the site so don't click "Activate" (or "Uninstall"). In the near future admin themes won't be mixed in with site themes.
|
description: An admin theme not to be used for the site so don't click "Activate" (or "Uninstall"). In the near future admin themes won't be mixed in with site themes.
|
||||||
homepage: http://www.orchardproject.net
|
homepage: http://www.orchardproject.net
|
@@ -110,6 +110,7 @@ namespace Orchard.Environment.ShellBuilders {
|
|||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
public string HomePage { get; set; }
|
public string HomePage { get; set; }
|
||||||
|
public string Tags { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly SafeModeTheme _theme = new SafeModeTheme {
|
private readonly SafeModeTheme _theme = new SafeModeTheme {
|
||||||
|
@@ -21,5 +21,6 @@
|
|||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
public string HomePage { get; set; }
|
public string HomePage { get; set; }
|
||||||
|
public string Tags { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,8 @@ namespace Orchard.Extensions {
|
|||||||
Description = GetValue(fields, "description"),
|
Description = GetValue(fields, "description"),
|
||||||
Version = GetValue(fields, "version"),
|
Version = GetValue(fields, "version"),
|
||||||
Author = GetValue(fields, "author"),
|
Author = GetValue(fields, "author"),
|
||||||
HomePage = GetValue(fields, "homepage")
|
HomePage = GetValue(fields, "homepage"),
|
||||||
|
Tags = GetValue(fields, "tags")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,5 +11,6 @@ namespace Orchard.Themes {
|
|||||||
string Version { get; set; }
|
string Version { get; set; }
|
||||||
string Author { get; set; }
|
string Author { get; set; }
|
||||||
string HomePage { get; set; }
|
string HomePage { get; set; }
|
||||||
|
string Tags { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user