mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX #5099 FileIFrameField fails when using it with a locale different to the default
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100747 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
55eda363f4
commit
2b69344d39
@ -63,6 +63,7 @@ class FileIFrameField extends FileField {
|
|||||||
}else{
|
}else{
|
||||||
$iframe = "iframe";
|
$iframe = "iframe";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->createTag (
|
return $this->createTag (
|
||||||
'iframe',
|
'iframe',
|
||||||
array (
|
array (
|
||||||
@ -136,14 +137,21 @@ class FileIFrameField extends FileField {
|
|||||||
|
|
||||||
$fileSources["existing//$selectFile"] = new TreeDropdownField('ExistingFile', '', 'File');
|
$fileSources["existing//$selectFile"] = new TreeDropdownField('ExistingFile', '', 'File');
|
||||||
|
|
||||||
|
$fields = new FieldSet (
|
||||||
|
new HeaderField('EditFileHeader', $title),
|
||||||
|
new SelectionGroup('FileSource', $fileSources)
|
||||||
|
);
|
||||||
|
|
||||||
|
// locale needs to be passed through from the iframe source
|
||||||
|
if(isset($_GET['locale'])) {
|
||||||
|
$fields->push(new HiddenField('locale', '', $_GET['locale']));
|
||||||
|
}
|
||||||
|
|
||||||
return new Form (
|
return new Form (
|
||||||
$this,
|
$this,
|
||||||
'EditFileForm',
|
'EditFileForm',
|
||||||
new FieldSet (
|
$fields,
|
||||||
new HeaderField('EditFileHeader', $title),
|
new FieldSet(
|
||||||
new SelectionGroup('FileSource', $fileSources)
|
|
||||||
),
|
|
||||||
new FieldSet (
|
|
||||||
new FormAction('save', $title)
|
new FormAction('save', $title)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user