mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Simplified ajax/non-ajax responses in CMS. Browsers handle 3xx Ajax responses transparently, so a CMS redirect (and some smartness in the JS state handling) is enough, no conditionals required.
This commit is contained in:
parent
a097266ded
commit
3248da02ce
@ -407,9 +407,7 @@ JS
|
||||
mkdir($record->FullPath);
|
||||
chmod($record->FullPath, Filesystem::$file_create_mask);
|
||||
|
||||
$link = Controller::join_links($this->Link('show'), $parentRecord->ID);
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $link);
|
||||
return $this->redirect($link);
|
||||
return $this->redirect(Controller::join_links($this->Link('show'), $parentRecord->ID));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -126,14 +126,7 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
$editController = singleton('CMSPageEditController');
|
||||
$editController->setCurrentPageID($record->ID);
|
||||
|
||||
$link = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID);
|
||||
$this->getResponse()->addHeader('X-ControllerURL', $link);
|
||||
|
||||
if(Director::is_ajax()) {
|
||||
return $editController->renderWith(array_pop($editController->getTemplatesWithSuffix('_Content')));
|
||||
} else {
|
||||
return $this->redirect($link);
|
||||
}
|
||||
return $this->redirect(Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user