You are here

function views_ui_add_microweights in Views (for Drupal 7) 7.3

Recursively adds microweights to a render array.

Similar to what form_builder() does for forms.

@todo Submit a core patch to fix drupal_render() to do this, so that all render arrays automatically preserve array insertion order, as forms do.

1 call to views_ui_add_microweights()
views_ui_regenerate_tab in includes/admin.inc
Regenerate the current tab for AJAX updates.

File

includes/admin.inc, line 2560
Provides the Views' administrative interface.

Code

function views_ui_add_microweights(&$build) {
  $count = 0;
  foreach (element_children($build) as $key) {
    if (!isset($build[$key]['#weight'])) {
      $build[$key]['#weight'] = $count / 1000;
    }
    views_ui_add_microweights($build[$key]);
    $count++;
  }
}