mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
ENHANCEMENT SSF-124 finished ajax version of admin/pages/listchildren/ID in Pages admin
This commit is contained in:
parent
9888f980aa
commit
4a36b1e490
@ -45,6 +45,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
'batchactions',
|
||||
'ListView',
|
||||
'getListView',
|
||||
'listchildren',
|
||||
);
|
||||
|
||||
public function init() {
|
||||
@ -561,7 +562,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
}
|
||||
if(count($ids)) $list->where('"'.$this->stat('tree_class').'"."ID" IN ('.implode(",", $ids).')');
|
||||
}else{
|
||||
$list->filter("ParentID", 0);
|
||||
$parentID = 0;
|
||||
if($this->urlParams['Action'] == 'listchildren' && $this->urlParams['ID']){
|
||||
$parentID = $this->urlParams['ID'];
|
||||
}
|
||||
$list->filter("ParentID", $parentID);
|
||||
}
|
||||
|
||||
return $list;
|
||||
@ -636,9 +641,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
|
||||
public function listchildren(){
|
||||
if(Director::is_ajax()){
|
||||
return $this;
|
||||
return $this->getListViewHTML();
|
||||
}else{
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,6 +111,23 @@
|
||||
errorMessage(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
replace: function(url){
|
||||
if(window.History.enabled) {
|
||||
var container = $('.cms-container')
|
||||
container.loadPanel(url, '', {selector: '.cms-list'});
|
||||
} else {
|
||||
window.location = $.path.makeUrlAbsolute(url, $('base').attr('href'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.cms-list .list-children-link').entwine({
|
||||
onclick: function(e) {
|
||||
this.closest('.cms-list').replace(this.attr('href'));
|
||||
e.preventDefault();
|
||||
return false;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user