You are here

protected function ClientsConnectionEntityUIController::overviewTableRow in Web Service Clients 7.3

Generates the row for the passed entity and may be overridden in order to customize the rows.

Parameters

$additional_cols: Additional columns to be added after the entity label column.

Overrides ClientsHandlerEntityUIController::overviewTableRow

File

includes/clients.ui.inc, line 252
Provides a controller for building an entity overview form.

Class

ClientsConnectionEntityUIController
UI controller class for connections.

Code

protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
  if (isset($entity->environment_substituted_by)) {

    // Machine names don't need sanitizing.
    $substitution = t('Substituted by !connection.', array(
      '!connection' => $entity->environment_substituted_by,
    ));
  }
  elseif (isset($entity->environment_substitute_for)) {
    $substitution = t('Substitute for !connection.', array(
      '!connection' => $entity->environment_substitute_for,
    ));
  }
  else {
    $substitution = '';
  }

  // Add the endpoint to the columns. Our parent class does the handler type.
  $additional_cols['substitution'] = $substitution;
  $additional_cols['endpoint'] = $entity
    ->formatEndpoint($entity->endpoint);
  $row = parent::overviewTableRow($conditions, $id, $entity, $additional_cols);

  // We have to hack these in.
  $additional_ops = array(
    l(t('test'), $this->path . '/manage/' . $id . '/test'),
  );
  array_splice($row, 5, 0, $additional_ops);
  return $row;
}