You are here

function theme_botcha_recipebooks_form in BOTCHA Spam Prevention 7.2

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

Theme botcha_recipebooks_form().

File

./botcha.admin.inc, line 373
Implementation of botcha administration forms.

Code

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

  // Iterate through all recipebooks and build a table.
  $rows = array();

  //foreach (array('enabled', 'disabled') as $type) {

  //  if (isset($form[$type])) {
  foreach (element_children($form['recipebooks']) as $id) {
    $row = array();
    foreach (element_children($form['recipebooks'][$id]) as $col) {
      $row[$col] = array(
        'data' => drupal_render($form['recipebooks'][$id][$col]),
      );
    }
    $rows[] = array(
      'data' => $row,
    );
  }

  //  }

  //}
  $output = theme('table', array(
    'header' => $form['#header'],
    'rows' => $rows,
    'empty' => t('No recipebooks available.'),
  ));
  if (!empty($rows)) {
    $output .= drupal_render_children($form);
  }
  return $output;
}