function hook_editor_info in Editor 7
Define text editors, such as WYSIWYGs or toolbars to assist with text input.
Text editors are bound to an individual text format. When a format is activated in a 'text_format' element, the text editor associated with the format should be activated on the text area.
Return value
array An associative array of editors, whose keys are internal editor names, which should be unique and therefore prefixed with the name of the module. Each value is an associative array describing the editor, with the following elements (all are optional except as noted):
- title: (required) A human readable name for the editor.
- settings callback: The name of a function that returns configuration form elements for the editor. See hook_editor_EDITOR_settings() for details.
- default settings: An associative array containing default settings for the editor, to be applied when the editor has not been configured yet.
- js settings callback: The name of a function that returns configuration options that should be added to the page via JavaScript for use on the client side. See hook_editor_EDITOR_js_settings() for details.
See also
2 functions implement hook_editor_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- editor_ckeditor_editor_info in modules/
editor_ckeditor/ editor_ckeditor.editor.inc - Implements hook_editor_info().
- editor_quickedit_editor_info in ./
editor.quickedit.inc - Implements hook_quickedit_editor_info().
1 invocation of hook_editor_info()
- editor_get_editors in ./
editor.module - Returns a list of text editors that are used with 'text_format' elements.
File
- ./
editor.api.php, line 38 - Documentation for Editor module APIs.
Code
function hook_editor_info() {
$editors['myeditor'] = array(
'title' => t('My Editor'),
'settings callback' => '_myeditor_settings',
'default settings' => array(
'enable_toolbar' => TRUE,
'toolbar_buttons' => array(
'bold',
'italic',
'underline',
'link',
'image',
),
'resizeable' => TRUE,
),
'js settings callback' => '_myeditor_js_settings',
);
return $editors;
}