dolibarr  7.0.0-beta
Public Member Functions | List of all members
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=true, $okforextendededitor=true, $rows=0, $cols=0, $readonly=0)
 Create an object to build an HTML area to edit a large string content. More...
 
 Create ($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='')
 Output edit area inside the HTML stream. More...
 

Detailed Description

Class to manage a WYSIWYG editor.

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

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

Constructor & Destructor Documentation

DolEditor::__construct (   $htmlname,
  $content,
  $width = '',
  $height = 200,
  $toolbarname = 'Basic',
  $toolbarlocation = 'In',
  $toolbarstartexpanded = false,
  $uselocalbrowser = true,
  $okforextendededitor = true,
  $rows = 0,
  $cols = 0,
  $readonly = 0 
)

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$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$toolbarlocationWhere bar is stored : 'In' each window has its own toolbar 'Out:name' share toolbar into the div called 'name'
boolean$toolbarstartexpandedBar is visible or not at start
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

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

References dol_htmlentitiesbr(), and dol_syslog().

Member Function Documentation

DolEditor::Create (   $noprint = 0,
  $morejs = '',
  $disallowAnyContent = true,
  $titlecontent = '',
  $option = '' 
)

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', ...)
Returns
void|string

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

References dol_escape_htmltag(), and print.


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