ENHANCEMENT Added error messages to flash uploader panel, to be consistent with the image uploader one

BUGFIX Fixed flash uploader not searching for the correct files, due to changes in r65820


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@65827 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-11-13 05:32:15 +00:00 committed by Sam Minnee
parent 75df34d78e
commit 33467b2011
2 changed files with 11 additions and 2 deletions

View File

@ -119,7 +119,7 @@ class ThumbnailStripField extends FormField {
$flashObjects = DataObject::get('File', $whereSQL);
} else {
if($searchText) {
$flashObjects = DataObject::get('File', "Filename LIKE '%$searchText%'");
$flashObjects = DataObject::get('File', "Filename LIKE '%$searchText%' AND Filename LIKE '%.swf'");
}
}
@ -137,6 +137,12 @@ class ThumbnailStripField extends FormField {
HTML;
}
$result .= '</ul>';
} else {
if($folder) {
$result = '<h2>' . _t('ThumbnailStripField.NOFOLDERFLASHFOUND', 'No flash files found in') . ' ' . $folder->Title . '</h2>';
} else {
$result = '<h2>' . _t('ThumbnailStripField.NOFLASHFOUND', 'No flash files found') . '</h2>';
}
}
return $result;

View File

@ -25,7 +25,9 @@ ThumbnailStripField.prototype = {
parentField.observeMethod('Change', this.ajaxGetFiles.bind(this));
}
var searchField = $$('#' + this.updateMethod + 'Search input')[0];
console.debug(parentField);
var searchField = $$('#' + this.updateMethod + 'Search input')[0];
var timeout = undefined;
if(searchField) {
@ -35,6 +37,7 @@ ThumbnailStripField.prototype = {
timeout = setTimeout(function() {
var searchText = searchField.value;
$('Flash').ajaxGetFiles(null, searchText);
$('Image').ajaxGetFiles(null, searchText);
}, 500);
});