You are here

nfccaptcha.module in Node form columns 7

File

nfccaptcha.module
View source
<?php

/**
 * 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.
 *
 * @param array $form
 *  The programatically created node creation form.
 * @param string $variant
 *  The variant of the form that's being configured.
 * @return void
 */
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,
    );
  }
}

Functions

Namesort descending Description
nodeformcols_nodeformcols_base_form_alter Implementation of hook_nodeformcols_base_form_alter().