mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Ability to create and install packages of simple themes.
--HG-- branch : dev
This commit is contained in:
@@ -38,6 +38,10 @@ namespace Orchard.Packaging.Services {
|
||||
ExtractProjectFiles(context, "Compile", "Content", "None", "EmbeddedResource");
|
||||
ExtractReferenceFiles(context);
|
||||
}
|
||||
else if (context.ExtensionType == "Theme") {
|
||||
// this is a simple theme with no csproj
|
||||
ExtractThemeFiles(context);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
EndPackage(context);
|
||||
@@ -108,6 +112,14 @@ namespace Orchard.Packaging.Services {
|
||||
}
|
||||
}
|
||||
|
||||
private void ExtractThemeFiles(ExpandContext context) {
|
||||
foreach (var relativePath in from p in context.Package.GetParts()
|
||||
where p.Uri.ToString().StartsWith("/" + context.ExtensionName + "/", StringComparison.OrdinalIgnoreCase)
|
||||
select p.Uri.ToString().Substring(("/" + context.ExtensionName + "/").Length)) {
|
||||
ExtractFile(context, relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
private bool PartExists(ExpandContext context, string relativePath) {
|
||||
Uri projectUri = PackUriHelper.CreatePartUri(new Uri(context.SourcePath + relativePath, UriKind.Relative));
|
||||
return context.Package.PartExists(projectUri);
|
||||
|
Reference in New Issue
Block a user