You are here

function theme_botcha_recipebooks_form in BOTCHA Spam Prevention 6.3

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

Theme botcha_recipebooks_form().

File

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

Code

function theme_botcha_recipebooks_form($form) {

  // @todo Abstract it.
  // "Add recipebook" link.
  $output = l(t('Add recipe book'), Botcha::ADMIN_PATH . '/recipebook/add');

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

  // Iterate through all recipebooks and build a table.
  $rows = array();
  foreach (element_children($form['recipebooks']) as $id) {
    $row = array();
    foreach (element_children($form['recipebooks'][$id]) as $col) {
      $row[$col] = drupal_render($form['recipebooks'][$id][$col]);
    }
    $rows[$id] = $row;
  }
  $output .= theme('table', $header, $rows);
  return $output;
}