Cheetah
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ChWsbEditor Class Reference
Inheritance diagram for ChWsbEditor:
ChBaseEditorTinyMCE ChTemplEditorTinyMCE

Public Member Functions

 __construct ($aObject)
 
 getObjectName ()
 
 getWidth ($iViewMode)
 
 attachEditor ($sSelector, $iViewMode, $bDynamicMode=false)
 

Static Public Member Functions

static getObjectInstance ($sObject=false)
 

Protected Member Functions

 _addJsCss ($bDynamicMode=false)
 
 _replaceMarkers ($s, $a)
 

Protected Attributes

 $_sObject
 
 $_aObject
 

Detailed Description

WYSIWYG editors.

Site owner can choose which visual editor can be user on the site.

Default visual editor is stored in 'sys_editor_default' setting option.

Creating the Editor object:

Add record to 'sys_objects_editor' table:

Example of usage

Apply visual editor to textarea:

echo '<textarea id="my_textarea" rows="20" cols="80">some text here</textarea>'; // print text area element
ch_import('ChWsbEditor'); // import editor class
$oEditor = ChWsbEditor::getObjectInstance(); // get default editor object instance
if ($oEditor) // check if editor is available for using
echo $oEditor->attachEditor ('#my_textarea', CH_EDITOR_STANDARD); // output HTML which will automatically apply editor to textarea element by its id

Definition at line 67 of file ChWsbEditor.php.

Constructor & Destructor Documentation

◆ __construct()

ChWsbEditor::__construct (   $aObject)

Constructor

Parameters
$aObjectarray of editor options

Definition at line 76 of file ChWsbEditor.php.

Member Function Documentation

◆ _addJsCss()

ChWsbEditor::_addJsCss (   $bDynamicMode = false)
protected

Add css/js files which are needed for editor display and functionality.

Definition at line 143 of file ChWsbEditor.php.

◆ _replaceMarkers()

ChWsbEditor::_replaceMarkers (   $s,
  $a 
)
protected

Replace provided markers string.

Parameters
$s- string to replace markers in
$a- markers array
Returns
string with replaces markers

Definition at line 154 of file ChWsbEditor.php.

◆ attachEditor()

ChWsbEditor::attachEditor (   $sSelector,
  $iViewMode,
  $bDynamicMode = false 
)

Attach editor to HTML element, in most cases - textarea.

Parameters
$sSelector- jQuery selector to attach editor to.
$iViewMode- editor view mode: CH_EDITOR_STANDARD, CH_EDITOR_MINI, CH_EDITOR_FULL
$bDynamicMode- is AJAX mode or not, the HTML with editor area is loaded synamically.

Reimplemented in ChBaseEditorTinyMCE.

Definition at line 135 of file ChWsbEditor.php.

◆ getObjectInstance()

static ChWsbEditor::getObjectInstance (   $sObject = false)
static

Get editor object instance by object name

Parameters
$sObjectobject name
Returns
object instance or false on error

Definition at line 87 of file ChWsbEditor.php.

◆ getObjectName()

ChWsbEditor::getObjectName ( )

Get object name

Definition at line 116 of file ChWsbEditor.php.

◆ getWidth()

ChWsbEditor::getWidth (   $iViewMode)

Get minimal width which is neede for editor for the provided view mode

Reimplemented in ChBaseEditorTinyMCE.

Definition at line 124 of file ChWsbEditor.php.

Member Data Documentation

◆ $_aObject

ChWsbEditor::$_aObject
protected

Definition at line 70 of file ChWsbEditor.php.

◆ $_sObject

ChWsbEditor::$_sObject
protected

Definition at line 69 of file ChWsbEditor.php.


The documentation for this class was generated from the following file:
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
CH_EDITOR_STANDARD
const CH_EDITOR_STANDARD
Definition: ChWsbEditor.php:14
ChWsbEditor\getObjectInstance
static getObjectInstance($sObject=false)
Definition: ChWsbEditor.php:87