You are here

function theme_botcha_forms_form_botcha_forms in BOTCHA Spam Prevention 6.3

Same name and namespace in other branches
  1. 6.2 botcha.admin.inc \theme_botcha_forms_form_botcha_forms()
  2. 7.2 botcha.admin.inc \theme_botcha_forms_form_botcha_forms()
  3. 7.3 botcha.module \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 500
BOTCHA - Spam Prevention It modifies forms by adding various botcha's.

Code

function theme_botcha_forms_form_botcha_forms($form) {

  // @todo Abstract it.
  // "Add BOTCHA protection to the form" link.
  $output = l(t('Add BOTCHA protection to the form'), Botcha::ADMIN_PATH . '/form/add');

  // 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', $header, $rows);
  return $output;
}