You are here

function theme_connector_buttons in Connector 7

Same name and namespace in other branches
  1. 6 connector.module \theme_connector_buttons()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 theme call to theme_connector_buttons()
connector_button_form in ./connector.module
Form for the connector buttons.

File

./connector.module, line 561
Connector module

Code

function theme_connector_buttons($variables) {
  $form = $variables['form'];
  if (!$form['#has_buttons']) {
    return NULL;
  }
  $output = '';
  $buttons = array();
  foreach (element_children($form) as $key) {
    if ($form[$key]['#type'] == 'submit') {
      $class = str_replace('_', '-', $key);
      $form[$key]['#attributes']['class'][] = 'connector-button';
      $form[$key]['#attributes']['class'][] = $class;
      $form[$key]['#prefix'] = '<span class="connector-button-wrapper ' . $class . '">';
      $form[$key]['#suffix'] = '</span>';
    }
  }
  return drupal_render_children($form);
}