mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
ENHANCEMENT Current search and current page of asset section are persistent. Fixes the open source ticket #4470 and also a part of #4256 (from r84091)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89820 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
31e996a56b
commit
9cd09d53f8
@ -334,7 +334,7 @@ HTML;
|
||||
$message = sprintf(_t('AssetAdmin.MOVEDX','Moved %s files'),$numFiles);
|
||||
|
||||
FormResponse::status_message($message, "good");
|
||||
FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)");
|
||||
FormResponse::add("$('Form_EditForm_Files').refresh();");
|
||||
|
||||
return FormResponse::respond();
|
||||
}
|
||||
|
@ -48,6 +48,26 @@ class AssetTableField extends ComplexTableField {
|
||||
$this->Markable = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the link to this form, including the search pattern
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function CurrentLink() {
|
||||
$link = parent::CurrentLink();
|
||||
|
||||
if(isset($_REQUEST['FileSearch']) ) {
|
||||
if ( strpos($link, '?')!==false )
|
||||
$link .= "&";
|
||||
else
|
||||
$link .= "/?";
|
||||
|
||||
$link .= "FileSearch=".urlencode($_REQUEST['FileSearch']);
|
||||
}
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
function FieldHolder() {
|
||||
$ret = parent::FieldHolder();
|
||||
|
||||
|
@ -74,25 +74,20 @@ FileFilterButton.prototype = {
|
||||
try {
|
||||
var form = Event.findElement(e, 'form');
|
||||
var fieldName = $('FileFieldName').value;
|
||||
var fieldID = form.id + '_' + fieldName;
|
||||
|
||||
var updateURL = form.action + '/field/' + fieldName + '?ajax=1';
|
||||
// build url
|
||||
var updateURL = form.action + '/field/' + fieldName + '?';
|
||||
for(var index = 0; index < this.inputFields.length; index++) {
|
||||
if(this.inputFields[index].tagName) {
|
||||
updateURL += '&' + this.inputFields[index].name + '=' + encodeURIComponent(this.inputFields[index].value);
|
||||
}
|
||||
}
|
||||
|
||||
updateURL += ($('SecurityID') ? '&SecurityID=' + $('SecurityID').value : '');
|
||||
|
||||
new Ajax.Updater(fieldID, updateURL, {
|
||||
onComplete: function() {
|
||||
Behaviour.apply($(fieldID), true);
|
||||
},
|
||||
onFailure: function(response) {
|
||||
errorMessage('Could not filter results: ' + response.responseText );
|
||||
}
|
||||
});
|
||||
// update the field
|
||||
var field = form.getElementsByClassName('AssetTableField')[0];
|
||||
field.setAttribute('href', updateURL);
|
||||
field.refresh();
|
||||
} catch(er) {
|
||||
errorMessage('Error searching');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user