You are here

function hosting_client_user_form in Hosting 5

Same name and namespace in other branches
  1. 6.2 client/hosting_client.access.inc \hosting_client_user_form()
1 call to hosting_client_user_form()
hosting_client_user in client/hosting_client.access.inc
Implementation of hook_user().

File

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

Code

function hosting_client_user_form($edit, $user, $category) {
  $clients = array();
  if ($user->client_id) {
    foreach ($user->client_id as $client => $type) {
      $clients[$client] = '';
      $fields[$category]['name'][$client] = array(
        '#type' => 'markup',
        '#value' => _hosting_node_link($client),
      );
    }
  }
  if (user_access('edit client users')) {
    $fields[$category]['clients'] = array(
      '#type' => 'checkboxes',
      '#options' => $clients,
    );
  }
  $fields[$category]['header'] = array(
    '#type' => 'value',
    '#value' => array(
      array(
        'data' => t('Hosting client'),
      ),
      array(
        'data' => t('Remove'),
      ),
    ),
  );
  if (user_access('edit client users')) {
    $fields[$category]['hosting_client'] = array(
      '#type' => 'textfield',
      '#title' => t('Add new client'),
      '#weight' => 2,
      '#autocomplete_path' => 'hosting_client/autocomplete/client',
    );
  }
  $fields[$category]['#theme'] = 'hosting_client_user_form';
  return $fields;
}