You are here

editor.plugins.inc in Editor 6

Same filename and directory in other branches
  1. 5 editor.plugins.inc

Provides default plugin objects. @author Tj Holowaychuk <http://www.350designs.com/> @package Editor

File

editor.plugins.inc
View source
<?php

/**
 * @file 
 * Provides default plugin objects.
 * @author Tj Holowaychuk <http://www.350designs.com/>
 * @package Editor
 */

/**
 * Default core and popular module supported 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.'));

  // 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.'));

  // 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 '
      <select class="type">
        <option value="code">General</option>
        <option value="php">PHP</option>
      </select>
      <input type="button" class="submit" value="Go" />
    ';
}

/**
 * Link options.
 */
function editor_plugin_link_options() {
  return '
      <input type="text" class="href" value="Location" />
      <select class="window">
        <option value="same">Open in same window</option>
        <option value="_blank">Open in new window</option>
      </select>
      <input type="button" class="submit" value="Go" />
    ';
}

/**
 * Mailto options.
 */
function editor_plugin_mailto_options() {
  return '
      <input type="text" class="email" value="Email" />
      <input type="button" class="submit" value="Go" />
    ';
}

/**
 * Image options.
 */
function editor_plugin_image_options() {
  return '
      <input type="text" class="uri" value="Image Path" />
      <input type="text" class="alt" value="Description" />
      <input type="button" class="submit" value="Go" />
    ';
}

Functions

Namesort descending Description
editor_editor_plugins Default core and popular module supported 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.