dolibarr 21.0.0-alpha
|
Class to manage a WYSIWYG editor. More...
Public Member Functions | |
__construct ($htmlname, $content, $width='', $height=200, $toolbarname='Basic', $toolbarlocation='In', $toolbarstartexpanded=false, $uselocalbrowser=1, $okforextendededitor=true, $rows=0, $cols='', $readonly=0, $poscursor=array()) | |
Create an object to build an HTML area to edit a large string content. | |
Create ($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='', $moreparam='', $morecss='') | |
Output edit area inside the HTML stream. | |
Class to manage a WYSIWYG editor.
Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing'); $doleditor->Create();
Definition at line 32 of file doleditor.class.php.
DolEditor::__construct | ( | $htmlname, | |
$content, | |||
$width = '', | |||
$height = 200, | |||
$toolbarname = 'Basic', | |||
$toolbarlocation = 'In', | |||
$toolbarstartexpanded = false, | |||
$uselocalbrowser = 1, | |||
$okforextendededitor = true, | |||
$rows = 0, | |||
$cols = '', | |||
$readonly = 0, | |||
$poscursor = array() ) |
Create an object to build an HTML area to edit a large string content.
string | $htmlname | HTML name of WYSIWYG field |
string | $content | Content of WYSIWYG field |
int | string | $width | Width in pixel of edit area (auto by default) |
int | $height | Height in pixel of edit area (200px by default) |
string | $toolbarname | Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). |
string | $toolbarlocation | Deprecated. Not used |
bool | $toolbarstartexpanded | Bar is visible or not at start |
bool | int | $uselocalbrowser | Enabled to add links to local object with local browser. If false, only external images can be added in content. |
bool | int | string | $okforextendededitor | 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". |
int | $rows | Size of rows for textarea tool |
string | $cols | Size of cols for textarea tool (textarea number of cols '70' or percent 'x') |
int<0,1> | $readonly 0=Read/Edit, 1=Read only | |
array{x?:string,y?:string,find?:string} | $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). array('find'=> 'word') can be used to go to line were the word has been found |
Definition at line 115 of file doleditor.class.php.
References dol_nl2br(), dol_syslog(), dol_textishtml(), and getDolGlobalString().
DolEditor::Create | ( | $noprint = 0, | |
$morejs = '', | |||
$disallowAnyContent = true, | |||
$titlecontent = '', | |||
$option = '', | |||
$moreparam = '', | |||
$morecss = '' ) |
Output edit area inside the HTML stream.
Output depends on this->tool (fckeditor, ckeditor, textarea, ...)
int | $noprint | 1=Return HTML string instead of printing it to output |
string | $morejs | Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });". Used by CKEditor only. |
boolean | $disallowAnyContent | Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only. |
string | $titlecontent | Show title content before editor area. Used by ACE editor only. |
string | $option | For ACE editor, set the source language ('html', 'php', 'javascript', 'json', ...) |
string | $moreparam | Add extra tags to the textarea |
string | $morecss | Add extra css to the textarea |
Definition at line 195 of file doleditor.class.php.
References dol_escape_all(), dol_escape_htmltag(), dol_escape_js(), dol_string_nohtmltag(), getDolGlobalInt(), getDolGlobalString(), and type.