From 8acb9a0f4898088f51f9d7dd611f52f705bd9562 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 15 Nov 2007 22:30:08 +0000 Subject: [PATCH] Update SWFUpload to 7.0-beta-3 (merged from branches/2.2.0, r44795) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44896 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/HtmlEditorField.php | 62 ++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index e2cc192dc..747e8add3 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -341,45 +341,35 @@ class HtmlEditorField_Toolbar extends ViewableData { } function ImageForm() { - $fields = new FieldSet( - new LiteralField('Heading', '

closeImage

'), - new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER', "Folder"), "Folder"), - new ThumbnailStripField("Image", "FolderID", "getimages"), - new TextField("AltText", _t('HtmlEditorField.ALTTEXT', "Description"), "", 80), - new DropdownField("CSSClass", _t('HtmlEditorField.CSSCLASS', "Alignment / style"), array( - "left" => _t('HtmlEditorField.CSSCLASSLEFT', "On the left, with text wrapping around."), - "right" => _t('HtmlEditorField.CSSCLASSRIGHT', "On the right, with text wrapping around."), - "center" => _t('HtmlEditorField.CSSCLASSCENTER', "Centered, on its own."), - )), - new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"), - new TextField("Width", _t('HtmlEditorField.IMAGEWIDTHPX', "Width"), 100), - new TextField("Height", "x " . _t('HtmlEditorField.IMAGEHEIGHTPX', "Height"), 100) - ) - ); - - // We don't want SWFUpload on linux, since it doesn't work - $browscap = new Browscap(); - $hitdata = $browscap->getBrowser(null, true); - if(!($hitdata['Platform'] && stristr($hitdata['Platform'], 'linux'))) { - $fields->insertBefore(new LiteralField('AddFolderOrUpload', - '
- ' . _t('HtmlEditorField.CREATEFOLDER','create folder') . ' - - - -
| -
- ' . _t('HtmlEditorField.UPLOAD','upload') . ' -
- '), - 'Image' - ); - } - $form = new Form( $this->controller, "{$this->name}.ImageForm", - $fields, + new FieldSet( + new LiteralField('Heading', '

closeImage

'), + new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER', "Folder"), "Folder"), + new LiteralField('AddFolderOrUpload', + '
+ ' . _t('HtmlEditorField.CREATEFOLDER','create folder') . ' + + + +
| +
+ ' . _t('HtmlEditorField.UPLOAD','upload') . ' +
+ '), + new ThumbnailStripField("Image", "FolderID", "getimages"), + new TextField("AltText", _t('HtmlEditorField.ALTTEXT', "Description"), "", 80), + new DropdownField("CSSClass", _t('HtmlEditorField.CSSCLASS', "Alignment / style"), array( + "left" => _t('HtmlEditorField.CSSCLASSLEFT', "On the left, with text wrapping around."), + "right" => _t('HtmlEditorField.CSSCLASSRIGHT', "On the right, with text wrapping around."), + "center" => _t('HtmlEditorField.CSSCLASSCENTER', "Centered, on its own."), + )), + new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"), + new TextField("Width", _t('HtmlEditorField.IMAGEWIDTHPX', "Width"), 100), + new TextField("Height", "x " . _t('HtmlEditorField.IMAGEHEIGHTPX', "Height"), 100) + ) + ), new FieldSet( new FormAction("insertimage", _t('HtmlEditorField.BUTTONINSERTIMAGE', 'Insert image')), new FormAction("editimage", _t('HtmlEditorField.BUTTONEDITIMAGE', 'Edit image'))