mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Removed HtmlOneLineField. This field has been deprecated for some time now, and it does not work.
API CHANGE Changed HTMLVarchar->scaffoldFormField() to use HtmlEditorField instead of HtmlOneLineField, which does not work. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64504 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ee5b0e2447
commit
7048077184
@ -9,7 +9,7 @@
|
||||
class HTMLVarchar extends Varchar {
|
||||
|
||||
public function scaffoldFormField($title = null, $params = null) {
|
||||
return new HtmlOneLineField($this->name, $title);
|
||||
return new HtmlEditorField($this->name, $title, 1);
|
||||
}
|
||||
|
||||
public function scaffoldSearchField($title = null) {
|
||||
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* A WYSIWYG editor field, powered by tinymce.
|
||||
* tinymce editor fields are created from <textarea> tags which are then converted with javascript.
|
||||
* The {@link Requirements} system is used to ensure that all necessary javascript is included.
|
||||
* @package forms
|
||||
* Caution: Only works within the CMS with a global tinymce-menubar, see {@link CMSMain}
|
||||
*
|
||||
* @subpackage fields-formattedinput
|
||||
* @deprecated 2.3 It's not clear that this field works properly. Just use {@link HtmlEditorField}.
|
||||
*/
|
||||
class HtmlOneLineField extends TextField {
|
||||
/**
|
||||
* Returns the a <textarea> field with tinymce="true" set on it
|
||||
*/
|
||||
function Field() {
|
||||
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
|
||||
Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js");
|
||||
|
||||
// Don't allow unclosed tags - they will break the whole application ;-)
|
||||
$cleanVal = $this->value;
|
||||
$lPos = strrpos($cleanVal,'<');
|
||||
$rPos = strrpos($cleanVal,'>');
|
||||
if(($lPos > $rPos) || ($rPos === false && $lPos !== false)) $cleanVal .= '>';
|
||||
|
||||
return "<textarea class=\"htmleditor\" tinymce_oneline=\"true\" id=\"" . $this->id() . "\" name=\"{$this->name}\" rows=\"1\">$cleanVal</textarea>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user