Skip to content

Commit

Permalink
MINOR Using SS_HTTPRequest->isAjax() instead of deprecated RequestHan…
Browse files Browse the repository at this point in the history
…dler API
  • Loading branch information
chillu committed Apr 5, 2012
1 parent 108ea1d commit 3341a18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion code/controllers/AssetAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/CMSFileAddController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/CMSMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
}

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions code/controllers/CMSPageHistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'));
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 3341a18

Please sign in to comment.