You are here

function theme_services_client_mapping_rows in Services Client 7.2

Theme mapping widget. Mapping expects to have two columns with local and remote values. Each row of form element should have 'local' and 'remote' key. Elements will be formatted to table.

+--------------+--------------+ | Local | Remote | +--------------+--------------+ | selecbox | selectbox | +--------------+--------------+ | .... | .... | +--------------+--------------+

Parameters

array $variables: 'render element' => 'form', Element that should be rendered.

Return value

string Formatted output.

1 theme call to theme_services_client_mapping_rows()
services_client_wizard_form_mapping in ./services_client.admin.inc
Form step 3; Mapping.

File

./services_client.theme.inc, line 23

Code

function theme_services_client_mapping_rows($variables) {
  $element = $variables['form'];
  $rows = array();
  $header = array(
    t('Local'),
    t('Remote'),
  );
  foreach (element_children($element) as $key) {
    if ($key !== 'add_row') {
      unset($element[$key]['local']['#title']);
      unset($element[$key]['remote']['#title']);
      $rows[] = array(
        drupal_render($element[$key]['local']),
        drupal_render($element[$key]['remote']),
      );
    }
  }
  $output = theme('table', array(
    'rows' => $rows,
    'header' => $header,
  ));
  if (isset($element['add_row'])) {
    $output .= drupal_render($element['add_row']);
  }
  return $output;
}