Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…dler API
  • Loading branch information...
commit 3341a181c74580f917e2f7fe1c035f58785ae153 1 parent 108ea1d
@chillu chillu authored
View
2  code/controllers/AssetAdmin.php
@@ -255,7 +255,7 @@ public function addfolder($request) {
'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
2  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(
View
4 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 @@ public function SiteTreeAsUL() {
// 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
8 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 @@ function compare($request) {
$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 @@ function doCompare($data, $form) {
$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 @@ function doShowVersion($data, $form) {
if(!$versionID) return;
- if($this->isAjax()) {
+ if($request->isAjax()) {
return $this->customise(array(
"EditForm" => $this->ShowVersionForm($versionID)
))->renderWith(array(
Please sign in to comment.
Something went wrong with that request. Please try again.