mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
FIX URL concat in tree actions (broke with 'translatable' module)
This commit is contained in:
parent
a196933e05
commit
7ecf56490a
@ -98,8 +98,12 @@
|
||||
if(state) parentId = parseInt(JSON.parse(state).ParentID, 10);
|
||||
}
|
||||
|
||||
var data = {selector: this.data('targetPanel'),pjax: this.data('pjax')},
|
||||
url = parentId ? ss.i18n.sprintf(this.data('urlAddpage'), parentId) : this.attr('href');
|
||||
var data = {selector: this.data('targetPanel'),pjax: this.data('pjax')}, url;
|
||||
if(parentID) {
|
||||
url = $.path.addSearchParams(ss.i18n.sprintf(this.data('urlAddpage'), parentId), this.data('extraParams'));
|
||||
} else {
|
||||
url = this.attr('href');
|
||||
}
|
||||
|
||||
$('.cms-container').loadPanel(url, null, data);
|
||||
e.preventDefault();
|
||||
|
@ -60,9 +60,12 @@
|
||||
'label': '<span class="jstree-pageicon"></span>' + klassData.title,
|
||||
'_class': 'class-' + klass,
|
||||
'action': function(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
||||
self.data('urlAddpage'), id, klass
|
||||
));
|
||||
$('.cms-container').entwine('.ss').loadPanel(
|
||||
$.path.addSearchParams(
|
||||
ss.i18n.sprintf(self.data('urlAddpage'), id, klass),
|
||||
self.data('extraParams')
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
});
|
||||
@ -80,16 +83,22 @@
|
||||
{
|
||||
'label': ss.i18n._t('Tree.ThisPageOnly'),
|
||||
'action': function(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
||||
self.data('urlDuplicate'), obj.data('id')
|
||||
));
|
||||
$('.cms-container').entwine('.ss').loadPanel(
|
||||
$.path.addSearchParams(
|
||||
ss.i18n.sprintf(self.data('urlDuplicate'), obj.data('id')),
|
||||
self.data('extraParams')
|
||||
)
|
||||
);
|
||||
}
|
||||
},{
|
||||
'label': ss.i18n._t('Tree.ThisPageAndSubpages'),
|
||||
'action': function(obj) {
|
||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
||||
self.data('urlDuplicatewithchildren'), obj.data('id')
|
||||
));
|
||||
$('.cms-container').entwine('.ss').loadPanel(
|
||||
$.path.addSearchParams(
|
||||
ss.i18n.sprintf(self.data('urlDuplicatewithchildren'), obj.data('id')),
|
||||
self.data('extraParams')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -19,7 +19,7 @@ $ExtraTreeTools
|
||||
</div>
|
||||
<% end_if %>
|
||||
|
||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&ParentID=%s&PageType=%s&SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-url-duplicate="{$Link('duplicate/%s')}?SecurityID=$SecurityID" data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s')}?SecurityID=$SecurityID" data-url-listview="{$Link('?view=list')}" data-hints="$SiteTreeHints.XML">
|
||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&ParentID=%s&PageType=%s" data-url-editpage="$LinkPageEdit('%s')" data-url-duplicate="{$Link('duplicate/%s')}" data-url-duplicatewithchildren="{$Link('duplicatewithchildren/%s')}" data-url-listview="{$Link('?view=list')}" data-hints="$SiteTreeHints.XML" data-extra-params="SecurityID=$SecurityID">
|
||||
$SiteTreeAsUL
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user