nfccaptcha.module 870 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Implementation of hook_nodeformcols_base_form_alter().
  4. *
  5. * Implement this hook if you want to alter the node creation form that
  6. * nodeformcols uses to construct the configuration interface before
  7. * nodeformcols reads field information from it.
  8. *
  9. * @param array $form
  10. * The programatically created node creation form.
  11. * @param string $variant
  12. * The variant of the form that's being configured.
  13. * @return void
  14. */
  15. function nodeformcols_nodeformcols_base_form_alter(&$form, $variant) {
  16. $using_captcha = db_query("SELECT COUNT(module)
  17. FROM {captcha_points} WHERE form_id = :form_id", array(':form_id' => array(
  18. ':form_id' => $form['#node']->type . '_node_form',
  19. )))->fetchField();
  20. if ($using_captcha) {
  21. $form['captcha'] = array(
  22. '#title' => t('CAPTCHA'),
  23. '#weight' => $form['buttons']['#weight'] - 1,
  24. );
  25. }
  26. }