mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
When page is disabled, rename "Edit" label in contextmenu and hide duplicate options
This commit is contained in:
parent
bf511939f4
commit
49e5cd54fa
@ -41,6 +41,7 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
"Tree.AddSubPage": "Add new page here",
|
||||
"Tree.Duplicate": "Duplicate",
|
||||
"Tree.EditPage": "Edit",
|
||||
"Tree.ViewPage": "View",
|
||||
"Tree.ShowAsList": "Show children as list",
|
||||
"Tree.ThisPageAndSubpages": "This page and subpages",
|
||||
"Tree.ThisPageOnly": "This page only",
|
||||
|
@ -41,8 +41,10 @@ $.entwine('ss.tree', function($){
|
||||
'items': function(node) {
|
||||
|
||||
var menuitems = {
|
||||
'edit': {
|
||||
'label': i18n._t('Tree.EditPage', 'Edit page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree'),
|
||||
edit: {
|
||||
'label': (node.hasClass('edit-disabled')) ?
|
||||
i18n._t('Tree.EditPage', 'Edit page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree')
|
||||
: i18n._t('Tree.ViewPage', 'View page', 100, 'Used in the context menu when right-clicking on a page node in the CMS tree'),
|
||||
'action': function(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(i18n.sprintf(
|
||||
self.data('urlEditpage'), obj.data('id')
|
||||
@ -97,6 +99,7 @@ $.entwine('ss.tree', function($){
|
||||
};
|
||||
}
|
||||
|
||||
if (!node.hasClass('edit-disabled')) {
|
||||
menuitems['duplicate'] = {
|
||||
'label': i18n._t('Tree.Duplicate'),
|
||||
'submenu': [
|
||||
@ -123,6 +126,7 @@ $.entwine('ss.tree', function($){
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
return menuitems;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user