public static function ViewEditFormController::addMicroweights

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 ViewEditFormController::addMicroweights()
ViewEditFormController::rebuildCurrentTab in drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
Regenerate the current tab for AJAX updates.

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php, line 1081
Contains Drupal\views_ui\ViewEditFormController.

Class

ViewEditFormController
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

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