MINOR Using SS_HTTPRequest->isAjax() instead of deprecated RequestHandler API

This commit is contained in:
Ingo Schommer 2012-04-05 14:45:26 +02:00
parent 108ea1d0e6
commit 3341a181c7
4 changed files with 8 additions and 8 deletions

View File

@ -255,7 +255,7 @@ JS
'EditForm' => $this->AddForm()
));
if($this->isAjax()) {
if($request->isAjax()) {
// Rendering is handled by template, which will call EditForm() eventually
$content = $obj->renderWith($this->getTemplatesWithSuffix('_Content'));
} else {

View File

@ -9,7 +9,7 @@ class CMSFileAddController extends LeftAndMain {
// public function upload($request) {
// $formHtml = $this->renderWith(array('AssetAdmin_UploadContent'));
// if($this->isAjax()) {
// if($request->isAjax()) {
// return $formHtml;
// } else {
// return $this->customise(array(

View File

@ -47,7 +47,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
public function init() {
// set reading lang
if(Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) {
if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
}
@ -139,7 +139,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
// Include custom CSS for tree icons inline, as the tree might be loaded
// via Ajax, in which case we can't inject it into the HTML header easily through the HTTP response.
$css = $this->generateTreeStylingCSS();
if($this->isAjax()) {
if($this->request->isAjax()) {
$html .= "<style type=\"text/css\">\n" . $css . "</style>\n";
} else {
Requirements::customCSS($css);

View File

@ -27,7 +27,7 @@ class CMSPageHistoryController extends CMSMain {
function show($request) {
$form = $this->ShowVersionForm($request->param('VersionID'));
if($this->isAjax()) {
if($request->isAjax()) {
if($form) $content = $form->forTemplate();
else $content = $this->renderWith($this->getTemplatesWithSuffix('_Content'));
} else {
@ -44,7 +44,7 @@ class CMSPageHistoryController extends CMSMain {
$request->param('VersionID'),
$request->param('OtherVersionID')
);
if($this->isAjax()) {
if($request->isAjax()) {
$content = $form->forTemplate();
} else {
$content = $this->customise(array('EditForm' => $form))->renderWith($this->getViewer('show'));
@ -258,7 +258,7 @@ class CMSPageHistoryController extends CMSMain {
$form = $this->CompareVersionsForm($version1, $version2);
// javascript solution, render into template
if($this->isAjax()) {
if($this->request->isAjax()) {
return $this->customise(array(
"EditForm" => $form
))->renderWith(array(
@ -293,7 +293,7 @@ class CMSPageHistoryController extends CMSMain {
if(!$versionID) return;
if($this->isAjax()) {
if($request->isAjax()) {
return $this->customise(array(
"EditForm" => $this->ShowVersionForm($versionID)
))->renderWith(array(