- Moving root media folder to the Media folder under Orchard.Web

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4040871
This commit is contained in:
suhacan
2009-11-16 21:09:38 +00:00
parent 6114433e47
commit 2bb2497bca
4 changed files with 7 additions and 9 deletions

View File

@@ -166,6 +166,8 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Media\Images\" />
<Folder Include="Media\Videos\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -106,8 +106,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Media\Images\" />
<Folder Include="Media\Videos\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -27,8 +27,7 @@ namespace Orchard.Media.Services {
public MediaService (
IStorageProvider storageProvider) {
_storageProvider = storageProvider;
//TODO: Module config should decide where is the Media module's root media directory.
_rootPath = HttpContext.Current.Server.MapPath("~/Packages/Orchard.Media/Media");
_rootPath = HttpContext.Current.Server.MapPath("~/Media");
Logger = NullLogger.Instance;
}
@@ -101,7 +100,7 @@ namespace Orchard.Media.Services {
}
public void UploadMediaFile(string folderName, HttpPostedFileBase postedFile) {
string targetFolder = HttpContext.Current.Server.MapPath("~/Packages/Orchard.Media/Media/" + folderName);
string targetFolder = HttpContext.Current.Server.MapPath("~/Media/" + folderName);
if (postedFile.FileName.EndsWith(".zip")) {
UnzipMediaFileArchive(targetFolder, postedFile);
// Don't save the zip file.
@@ -152,8 +151,7 @@ namespace Orchard.Media.Services {
do {
IStorageFolder parentFolder = folder.GetParent();
string parentName = parentFolder.GetName();
if (String.Equals(parentName, "Media", StringComparison.OrdinalIgnoreCase) &&
String.Equals(parentFolder.GetParent().GetName(), "Orchard.Media", StringComparison.OrdinalIgnoreCase)) {
if (String.Equals(parentName, "Media", StringComparison.OrdinalIgnoreCase)) {
break;
}
parentHierarchy.Insert(0, parentName);

View File

@@ -62,7 +62,7 @@
<fieldset>
<ol>
<li>
<img src="<%=ResolveUrl("~/Packages/Orchard.Media/Media/" + Model.RelativePath + "/" + Model.Name)%>" class="previewImage" alt="<%= Model.Caption %>" />
<img src="<%=ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name)%>" class="previewImage" alt="<%= Model.Caption %>" />
</li>
<li>
<strong>Dimensions:</strong> 500 x 375 pixels
@@ -75,7 +75,7 @@
</li>
<li>
<label for="embedPath">Embed:</label>
<input id="embedPath" class="inputText" name="embedPath" type="text" readonly="readonly" value="&lt;img src=&quot;<%=ResolveUrl("~/Packages/Orchard.Media/Media/" + Model.RelativePath + "/" + Model.Name)%>&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;<%= Model.Caption %>&quot; /&gt;" />
<input id="embedPath" class="inputText" name="embedPath" type="text" readonly="readonly" value="&lt;img src=&quot;<%=ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name)%>&quot; width=&quot;500&quot; height=&quot;375&quot; alt=&quot;<%= Model.Caption %>&quot; /&gt;" />
<p class="helperText">Copy this html to add this image to your site.</p>
</li>
</ol>