mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
35 lines
841 B
JavaScript
35 lines
841 B
JavaScript
(function($) {
|
|
|
|
$.entwine('ss', function($){
|
|
|
|
$('.cms-tree').entwine({
|
|
getTreeConfig: function() {
|
|
var config = this._super();
|
|
config.plugins.push('contextmenu');
|
|
config.contextmenu = {
|
|
'items': {
|
|
'create': null,
|
|
"rename": null,
|
|
"remove": null,
|
|
"ccp": null,
|
|
'edit': {
|
|
'label': ss.i18n._t('Tree.EditPage'),
|
|
'action': function(obj) {
|
|
// TODO Fix hardcoding of link
|
|
$('.cms-container').loadPanel('admin/page/edit/show/' + obj.data('id'));
|
|
}
|
|
},
|
|
'addsubpage': {
|
|
'label': ss.i18n._t('Tree.AddSubPage'),
|
|
'action': function(obj) {
|
|
// TODO Fix hardcoding of link
|
|
$('.cms-container').loadPanel('admin/page/add/?ParentID=' + obj.data('id'));
|
|
}
|
|
}
|
|
}
|
|
};
|
|
return config;
|
|
}
|
|
});
|
|
});
|
|
}(jQuery)); |