mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
ENHANCEMENT Setting $this->request in ModelAdmin_RecordController->edit() instead of returning new response, so it can be altered by subclasses
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@114144 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c579822340
commit
65b3b145f1
@ -913,14 +913,15 @@ class ModelAdmin_RecordController extends Controller {
|
|||||||
function edit($request) {
|
function edit($request) {
|
||||||
if ($this->currentRecord) {
|
if ($this->currentRecord) {
|
||||||
if($this->isAjax()) {
|
if($this->isAjax()) {
|
||||||
return new SS_HTTPResponse(
|
$this->response->setBody($this->EditForm()->formHtmlContent());
|
||||||
$this->EditForm()->formHtmlContent(),
|
$this->response->setStatusCode(
|
||||||
200,
|
200,
|
||||||
sprintf(
|
sprintf(
|
||||||
_t('ModelAdmin.LOADEDFOREDITING', "Loaded '%s' for editing."),
|
_t('ModelAdmin.LOADEDFOREDITING', "Loaded '%s' for editing."),
|
||||||
$this->currentRecord->Title
|
$this->currentRecord->Title
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
return $this->response;
|
||||||
} else {
|
} else {
|
||||||
// This is really quite ugly; to fix will require a change in the way that customise() works. :-(
|
// This is really quite ugly; to fix will require a change in the way that customise() works. :-(
|
||||||
return $this->parentController->parentController->customise(array(
|
return $this->parentController->parentController->customise(array(
|
||||||
@ -928,7 +929,6 @@ class ModelAdmin_RecordController extends Controller {
|
|||||||
'EditForm' => $this->EditForm()
|
'EditForm' => $this->EditForm()
|
||||||
))->renderWith(array("{$this->class}_right",'LeftAndMain_right'))
|
))->renderWith(array("{$this->class}_right",'LeftAndMain_right'))
|
||||||
))->renderWith(array('ModelAdmin','LeftAndMain'));
|
))->renderWith(array('ModelAdmin','LeftAndMain'));
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return _t('ModelAdmin.ITEMNOTFOUND', "I can't find that item");
|
return _t('ModelAdmin.ITEMNOTFOUND', "I can't find that item");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user