BUGFIX Moving FileIFrameField javascript requirements from __construct() into Field() - otherwise they will be cleared when used in a javascript popup

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77094 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-18 20:55:48 +00:00
parent 2dd58c8a66
commit eeef1f6885

View File

@ -17,23 +17,15 @@ class FileIFrameField extends FileField {
);
/**
* @see FileField::__construct()
* @return string
*/
public function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) {
public function Field() {
Requirements::css(THIRDPARTY_DIR . '/jquery/themes/default/ui.all.css');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.core.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/ui/ui.dialog.js');
parent::__construct($name, $title, $value, $form, $rightTitle, $folderName);
}
/**
* @return string
*/
public function Field() {
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
return $this->createTag (
'iframe',