Skip to content
This repository
Browse code

MINOR Using SS_HTTPRequest->isAjax() instead of deprecated RequestHan…

…dler API
  • Loading branch information...
commit 3341a181c74580f917e2f7fe1c035f58785ae153 1 parent 108ea1d
Ingo Schommer authored April 05, 2012
2  code/controllers/AssetAdmin.php
@@ -255,7 +255,7 @@ public function addfolder($request) {
255 255
 			'EditForm' => $this->AddForm()
256 256
 		));
257 257
 
258  
-		if($this->isAjax()) {
  258
+		if($request->isAjax()) {
259 259
 			// Rendering is handled by template, which will call EditForm() eventually
260 260
 			$content = $obj->renderWith($this->getTemplatesWithSuffix('_Content'));
261 261
 		} else {
2  code/controllers/CMSFileAddController.php
@@ -9,7 +9,7 @@ class CMSFileAddController extends LeftAndMain {
9 9
 	
10 10
 //	public function upload($request) {
11 11
 //		$formHtml = $this->renderWith(array('AssetAdmin_UploadContent'));
12  
-//		if($this->isAjax()) {
  12
+//		if($request->isAjax()) {
13 13
 //			return $formHtml;
14 14
 //		} else {
15 15
 //			return $this->customise(array(
4  code/controllers/CMSMain.php
@@ -47,7 +47,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
47 47
 	
48 48
 	public function init() {
49 49
 		// set reading lang
50  
-		if(Object::has_extension('SiteTree', 'Translatable') && !$this->isAjax()) {
  50
+		if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
51 51
 			Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
52 52
 		}
53 53
 		
@@ -139,7 +139,7 @@ public function SiteTreeAsUL() {
139 139
 		// Include custom CSS for tree icons inline, as the tree might be loaded
140 140
 		// via Ajax, in which case we can't inject it into the HTML header easily through the HTTP response.
141 141
 		$css = $this->generateTreeStylingCSS();
142  
-		if($this->isAjax()) {
  142
+		if($this->request->isAjax()) {
143 143
 			$html .= "<style type=\"text/css\">\n" . $css . "</style>\n";				
144 144
 		} else {
145 145
 			Requirements::customCSS($css);
8  code/controllers/CMSPageHistoryController.php
@@ -27,7 +27,7 @@ class CMSPageHistoryController extends CMSMain {
27 27
 	function show($request) {
28 28
 		$form = $this->ShowVersionForm($request->param('VersionID'));
29 29
 		
30  
-		if($this->isAjax()) {
  30
+		if($request->isAjax()) {
31 31
 			if($form) $content = $form->forTemplate();
32 32
 			else $content = $this->renderWith($this->getTemplatesWithSuffix('_Content'));
33 33
 		} else {
@@ -44,7 +44,7 @@ function compare($request) {
44 44
 			$request->param('VersionID'), 
45 45
 			$request->param('OtherVersionID')
46 46
 		);
47  
-		if($this->isAjax()) {
  47
+		if($request->isAjax()) {
48 48
 			$content = $form->forTemplate();
49 49
 		} else {
50 50
 			$content = $this->customise(array('EditForm' => $form))->renderWith($this->getViewer('show'));
@@ -258,7 +258,7 @@ function doCompare($data, $form) {
258 258
 		$form = $this->CompareVersionsForm($version1, $version2);
259 259
 
260 260
 		// javascript solution, render into template
261  
-		if($this->isAjax()) {
  261
+		if($this->request->isAjax()) {
262 262
 			return $this->customise(array(
263 263
 				"EditForm" => $form
264 264
 			))->renderWith(array(
@@ -293,7 +293,7 @@ function doShowVersion($data, $form) {
293 293
 		
294 294
 		if(!$versionID) return;
295 295
 		
296  
-		if($this->isAjax()) {
  296
+		if($request->isAjax()) {
297 297
 			return $this->customise(array(
298 298
 				"EditForm" => $this->ShowVersionForm($versionID)
299 299
 			))->renderWith(array(

0 notes on commit 3341a18

Please sign in to comment.
Something went wrong with that request. Please try again.