mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Add Orchard Module Gallery Feed by default in Gallery module
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Packaging.Services;
|
||||
|
||||
namespace Orchard.Packaging {
|
||||
[OrchardFeature("Gallery")]
|
||||
public class DefaultPackagingUpdater : IFeatureEventHandler {
|
||||
private readonly IPackagingSourceManager _packagingSourceManager;
|
||||
|
||||
public DefaultPackagingUpdater(IPackagingSourceManager packagingSourceManager) {
|
||||
_packagingSourceManager = packagingSourceManager;
|
||||
}
|
||||
|
||||
public void Install(Feature feature) {
|
||||
// add http://orchardproject.net/feeds/modules as the default Modules Feed
|
||||
_packagingSourceManager.AddSource(new PackagingSource { Id = Guid.NewGuid(), FeedTitle = "Orchard Module Gallery", FeedUrl = "http://orchardproject.net/feeds/modules" });
|
||||
}
|
||||
|
||||
public void Enable(Feature feature) {
|
||||
}
|
||||
|
||||
public void Disable(Feature feature) {
|
||||
}
|
||||
|
||||
public void Uninstall(Feature feature) {
|
||||
}
|
||||
}
|
||||
}
|
@@ -74,6 +74,7 @@
|
||||
<Compile Include="Commands\PackagingCommands.cs" />
|
||||
<Compile Include="Controllers\DownloadStreamResult.cs" />
|
||||
<Compile Include="Controllers\GalleryController.cs" />
|
||||
<Compile Include="DefaultPackagingUpdater.cs" />
|
||||
<Compile Include="Services\AtomExtensions.cs" />
|
||||
<Compile Include="Services\IPackageBuilder.cs" />
|
||||
<Compile Include="Services\IPackageExpander.cs" />
|
||||
|
@@ -98,6 +98,10 @@
|
||||
<Project>{14C049FD-B35B-415A-A824-87F26B26E7FD}</Project>
|
||||
<Name>Orchard.Comments</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Packaging\Orchard.Packaging.csproj">
|
||||
<Project>{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}</Project>
|
||||
<Name>Orchard.Packaging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
|
Reference in New Issue
Block a user