mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -75,8 +75,6 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
updater.TryUpdateModel(model, Prefix, null, null);
|
||||
part.Title = model.Title;
|
||||
part.Slug = model.Slug;
|
||||
|
||||
// TEMP: path format patterns replaces this logic
|
||||
part.Path = part.GetPathFromSlug(model.Slug);
|
||||
|
||||
if (!_routableService.IsSlugValid(part.Slug)) {
|
||||
@@ -89,6 +87,9 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
originalSlug, part.Slug, part.ContentItem.ContentType));
|
||||
}
|
||||
|
||||
// TEMP: path format patterns replaces this logic
|
||||
part.Path = part.GetPathFromSlug(part.Slug);
|
||||
|
||||
if (part.ContentItem.Id != 0 && model.PromoteToHomePage && _routableHomePageProvider != null) {
|
||||
CurrentSite.HomePage = _routableHomePageProvider.GetSettingValue(part.ContentItem.Id);
|
||||
}
|
||||
|
@@ -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" />
|
||||
|
@@ -109,7 +109,6 @@ namespace Orchard.Tags.Controllers {
|
||||
|
||||
}
|
||||
catch (Exception exception) {
|
||||
_notifier.Error(T("Retrieving tagged items failed: " + exception.Message));
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
|
@@ -32,11 +32,19 @@ namespace Orchard.Tags.Handlers {
|
||||
tagsContentItemsRepository.Flush();
|
||||
|
||||
TagsPart tagsPart = context.ContentItem.As<TagsPart>();
|
||||
|
||||
// delete orphan tags (for each tag, if there is no other contentItem than the one being deleted, it's an orphan)
|
||||
foreach ( var tag in tagsPart.CurrentTags ) {
|
||||
if (!tagsContentItemsRepository.Fetch(x => x.ContentItemId == context.ContentItem.Id).Any()) {
|
||||
if ( tagsContentItemsRepository.Fetch(x => x.ContentItemId != context.ContentItem.Id).Count() == 0 ) {
|
||||
tagsRepository.Delete(tag);
|
||||
}
|
||||
}
|
||||
|
||||
// delete tag links with this contentItem (tagsContentItems)
|
||||
foreach ( var tagsContentItem in tagsContentItemsRepository.Fetch(x => x.ContentItemId == context.ContentItem.Id) ) {
|
||||
tagsContentItemsRepository.Delete(tagsContentItem);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -15,13 +15,13 @@ using PackageIndexReferenceImplementation.Services;
|
||||
|
||||
namespace PackageIndexReferenceImplementation.Controllers {
|
||||
[HandleError]
|
||||
public class AtomController : Controller {
|
||||
public class ModulesController : Controller {
|
||||
private readonly FeedStorage _feedStorage;
|
||||
private readonly MediaStorage _mediaStorage;
|
||||
|
||||
public IMembershipService MembershipService { get; set; }
|
||||
|
||||
public AtomController() {
|
||||
public ModulesController() {
|
||||
_feedStorage = new FeedStorage();
|
||||
_mediaStorage = new MediaStorage();
|
||||
if ( MembershipService == null ) { MembershipService = new AccountMembershipService(); }
|
@@ -72,7 +72,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controllers\AccountController.cs" />
|
||||
<Compile Include="Controllers\AtomController.cs" />
|
||||
<Compile Include="Controllers\ModulesController.cs" />
|
||||
<Compile Include="Controllers\Artifacts\AtomFeedResult.cs" />
|
||||
<Compile Include="Controllers\Artifacts\AtomItemResult.cs" />
|
||||
<Compile Include="Controllers\Artifacts\ContentTypeAttribute.cs" />
|
||||
|
Reference in New Issue
Block a user