You are here

function clients_connection_view in Web Service Clients 7.2

Same name and namespace in other branches
  1. 6.2 clients.connection.admin.inc \clients_connection_view()
  2. 6 clients.module \clients_connection_view()
  3. 7.3 includes/clients.connection.admin.inc \clients_connection_view()
  4. 7 clients.connection.admin.inc \clients_connection_view()

Page callback to view a single connection.

Parameters

$connection: A loaded connection.

1 string reference to 'clients_connection_view'
clients_menu in ./clients.module
Implements hook_menu()

File

./clients.connection.admin.inc, line 298
clients.connection.admin.inc Page callbacks relating to client connection admin.

Code

function clients_connection_view($connection) {

  // Build summary table.
  $rows = array();
  $rows[] = array(
    t('Name'),
    check_plain($connection->name),
  );
  $rows[] = array(
    t('Type'),
    $connection->type,
  );
  $rows[] = array(
    t('Endpoint'),
    $connection
      ->formatEndpoint($connection->endpoint),
  );
  $rows[] = array(
    t('Storage'),
    $connection->export_type_label,
  );
  foreach ($connection->configuration as $label => $val) {
    if (is_array($val)) {
      $val = implode(', ', $val);

      // needs to be recursive?
    }
    $rows[] = array(
      ucfirst(t($label)),
      nl2br(check_plain($val)),
    );
  }
  return theme('table', array(
    'rows' => $rows,
  ));
}