You are here

function theme_currency_form_currency_exchanger in Currency 7.2

Implements theme function: themes the currency exchanger overview form.

See also

currency_form_currency_exchangers()

File

currency/currency.module, line 822
Provides currency information and allows users to add custom currencies.

Code

function theme_currency_form_currency_exchanger(array $variables) {
  drupal_add_tabledrag('currency-exchangers', 'order', 'sibling', 'form-select');
  $header = array(
    t('Title'),
    t('Enabled'),
    t('Weight'),
    t('Operations'),
  );
  $rows = array();
  $names = element_children($variables['form']['exchangers']);
  foreach ($names as $name) {
    $elements =& $variables['form']['exchangers'][$name];
    $row_data = array();
    foreach (array(
      'title',
      'enabled',
      'weight',
      'operations',
    ) as $key) {
      $elements[$key]['#title_display'] = 'invisible';
      $row_data[] = drupal_render($elements[$key]);
    }
    $rows[] = array(
      'class' => array(
        'draggable',
      ),
      'data' => $row_data,
    );
  }
  return theme('table', array(
    'attributes' => array(
      'id' => 'currency-exchangers',
    ),
    'header' => $header,
    'rows' => $rows,
  )) . drupal_render_children($variables['form']);
}