mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00: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);
|
if(state) parentId = parseInt(JSON.parse(state).ParentID, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = {selector: this.data('targetPanel'),pjax: this.data('pjax')},
|
var data = {selector: this.data('targetPanel'),pjax: this.data('pjax')}, url;
|
||||||
url = parentId ? ss.i18n.sprintf(this.data('urlAddpage'), parentId) : this.attr('href');
|
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);
|
$('.cms-container').loadPanel(url, null, data);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -60,9 +60,12 @@
|
|||||||
'label': '<span class="jstree-pageicon"></span>' + klassData.title,
|
'label': '<span class="jstree-pageicon"></span>' + klassData.title,
|
||||||
'_class': 'class-' + klass,
|
'_class': 'class-' + klass,
|
||||||
'action': function(obj) {
|
'action': function(obj) {
|
||||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
$('.cms-container').entwine('.ss').loadPanel(
|
||||||
self.data('urlAddpage'), id, klass
|
$.path.addSearchParams(
|
||||||
));
|
ss.i18n.sprintf(self.data('urlAddpage'), id, klass),
|
||||||
|
self.data('extraParams')
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -80,16 +83,22 @@
|
|||||||
{
|
{
|
||||||
'label': ss.i18n._t('Tree.ThisPageOnly'),
|
'label': ss.i18n._t('Tree.ThisPageOnly'),
|
||||||
'action': function(obj) {
|
'action': function(obj) {
|
||||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
$('.cms-container').entwine('.ss').loadPanel(
|
||||||
self.data('urlDuplicate'), obj.data('id')
|
$.path.addSearchParams(
|
||||||
));
|
ss.i18n.sprintf(self.data('urlDuplicate'), obj.data('id')),
|
||||||
|
self.data('extraParams')
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
'label': ss.i18n._t('Tree.ThisPageAndSubpages'),
|
'label': ss.i18n._t('Tree.ThisPageAndSubpages'),
|
||||||
'action': function(obj) {
|
'action': function(obj) {
|
||||||
$('.cms-container').entwine('.ss').loadPanel(ss.i18n.sprintf(
|
$('.cms-container').entwine('.ss').loadPanel(
|
||||||
self.data('urlDuplicatewithchildren'), obj.data('id')
|
$.path.addSearchParams(
|
||||||
));
|
ss.i18n.sprintf(self.data('urlDuplicatewithchildren'), obj.data('id')),
|
||||||
|
self.data('extraParams')
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -19,7 +19,7 @@ $ExtraTreeTools
|
|||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% 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
|
$SiteTreeAsUL
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user