setBody(self::$non_ajax_content); } else if(isset($_REQUEST['forceajax']) || Director::is_ajax()) { $response->addHeader('Content-Type', 'text/javascript'); $response->setBody(self::get_javascript()); } elseif(!empty(self::$non_ajax_content)) { $response->setBody(self::$non_ajax_content); } elseif(!empty(self::$redirect_url)) { Director::redirect(self::$redirect_url); return null; } elseif(!Director::redirected_to()) { Director::redirectBack(); return null; } else { return null; } return $response; } /** * Caution: Works only for forms which inherit methods from LeftAndMain.js */ static function load_form($content, $id = 'Form_EditForm') { // make sure form-tags are stripped // loadNewPage() uses innerHTML to replace the form, which makes IE cry when replacing an element with itself $content = preg_replace(array('/