BUGFIX: FileIFrameField throws sub-URLs error when changing cms to a non default language (#4767)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97984 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2010-02-02 02:54:23 +00:00 committed by Sam Minnee
parent 2294d0986b
commit cce52a59d2

View File

@ -55,12 +55,19 @@ class FileIFrameField extends FileField {
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/ui.core.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/ui.dialog.js');
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
$record = $this->form->getRecord();
if(Object::has_extension('SiteTree', 'Translatable') && $record->Locale){
$iframe = "iframe?locale=".$record->Locale;
}else{
$iframe = "iframe";
}
return $this->createTag (
'iframe',
array (
'name' => $this->Name() . '_iframe',
'src' => Controller::join_links($this->Link(), 'iframe'),
'src' => Controller::join_links($this->Link(), $iframe),
'style' => 'height: 152px; width: 100%; border: none;'
)
) . $this->createTag (