dolibarr 19.0.3
DolEditor Class Reference

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.
 

Detailed Description

Class to manage a WYSIWYG editor.

Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing'); $doleditor->Create();

Definition at line 30 of file doleditor.class.php.

Constructor & Destructor Documentation

◆ __construct()

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.

Parameters
string$htmlnameHTML name of WYSIWIG field
string$contentContent of WYSIWIG field
int | string$widthWidth in pixel of edit area (auto by default)
int$heightHeight in pixel of edit area (200px by default)
string$toolbarnameName of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly').
string$toolbarlocationDeprecated. Not used
boolean$toolbarstartexpandedBar is visible or not at start
boolean | int$uselocalbrowserEnabled to add links to local object with local browser. If false, only external images can be added in content.
boolean | string$okforextendededitorTrue=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$rowsSize of rows for textarea tool
string$colsSize of cols for textarea tool (textarea number of cols '70' or percent 'x')
int$readonly0=Read/Edit, 1=Read only
array$poscursorArray for initial cursor position array('x'=>x, 'y'=>y)

Definition at line 70 of file doleditor.class.php.

References dol_nl2br(), dol_syslog(), dol_textishtml(), and getDolGlobalString().

Member Function Documentation

◆ Create()

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, ...)

Parameters
int$noprint1=Return HTML string instead of printing it to output
string$morejsAdd more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });". Used by CKEditor only.
boolean$disallowAnyContentDisallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only.
string$titlecontentShow title content before editor area. Used by ACE editor only.
string$optionFor ACE editor, set the source language ('html', 'php', 'javascript', ...)
string$moreparamAdd extra tags to the textarea
string$morecssAdd extra css to the textarea
Returns
void|string

Definition at line 132 of file doleditor.class.php.

References dol_escape_htmltag(), dol_escape_js(), getDolGlobalInt(), getDolGlobalString(), and type.


The documentation for this class was generated from the following file: