mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX Fixed AssetAdmin->SyncForm() execution by switching from calling dev/tasks/FilesystemSyncTask to doSync()
This commit is contained in:
parent
a99d7b0b1d
commit
a27369978d
@ -30,7 +30,6 @@ class AssetAdmin extends LeftAndMain {
|
||||
'movemarked',
|
||||
'removefile',
|
||||
'savefile',
|
||||
'sync',
|
||||
'uploadiframe',
|
||||
'UploadForm',
|
||||
'deleteUnusedThumbnails' => 'ADMIN',
|
||||
@ -399,12 +398,15 @@ HTML;
|
||||
);
|
||||
$form->addExtraClass('actionparams');
|
||||
$form->setFormMethod('GET');
|
||||
$form->setFormAction('dev/tasks/FilesystemSyncTask');
|
||||
$btn->describe(_t('AssetAdmin_left.ss.FILESYSTEMSYNC_DESC', 'SilverStripe maintains its own database of the files & images stored in your assets/ folder. Click this button to update that database, if files are added to the assets/ folder from outside SilverStripe, for example, if you have uploaded files via FTP.'));
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
function doSync($data, $form) {
|
||||
return Filesystem::sync();
|
||||
}
|
||||
|
||||
/**
|
||||
* #################################
|
||||
* Garbage collection.
|
||||
|
@ -2,23 +2,6 @@
|
||||
* File: AssetAdmin.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration for the left hand tree
|
||||
*/
|
||||
if(typeof SiteTreeHandlers == 'undefined') SiteTreeHandlers = {};
|
||||
SiteTreeHandlers.parentChanged_url = 'admin/assets/ajaxupdateparent';
|
||||
SiteTreeHandlers.orderChanged_url = 'admin/assets/ajaxupdatesort';
|
||||
SiteTreeHandlers.loadPage_url = 'admin/assets/getitem';
|
||||
SiteTreeHandlers.loadTree_url = 'admin/assets/getsubtree';
|
||||
SiteTreeHandlers.showRecord_url = 'admin/assets/show/';
|
||||
SiteTreeHandlers.controller_url = 'admin/assets';
|
||||
|
||||
var _HANDLER_FORMS = {
|
||||
addpage : 'Form_AddForm',
|
||||
deletepage : 'Form_DeleteItemsForm',
|
||||
sortitems : 'sortitems_options'
|
||||
};
|
||||
|
||||
(function($) {
|
||||
/**
|
||||
* Delete selected folders through "batch actions" tab.
|
||||
@ -55,9 +38,10 @@ var _HANDLER_FORMS = {
|
||||
onsubmit: function(e) {
|
||||
var button = jQuery(this).find(':submit:first');
|
||||
button.addClass('loading');
|
||||
$.get(
|
||||
jQuery(this).attr('action'),
|
||||
function() {
|
||||
$.ajax({
|
||||
url: jQuery(this).attr('action'),
|
||||
data: this.serializeArray(),
|
||||
success: function() {
|
||||
button.removeClass('loading');
|
||||
// reload current form and tree
|
||||
var currNode = $('#sitetree')[0].firstSelected();
|
||||
@ -70,7 +54,7 @@ var _HANDLER_FORMS = {
|
||||
// TODO Reset current tree node
|
||||
}});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user