Ability to create and install packages of simple themes.

--HG--
branch : dev
This commit is contained in:
Dave Reed
2010-10-04 14:52:46 -07:00
parent ce208c44f2
commit 14101b1843
6 changed files with 90 additions and 4 deletions

View File

@@ -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);