You are here

function theme_captcha_admin_settings_captcha_points in CAPTCHA 6.2

Same name and namespace in other branches
  1. 5.3 captcha.module \theme_captcha_admin_settings_captcha_points()
  2. 6 captcha.admin.inc \theme_captcha_admin_settings_captcha_points()
  3. 7 captcha.admin.inc \theme_captcha_admin_settings_captcha_points()

Custom theme function for a table of (form_id -> CAPTCHA type) settings

1 theme call to theme_captcha_admin_settings_captcha_points()
captcha_admin_settings in ./captcha.admin.inc
Form builder function for the general CAPTCHA configuration

File

./captcha.admin.inc, line 240
Functionality and helper functions for CAPTCHA administration.

Code

function theme_captcha_admin_settings_captcha_points($form) {
  $header = array(
    'form_id',
    t('Challenge type'),
    t('Operations'),
  );
  $rows = array();

  // Existing CAPTCHA points.
  foreach (element_children($form['captcha_captcha_points']) as $key) {
    $row = array();
    $row[] = drupal_render($form['captcha_captcha_points'][$key]['form_id']);
    $row[] = drupal_render($form['captcha_captcha_points'][$key]['captcha_type']);
    $row[] = drupal_render($form['captcha_captcha_points'][$key]['operations']);
    $rows[] = $row;
  }

  // For new CAPTCHA point.
  $row = array();
  $row[] = drupal_render($form['captcha_new_captcha_point']['form_id']);
  $row[] = drupal_render($form['captcha_new_captcha_point']['captcha_type']);
  $row[] = '';
  $rows[] = $row;
  $output = theme('table', $header, $rows);
  return $output;
}