You are here

function theme_botcha_forms_form_botcha_forms in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.2 botcha.admin.inc \theme_botcha_forms_form_botcha_forms()
  2. 6.3 botcha.module \theme_botcha_forms_form_botcha_forms()
  3. 7.2 botcha.admin.inc \theme_botcha_forms_form_botcha_forms()

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

1 theme call to theme_botcha_forms_form_botcha_forms()
Botcha::getAdminForm in controller/application/botcha.application.controller.inc

File

./botcha.module, line 416
BOTCHA - Spam Prevention It modifies forms by adding various botcha's.

Code

function theme_botcha_forms_form_botcha_forms($variables) {
  $form = $variables['form'];

  // Prepare header before pass to theme.
  $header = $form['#header'];
  $rows = array();

  // Existing BOTCHA points.
  foreach (element_children($form['botcha_forms']) as $id) {
    $row = array();
    foreach (element_children($form['botcha_forms'][$id]) as $col) {
      $row[$col] = drupal_render($form['botcha_forms'][$id][$col]);
    }
    $rows[$id] = $row;
  }
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  return $output;
}