From 3341a181c74580f917e2f7fe1c035f58785ae153 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 5 Apr 2012 14:45:26 +0200 Subject: [PATCH] MINOR Using SS_HTTPRequest->isAjax() instead of deprecated RequestHandler API --- code/controllers/AssetAdmin.php | 2 +- code/controllers/CMSFileAddController.php | 2 +- code/controllers/CMSMain.php | 4 ++-- code/controllers/CMSPageHistoryController.php | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/controllers/AssetAdmin.php b/code/controllers/AssetAdmin.php index 64ab3c23..6cc34ac7 100644 --- a/code/controllers/AssetAdmin.php +++ b/code/controllers/AssetAdmin.php @@ -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 { diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index 5c2cb143..4d4a6e58 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -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( diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index f6faa93a..0282350c 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -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 .= "\n"; } else { Requirements::customCSS($css); diff --git a/code/controllers/CMSPageHistoryController.php b/code/controllers/CMSPageHistoryController.php index e1306a54..25ad3e9f 100644 --- a/code/controllers/CMSPageHistoryController.php +++ b/code/controllers/CMSPageHistoryController.php @@ -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(