mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Added HTTPResponse object, to encapsulate Controller responses for aid testing and other 'quirky' uses of Controllers
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@40390 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
56a65ab20d
commit
1c2f30978a
@ -21,7 +21,7 @@ abstract class LeftAndMain extends Controller {
|
||||
$menu = $this->MainMenu();
|
||||
if(($first = $menu->First()) && $first->Link) {
|
||||
Director::redirect($first->Link);
|
||||
exit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ abstract class LeftAndMain extends Controller {
|
||||
);
|
||||
|
||||
Security::permissionFailure($this, $messageSet);
|
||||
exit;
|
||||
return;
|
||||
}
|
||||
|
||||
Requirements::javascript("jsparty/prototype.js");
|
||||
|
@ -16,7 +16,6 @@ class StaticExporter extends Controller {
|
||||
);
|
||||
|
||||
Security::permissionFailure($this, $messageSet);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +66,9 @@ class StaticExporter extends Controller {
|
||||
$controllerClass = "{$page->class}_Controller";
|
||||
if(class_exists($controllerClass)) {
|
||||
$controller = new $controllerClass($page);
|
||||
$pageContent = $controller->run( array() );
|
||||
|
||||
$response = $controller->run( array() );
|
||||
$pageContent = $response->getBody();
|
||||
|
||||
// Write to file
|
||||
if($fh = fopen($contentfile, 'w')) {
|
||||
|
@ -148,9 +148,8 @@ class PageCommentInterface_Controller extends ContentController {
|
||||
}
|
||||
|
||||
function newspamquestion() {
|
||||
if(Director::is_ajax()) {
|
||||
if(Director::is_ajax()) {
|
||||
echo Convert::raw2xml("Spam protection question: ".MathSpamProtection::getMathQuestion());
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user