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:
Sam Minnee 2007-08-17 03:09:46 +00:00
parent 56a65ab20d
commit 1c2f30978a
3 changed files with 6 additions and 6 deletions

View File

@ -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");

View File

@ -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')) {

View File

@ -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;
}
}
}