editor.plugins.inc in Editor 5
Same filename and directory in other branches
Provides default plugin objects. @author Tj Holowaychuk <http://www.350designs.com/> @package Editor
File
editor.plugins.incView source
<?php
/**
* @file
* Provides default plugin objects.
* @author Tj Holowaychuk <http://www.350designs.com/>
* @package Editor
*/
/**
* Implementation of hook_editor_plugins();
*/
function editor_editor_plugins() {
$plugins = array();
// Misc
$plugins[] = editor_plugin_create('undo', t('Undo'), 'button', t('Undo recent changes made.'));
$plugins[] = editor_plugin_create('redo', t('Redo'), 'button', t('Redo recent changes which were undone.'));
$plugins[] = editor_plugin_create('code', t('Code'), 'button', t('Create a code block.'), editor_plugin_code_options());
$plugins[] = editor_plugin_create('image', t('Image'), 'button', t('Create an image.'), editor_plugin_image_options());
$plugins[] = editor_plugin_create('html', t('View HTML'), 'button', t('Toggle HTML viewing mode.'));
$plugins[] = editor_plugin_create('remove_format', t('Remove Formatting'), 'button', t('Removes on selected text and objects.'));
// Font related
$plugins[] = editor_plugin_create('bold', t('Bold'), 'button', t('Create bold text.'));
$plugins[] = editor_plugin_create('italic', t('Italic'), 'button', t('Create italic text.'));
// Alignment
$plugins[] = editor_plugin_create('align_left', t('Align Left'), 'button', t('Align content to the left.'));
$plugins[] = editor_plugin_create('align_center', t('Align Center'), 'button', t('Center align content.'));
$plugins[] = editor_plugin_create('align_right', t('Align Right'), 'button', t('Align content to the right.'));
$plugins[] = editor_plugin_create('align_justify', t('Align Jistify'), 'button', t('Align content as justified.'));
// Lists
$plugins[] = editor_plugin_create('list_numeric', t('Numeric List'), 'button', t('Create a ordered list from selected text or caret position.'));
$plugins[] = editor_plugin_create('list_bullet', t('Bullet List'), 'button', t('Create a unordered list from selected txt or caret position.'));
// Links
$plugins[] = editor_plugin_create('link', t('Link'), 'button', t('Link selected text or content to a website or page.'), editor_plugin_link_options());
$plugins[] = editor_plugin_create('mailto', t('Email Link'), 'button', t('Link selected text or content to an email.'), editor_plugin_mailto_options());
return $plugins;
}
/**
* Code options.
*/
function editor_plugin_code_options() {
return '
<form>
<select class="type">
<option value="code">' . t('General') . '</option>
</select>
<input type="button" class="submit" value="' . t('Go') . '" />
</form>
';
}
/**
* Link options.
*/
function editor_plugin_link_options() {
return '
<form>
<input type="text" class="href click-clear" value="Location" />
<select class="window">
<option value="same">' . t('Open in same window') . '</option>
<option value="_blank">' . t('Open in new window') . '</option>
</select>
<input type="button" class="submit" value="Go" />
</form>
';
}
/**
* Mailto options.
*/
function editor_plugin_mailto_options() {
return '
<form>
<input type="text" class="email click-clear" value="' . t('Email') . '" />
<input type="button" class="submit" value="' . t('Go') . '" />
</form>
';
}
/**
* Image options.
*/
function editor_plugin_image_options() {
return '
<form>
<input type="text" class="uri click-clear" value="' . t('Image Path') . '" />
<input type="text" class="alt click-clear" value="' . t('Description') . '" />
<input type="button" class="submit" value="' . t('Go') . '" />
</form>
';
}
Functions
Name | Description |
---|---|
editor_editor_plugins | Implementation of hook_editor_plugins(); |
editor_plugin_code_options | Code options. |
editor_plugin_image_options | Image options. |
editor_plugin_link_options | Link options. |
editor_plugin_mailto_options | Mailto options. |