You are here

function ckeditor_form_alter in CKEditor - WYSIWYG HTML editor 6

Implementation of hook_form_alter()

File

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

Code

function ckeditor_form_alter(&$form, $form_state, $form_id) {

  // [#659278], [#666560], [#666616]
  if (substr($form_id, -10) == '_node_form') {
    if (!empty($form['#node']->language)) {
      $form['body_field']['body']['#scayt_language'] = _ckeditor_scayt_langcode($form['#node']->language);
    }
    if (!empty($form['body_field']['teaser_js']['#teaser'])) {
      $setting['ckeditor']['teaser'] = $form['body_field']['teaser_js']['#teaser'];
      drupal_add_js($setting, 'setting');
    }
  }
}