You are here

function theme_domain_roles_form in Domain Access 7.2

Same name and namespace in other branches
  1. 6.2 domain.admin.inc \theme_domain_roles_form()
  2. 7.3 domain.admin.inc \theme_domain_roles_form()

FormsAPI theming.

File

./domain.admin.inc, line 1056
Administration functions for the domain module.

Code

function theme_domain_roles_form($variables) {
  $form = $variables['form'];
  $output = '';
  $header = array(
    t('Domains'),
  );
  $rows = array();
  $roles = user_roles();
  $roles[0] = t('new user');
  ksort($roles);
  $domains = domain_domains();
  foreach ($roles as $rid => $role) {
    $header[] = $role;
  }
  foreach ($domains as $domain_id => $domain) {
    $row = array();
    if ($domain_id == 0) {
      $domain_id = -1;
    }
    $row[] = filter_xss_admin($domain['sitename']);
    foreach ($roles as $rid => $role) {
      $form['domain_roles'][$rid][$domain_id]['#title'] = '';
      $row[] = drupal_render($form['domain_roles'][$rid][$domain_id]);
    }
    $rows[] = $row;
  }
  $output .= drupal_render($form['domain_add_roles']);
  $output .= theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  $output .= drupal_render_children($form);
  return $output;
}