You are here

function theme_ldapdata_admin_edit in LDAP integration 6

Same name and namespace in other branches
  1. 5.2 ldapdata.module \theme_ldapdata_admin_edit()
  2. 5 ldapdata.module \theme_ldapdata_admin_edit()

Theme function for the admin edit form.

File

./ldapdata.theme.inc, line 14
Themes for ldapdata module.

Code

function theme_ldapdata_admin_edit($form) {
  $output = '';
  $rows = array();
  foreach (element_children($form) as $element) {
    if ($element == 'attributes') {
      if (isset($form['attributes']['table'])) {
        foreach (element_children($form['attributes']['table']) as $key) {
          $row = array();
          $row[] = drupal_render($form['attributes']['table'][$key]);
          $row[] = drupal_render($form['attributes']['ldapdata_roattrs'][$key]);
          $row[] = drupal_render($form['attributes']['ldapdata_rwattrs'][$key]);
          $rows[] = $row;
        }
      }
      else {
        $rows[] = array(
          array(
            'data' => t('No attributes configured.'),
            'colspan' => 3,
          ),
        );
      }
      $form['attributes']['#children'] = drupal_render($form['attributes']['ldapdata_attrs']);
      $form['attributes']['#children'] .= theme('table', $form['attributes']['header']['#value'], $rows);
      $form['attributes']['#children'] .= drupal_render($form['attributes']['ldapdata_filter_php']);
      $output .= drupal_render($form['attributes']);
    }
    else {
      $output .= drupal_render($form[$element]);
    }
  }
  $output .= drupal_render($form);
  return $output;
}