You are here

function theme_hosting_client_user_form in Hosting 7.4

Same name and namespace in other branches
  1. 5 client/hosting_client.access.inc \theme_hosting_client_user_form()
  2. 6.2 client/hosting_client.access.inc \theme_hosting_client_user_form()
  3. 7.3 client/hosting_client.access.inc \theme_hosting_client_user_form()

Returns HTML for the client area on the user form.

File

client/hosting_client.access.inc, line 138
Control client node access.

Code

function theme_hosting_client_user_form($variables) {
  $form = $variables['form'];
  if (array_key_exists('hosting_client', $form)) {
    $edit_name = drupal_render($form['hosting_client']);
  }
  else {
    $edit_name = '';
  }
  $rows = array();
  if (isset($form['name'])) {
    foreach (element_children($form['name'], TRUE) as $client) {
      $row = array();
      $row['data'][] = $form['name'][$client]['#value'];
      if (user_access('edit client users')) {
        $row['data'][] = drupal_render($form['clients'][$client]);
      }
      $rows[] = $row;
    }
  }
  $output = drupal_render_children($form);
  $output .= theme('table', array(
    'header' => $form['header']['#value'],
    'rows' => $rows,
  ));
  $output .= $edit_name;
  return $output;
}