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

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102562 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 01:46:39 +00:00
parent 1997485ba3
commit d4d3d63e99

View File

@ -55,12 +55,19 @@ class FileIFrameField extends FileField {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/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 (