function drupal_pre_render_dropbutton

Pre-render callback: Attaches the dropbutton library and required markup.

1 string reference to 'drupal_pre_render_dropbutton'
system_element_info in drupal/core/modules/system/system.module
Implements hook_element_info().

File

drupal/core/includes/common.inc, line 5257
Common functions that many Drupal modules will need to reference.

Code

function drupal_pre_render_dropbutton($element) {
  $element['#attached']['library'][] = array(
    'system',
    'drupal.dropbutton',
  );
  $element['#attributes']['class'][] = 'dropbutton';
  if (!isset($element['#theme_wrappers'])) {
    $element['#theme_wrappers'] = array();
  }
  array_unshift($element['#theme_wrappers'], 'dropbutton_wrapper');

  // Enable targeted theming of specific dropbuttons (e.g., 'operations' or
  // 'operations__node').
  if (isset($element['#subtype'])) {
    $element['#theme'] .= '__' . $element['#subtype'];
  }
  return $element;
}