Last active
September 29, 2023 07:15
-
-
Save KevinJump/af307441296c81c0e6b8b50a2cad2b5b to your computer and use it in GitHub Desktop.
Move Publisher Section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Authorization; | |
using Umbraco.Cms.Core; | |
using Umbraco.Cms.Core.Composing; | |
using Umbraco.Cms.Core.Events; | |
using Umbraco.Cms.Core.Sections; | |
using Umbraco.Cms.Core.Services; | |
using Umbraco.Cms.Core.Trees; | |
using Umbraco.Cms.Web.BackOffice.Trees; | |
using Umbraco.Cms.Web.Common.Attributes; | |
using uSync.Publisher; | |
using uSync.Publisher.Configuration; | |
using uSync.Publisher.Controllers; | |
namespace uSync.SourceSite; | |
public class MovePublisherTreeComposer : IComposer | |
{ | |
public void Compose(IUmbracoBuilder builder) | |
{ | |
builder.Sections().InsertAfter<SettingsSection,MySyncSection>(); | |
builder.Trees()? | |
.RemoveTreeController<PublisherTreeController>(); | |
} | |
} | |
public class MySyncSection : ISection | |
{ | |
public string Alias => "sync"; | |
public string Name => "Synchronisation"; | |
} | |
[Authorize(Policy = PublisherAuthorizationPolcies.PublisherTreeAccess)] | |
[Tree("sync", "uSyncPublisher", TreeGroup = "uSync", TreeTitle = "uSync Publisher", SortOrder = 10)] | |
[PluginController("uSyncPublisher")] | |
public class ReplacementPublisherTreeController : | |
PublisherTreeController | |
{ | |
public ReplacementPublisherTreeController( | |
ILocalizedTextService localizedTextService, | |
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, | |
IEventAggregator eventAggregator, | |
SyncPublishConfigService publishConfigService, | |
IMenuItemCollectionFactory menuItemCollectionFactory) | |
: base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator, publishConfigService, menuItemCollectionFactory) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment