You are here

function clients_connection_view in Web Service Clients 7

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.2 clients.connection.admin.inc \clients_connection_view()

Page callback to view a single connection.

Parameters

$cid: The id of a connection.

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

File

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

Code

function clients_connection_view($cid) {

  // Load the connection.
  $connection = clients_connection_load($cid);

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

      // needs to be recursive?
    }
    $rows[] = array(
      ucfirst(check_plain($label)),
      nl2br(check_plain($val)),
    );
  }
  $operations = array(
    'edit' => l('edit', 'admin/settings/clients/connections/edit/' . $cid),
    'test' => l('test', 'admin/settings/clients/connections/test/' . $cid),
    'delete' => l('delete', 'admin/settings/clients/connections/delete/' . $cid),
  );
  $rows[] = array(
    'Operations',
    implode(' | ', $operations),
  );
  return theme_table(array(), $rows);
}