You are here

function ckeditor_elements in CKEditor - WYSIWYG HTML editor 6

Implementation of hook_elements(). Replace the textarea with CKEditor using a callback function (ckeditor_process_textarea)

File

./ckeditor.module, line 144
CKEditor - The text editor for the Internet - http://ckeditor.com Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.

Code

function ckeditor_elements() {
  $type = array();
  $type['textfield'] = array(
    '#process' => array(
      'ckeditor_process_input',
    ),
  );

  // only roles with permission get CKEditor
  if (user_access('access ckeditor')) {
    $type['textarea'] = array(
      '#process' => array(
        'ckeditor_process_textarea',
      ),
    );
    $type['form'] = array(
      '#after_build' => array(
        'ckeditor_process_form',
      ),
    );
    $type['hidden'] = array(
      '#process' => array(
        'ckeditor_process_hidden',
      ),
    );
  }
  return $type;
}