dolibarr 21.0.0-alpha
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 31 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 WYSIWYG field
string$contentContent of WYSIWYG 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 | int | string$okforextendededitor1 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$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). array('find'=> 'word') can be used to go to line were the word has been found

Definition at line 72 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', 'json', ...)
string$moreparamAdd extra tags to the textarea
string$morecssAdd extra css to the textarea
Returns
void|string

Definition at line 150 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: