diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 5abfb5263..c55493ab3 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -207,26 +207,31 @@ class HtmlEditorField_Toolbar extends RequestHandler { $this->controller, "{$this->name}/LinkForm", new FieldSet( - new LiteralField('Heading', '

' . _t('HtmlEditorField.CLOSE', 'close').'' . _t('HtmlEditorField.LINK', 'Link') . '

'), - new OptionsetField( - 'LinkType', - _t('HtmlEditorField.LINKTO', 'Link to'), - array( - 'internal' => _t('HtmlEditorField.LINKINTERNAL', 'Page on the site'), - 'external' => _t('HtmlEditorField.LINKEXTERNAL', 'Another website'), - 'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'), - 'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'), - 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'), - ) + new LiteralField( + 'Heading', + sprintf('

%s

', _t('HtmlEditorField.LINK', 'Link')) ), - new TreeDropdownField('internal', _t('HtmlEditorField.PAGE', "Page"), 'SiteTree', 'ID', 'MenuTitle'), - new TextField('external', _t('HtmlEditorField.URL', 'URL'), 'http://'), - new EmailField('email', _t('HtmlEditorField.EMAIL', 'Email address')), - new TreeDropdownField('file', _t('HtmlEditorField.FILE', 'File'), 'File', 'Filename'), - new TextField('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')), - new TextField('LinkText', _t('HtmlEditorField.LINKTEXT', 'Link text')), - new TextField('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')), - new CheckboxField('TargetBlank', _t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')) + $contentComposite = new CompositeField( + new OptionsetField( + 'LinkType', + _t('HtmlEditorField.LINKTO', 'Link to'), + array( + 'internal' => _t('HtmlEditorField.LINKINTERNAL', 'Page on the site'), + 'external' => _t('HtmlEditorField.LINKEXTERNAL', 'Another website'), + 'anchor' => _t('HtmlEditorField.LINKANCHOR', 'Anchor on this page'), + 'email' => _t('HtmlEditorField.LINKEMAIL', 'Email address'), + 'file' => _t('HtmlEditorField.LINKFILE', 'Download a file'), + ) + ), + new TreeDropdownField('internal', _t('HtmlEditorField.PAGE', "Page"), 'SiteTree', 'URLSegment', 'MenuTitle'), + new TextField('external', _t('HtmlEditorField.URL', 'URL'), 'http://'), + new EmailField('email', _t('HtmlEditorField.EMAIL', 'Email address')), + new TreeDropdownField('file', _t('HtmlEditorField.FILE', 'File'), 'File', 'Filename'), + new TextField('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')), + new TextField('LinkText', _t('HtmlEditorField.LINKTEXT', 'Link text')), + new TextField('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')), + new CheckboxField('TargetBlank', _t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')) + ) ), new FieldSet( new FormAction('insert', _t('HtmlEditorField.BUTTONINSERTLINK', 'Insert link')), @@ -234,6 +239,8 @@ class HtmlEditorField_Toolbar extends RequestHandler { ) ); + $contentComposite->addExtraClass('content'); + $form->loadDataFrom($this); return $form; @@ -246,12 +253,12 @@ class HtmlEditorField_Toolbar extends RequestHandler { * @return Form */ function ImageForm() { - Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); - Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/swfupload.js'); + Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); + Requirements::css('cms/css/TinyMCEImageEnhancement.css'); + Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); Requirements::javascript(CMS_DIR . '/javascript/Upload.js'); - Requirements::css(CMS_DIR .'/css/TinyMCEImageEnhancement.css'); - Requirements::javascript(CMS_DIR . '/javascript/TinyMCEImageEnhancement.js'); + Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js'); /** * @todo Adding folders via this screen is not enabled just yet as it is still @@ -261,43 +268,44 @@ class HtmlEditorField_Toolbar extends RequestHandler { $this->controller, "{$this->name}/ImageForm", new FieldSet( - new LiteralField('Heading', '

' . _t('HtmlEditorField.CLOSE', 'close') . '' . _t('HtmlEditorField.IMAGE', 'Image') . '

'), - new TreeDropdownField('FolderID', _t('HtmlEditorField.FOLDER', 'Folder'), 'Folder'), - new LiteralField('AddFolderOrUpload', - ' - -
- ' . _t('HtmlEditorField.UPLOAD','Upload') . ' -
- -
- -
- ' + new LiteralField( + 'Heading', + sprintf('

%s

', _t('HtmlEditorField.IMAGE', 'Image')) ), - new TextField('getimagesSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')), - new ThumbnailStripField('FolderImages', 'FolderID', 'getimages'), - new TextField('AltText', _t('HtmlEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image cannot be displayed'), '', 80), - new TextField('ImageTitle', _t('HtmlEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')), - new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')), - new DropdownField( - 'CSSClass', - _t('HtmlEditorField.CSSCLASS', 'Alignment / style'), - array( - 'left' => _t('HtmlEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'), - 'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'), - 'right' => _t('HtmlEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.'), - 'center' => _t('HtmlEditorField.CSSCLASSCENTER', 'Centered, on its own.'), + $contentComposite = new CompositeField( + new TreeDropdownField('FolderID', _t('HtmlEditorField.FOLDER', 'Folder'), 'Folder'), + new LiteralField('AddFolderOrUpload', + '
+ ' +
+
+ ), + new TextField('getimagesSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')), + new ThumbnailStripField('FolderImages', 'FolderID', 'getimages'), + new TextField('AltText', _t('HtmlEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image cannot be displayed'), '', 80), + new TextField('ImageTitle', _t('HtmlEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')), + new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')), + new DropdownField( + 'CSSClass', + _t('HtmlEditorField.CSSCLASS', 'Alignment / style'), + array( + 'left' => _t('HtmlEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'), + 'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'), + '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 FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', 'Dimensions'), - new TextField('Width', _t('HtmlEditorField.IMAGEWIDTHPX', 'Width'), 100), - new TextField('Height', " x " . _t('HtmlEditorField.IMAGEHEIGHTPX', 'Height'), 100) ) ), new FieldSet( @@ -305,6 +313,8 @@ class HtmlEditorField_Toolbar extends RequestHandler { ) ); + $contentComposite->addExtraClass('content'); + $form->disableSecurityToken(); $form->loadDataFrom($this); @@ -313,27 +323,35 @@ class HtmlEditorField_Toolbar extends RequestHandler { function FlashForm() { Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); - Requirements::javascript(CMS_DIR . '/javascript/Upload.js'); Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); - Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/swfupload.js'); + Requirements::javascript(CMS_DIR . '/javascript/Upload.js'); + Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js'); $form = new Form( $this->controller, "{$this->name}/FlashForm", new FieldSet( - new LiteralField('Heading', '

'._t('HtmlEditorField.CLOSE', 'close').''._t('HtmlEditorField.FLASH', 'Flash').'

'), - new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER'), "Folder"), - new TextField('getflashSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')), - new ThumbnailStripField("Flash", "FolderID", "getflash"), - new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', "Dimensions"), - new TextField("Width", _t('HtmlEditorField.IMAGEWIDTHPX', "Width"), 100), - new TextField("Height", "x " . _t('HtmlEditorField.IMAGEHEIGHTPX', "Height"), 100) + new LiteralField( + 'Heading', + sprintf('

%s

', _t('HtmlEditorField.FLASH', 'Flash')) + ), + $contentComposite = new CompositeField( + new TreeDropdownField("FolderID", _t('HtmlEditorField.FOLDER'), "Folder"), + new TextField('getflashSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')), + new ThumbnailStripField("Flash", "FolderID", "getflash"), + 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("insertflash", _t('HtmlEditorField.BUTTONINSERTFLASH', 'Insert Flash')) ) ); + + $contentComposite->addExtraClass('content'); + $form->loadDataFrom($this); $form->disableSecurityToken(); return $form;