Skip to content

Instantly share code, notes, and snippets.

@KevinJump
Created February 3, 2017 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinJump/9b5d3e589c83aa9a5659bb050ff6d154 to your computer and use it in GitHub Desktop.
Save KevinJump/9b5d3e589c83aa9a5659bb050ff6d154 to your computer and use it in GitHub Desktop.
private void ContentTreeController_MenuRendering(TreeControllerBase sender, MenuRenderingEventArgs e)
{
var translationMenu = e.Menu.Items.Where(x => x.Alias == "sendToTranslate").FirstOrDefault();
if (translationMenu != null)
e.Menu.Items.Remove(translationMenu);
if (sender.TreeAlias == "content")
{
var item = sender.ApplicationContext.Services.ContentService.GetById(int.Parse(e.NodeId));
if (item != null && _translationItemService.IsInMaster(item) && !_translationItemService.HasRelations(item))
{
var cloneItem = new MenuItem("langClone", "Clone to language sites");
cloneItem.Icon = "split-alt";
cloneItem.SeperatorBefore = true;
cloneItem.AdditionalData.Add("actionView", "/app_plugins/TranslationsPlus/dialogs/clone.html");
// e.Menu.Items.Add(cloneItem);
e.Menu.Items.Insert(e.Menu.Items.Count - 1, cloneItem);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment