You are here

function ctools_form_comment_form_alter in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 plugins/content_types/node_context/node_comment_form.inc \ctools_form_comment_form_alter()

Alter the comment form to get a little more control over it.

File

./ctools.module, line 739
CTools primary module file.

Code

function ctools_form_comment_form_alter(&$form, &$form_state) {
  if (!empty($form_state['ctools comment alter'])) {

    // Force the form to post back to wherever we are.
    $form['#action'] = url($_GET['q'], array(
      'fragment' => 'comment-form',
    ));
    if (empty($form['#submit'])) {
      $form['#submit'] = array(
        'comment_form_submit',
      );
    }
    $form['#submit'][] = 'ctools_node_comment_form_submit';
  }
}