BUGFIX #5023 AssetAdmin::sync() is now used to sync tasks, as it works when the user only has access to the AssetAdmin controller instead of going to dev/tasks/FilesystemSyncTask which can only be run by administrators or if the site is in dev mode

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@100335 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-03-02 02:35:55 +00:00 committed by Sam Minnee
parent 681eff9eda
commit b810f0ecbc
2 changed files with 6 additions and 1 deletions

View File

@ -35,6 +35,7 @@ class AssetAdmin extends LeftAndMain {
'removefile',
'save',
'savefile',
'sync',
'uploadiframe',
'UploadForm',
'deleteUnusedThumbnails' => 'ADMIN'
@ -481,6 +482,10 @@ HTML;
JS;
}
public function sync() {
echo Filesystem::sync();
}
/**
* Return the entire site tree as a nested UL.
* @return string HTML for site tree

View File

@ -342,7 +342,7 @@ FilesystemSyncClass.prototype = {
onclick : function() {
statusMessage('Looking for new files');
new Ajax.Request('dev/tasks/FilesystemSyncTask', {
new Ajax.Request('admin/assets/sync', {
onSuccess: function(t) {
statusMessage(t.responseText, "good");
},