From b2fe474fdec857e34dbc7d4a325e3a443e7b6364 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 21 Oct 2009 04:34:41 +0000 Subject: [PATCH] ENHANCEMENT Return the results of the FilesystemSyncTask to the status message in the CMS instead of a generic success message (from r82618) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89813 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/AssetAdmin.js | 10 ++-------- tasks/FilesystemSyncTask.php | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index 253fc876..0a28abbe 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -333,15 +333,9 @@ FilesystemSyncClass.prototype = { onclick : function() { statusMessage('Looking for new files'); - var options = { - method: 'get', + new Ajax.Request('dev/tasks/FilesystemSyncTask', { onSuccess: function(t) { - eval(t.responseText); - } - }; - new Ajax.Request('dev/tasks/FilesystemSyncTask',{ - onSuccess: function(t) { - statusMessage("I have finished looking for files", "good"); + statusMessage(t.responseText, "good"); }, onFailure: function(t) { errorMessage("There was an error looking for new files"); diff --git a/tasks/FilesystemSyncTask.php b/tasks/FilesystemSyncTask.php index fde17ac2..74e2e483 100644 --- a/tasks/FilesystemSyncTask.php +++ b/tasks/FilesystemSyncTask.php @@ -9,6 +9,6 @@ class FilesystemSyncTask extends BuildTask { SilverStripe, for example, if an author uploads files via FTP."; function run($request) { - Filesystem::sync(); + echo Filesystem::sync(); } } \ No newline at end of file