You are here

function theme_domain_prefix_configure_form in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain_prefix/domain_prefix.module \theme_domain_prefix_configure_form()

FormsAPI theming for domain_prefix_configure_form.

File

domain_prefix/domain_prefix.admin.inc, line 178
Admin page functions for selective table prefixing for use with Domain Access.

Code

function theme_domain_prefix_configure_form($form) {
  $output = t('<p>These settings control advanced functions.  Please read the documentation carefully.</p>');
  $header = array(
    t('Table'),
    t('Source'),
    t('Ignore'),
    t('Create'),
    t('Copy'),
  );
  if (!empty($form['prefix_theme']['#value'])) {
    $header[] = t('Update');
    $header[] = t('Drop');
    unset($form['prefix_theme']);
  }
  $output = drupal_render($form['domain']);
  foreach (element_children($form['domain_prefix']) as $key) {
    if ($form['domain_prefix'][$key]['#description']) {
      $rows[] = array(
        '<b>' . $form['domain_prefix'][$key]['#description'] . '</b>',
        array(
          '',
          'colspan' => count($header),
        ),
      );
    }
    $row = array();
    $row[] = ' - ' . $form['domain_prefix'][$key]['#title'];

    // Insert the source selection element.
    $row[] = drupal_render($form['domain_source']['_source_' . $key]);
    foreach (element_children($form['domain_prefix'][$key]) as $option) {
      $row[] = drupal_render($form['domain_prefix'][$key][$option]);
    }

    // Throw the rest away, since we already rendered what we want from it.
    $render = drupal_render($form['domain_prefix'][$key]);
    $rows[] = $row;
  }
  $output .= theme('table', $header, $rows);
  $output .= drupal_render($form);
  return $output;
}