You are here

function clients_connection_view in Web Service Clients 6

Same name and namespace in other branches
  1. 6.2 clients.connection.admin.inc \clients_connection_view()
  2. 7.3 includes/clients.connection.admin.inc \clients_connection_view()
  3. 7 clients.connection.admin.inc \clients_connection_view()
  4. 7.2 clients.connection.admin.inc \clients_connection_view()
1 string reference to 'clients_connection_view'
clients_menu in ./clients.module
Implementation of hook_menu()

File

./clients.module, line 510
Clients module - handles keys and service connections and provides an API for clients @author Django Beatty - adub

Code

function clients_connection_view($arg) {
  drupal_set_breadcrumb(array(
    l(t('Home'), NULL),
    l(t('Administer'), 'admin'),
    l(t('Site configuration'), 'admin/settings'),
    l(t('Clients'), 'admin/settings/clients'),
    l(t('Connections'), 'admin/settings/clients/connections'),
  ));
  $connection = clients_connection_load((int) $arg);

  // modules alter the connection config and edit links
  $output[] = array(
    'Name',
    $connection->name,
  );
  $output[] = array(
    'Endpoint',
    $connection->endpoint,
  );
  foreach ($connection->configuration as $label => $val) {
    if (is_array($val)) {
      $val = implode(', ', $val);

      // needs to be recursive?
    }
    $output[] = array(
      ucfirst($label),
      nl2br($val),
    );
  }
  $output[] = array(
    'Operations',
    $connection->operations,
  );
  return theme_table(array(), $output);
}