mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Improved export file name generation.
This commit is contained in:
@@ -92,11 +92,18 @@ namespace Orchard.ImportExport.Providers.ExportActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private string GetExportFileName(Recipe recipe) {
|
private string GetExportFileName(Recipe recipe) {
|
||||||
return String.IsNullOrWhiteSpace(recipe.Name)
|
string format;
|
||||||
? "export.xml"
|
|
||||||
: String.Format(recipe.IsSetupRecipe
|
if (String.IsNullOrWhiteSpace(recipe.Name) && String.IsNullOrWhiteSpace(recipe.Version))
|
||||||
? "{0}.recipe.xml"
|
format = "export.xml";
|
||||||
: "{0}.export.xml", recipe.Name.HtmlClassify());
|
else if (String.IsNullOrWhiteSpace(recipe.Version))
|
||||||
|
format = "{0}.recipe.xml";
|
||||||
|
else if (String.IsNullOrWhiteSpace(recipe.Name))
|
||||||
|
format = "export-{1}.recipe.xml";
|
||||||
|
else
|
||||||
|
format = "{0}-{1}.recipe.xml";
|
||||||
|
|
||||||
|
return String.Format(format, recipe.Name.HtmlClassify(), recipe.Version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user