public function UserBulkForm::views_form

Provide a more useful title to improve the accessibility.

Overrides BulkFormBase::views_form

File

drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php, line 41
Contains \Drupal\user\Plugin\views\field\UserBulkForm.

Class

UserBulkForm
Defines a user operations bulk form element.

Namespace

Drupal\user\Plugin\views\field

Code

public function views_form(&$form, &$form_state) {
  parent::views_form($form, $form_state);
  if (!empty($this->view->result)) {
    foreach ($this->view->result as $row_index => $result) {
      $account = $result->_entity;
      if ($account instanceof UserInterface) {
        $form[$this->options['id']][$row_index]['#title'] = t('Update the user %name', array(
          '%name' => $account
            ->label(),
        ));
      }
    }
  }
}