You are here

function nodeformcols_nodeformcols_base_form_alter in Node form columns 7

Implementation of hook_nodeformcols_base_form_alter().

Implement this hook if you want to alter the node creation form that nodeformcols uses to construct the configuration interface before nodeformcols reads field information from it.

Parameters

array $form: The programatically created node creation form.

string $variant: The variant of the form that's being configured.

Return value

void

File

./nfccaptcha.module, line 16

Code

function nodeformcols_nodeformcols_base_form_alter(&$form, $variant) {
  $using_captcha = db_query("SELECT COUNT(captcha_type)\n    FROM {captcha_points} WHERE form_id = :form_id", array(
    ':form_id' => $form['#node']->type . '_node_form',
  ))
    ->fetchField();
  if ($using_captcha) {
    $form['captcha'] = array(
      '#title' => t('CAPTCHA'),
      '#weight' => $form['actions']['#weight'] - 1,
    );
  }
}