You are here

function bueditor_textarea in BUEditor 5

Same name and namespace in other branches
  1. 6.2 bueditor.module \bueditor_textarea()
  2. 6 bueditor.module \bueditor_textarea()
  3. 7 bueditor.module \bueditor_textarea()

Integrate the editor into textareas.

File

./bueditor.module, line 484

Code

function bueditor_textarea($element) {
  static $editor, $pageok, $settled;
  if (!isset($pageok)) {
    $editor = bueditor_user_editor($GLOBALS['user']);
    $pageok = $editor->pages ? bueditor_check_match($editor->pages, $_GET['q']) : FALSE;
  }
  if ($pageok && $settled !== FALSE) {
    if (!bueditor_check_match($editor->excludes, $element['#id'])) {
      $element['#attributes']['class'] .= ' editor-textarea';
      $settled = isset($settled) ? $settled : bueditor_settle($editor);
    }
  }
  return $element;
}