function locale_form_comment_form_alter

Implements hook_form_FORM_ID_alter().

File

modules/locale/locale.module, line 400

Code

function locale_form_comment_form_alter(&$form, &$form_state, $form_id) {
  // If a content type has multilingual support we set the content language as
  // comment language.
  if ($form['language']['#value'] == LANGUAGE_NONE && locale_multilingual_node_type($form['#node']->type)) {
    global $language_content;
    $form['language']['#value'] = $language_content->language;
    $submit_callback = 'locale_field_comment_form_submit';
    array_unshift($form['actions']['preview']['#submit'], $submit_callback);
    array_unshift($form['#submit'], $submit_callback);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.