class UserBulkForm
Same name and namespace in other branches
- 11.x core/modules/user/src/Plugin/views/field/UserBulkForm.php \Drupal\user\Plugin\views\field\UserBulkForm
Defines a user operations bulk form element.
Plugin annotation
@ViewsField("user_bulk_form");
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\field\FieldPluginBase extends \Drupal\views\Plugin\views\field\FieldHandlerInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\field\BulkForm extends \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait, \Drupal\views\Entity\Render\EntityTranslationRenderTrait implements \Drupal\views\Plugin\views\field\FieldPluginBase
- class \Drupal\user\Plugin\views\field\UserBulkForm implements \Drupal\views\Plugin\views\field\BulkForm
- class \Drupal\views\Plugin\views\field\BulkForm extends \Drupal\Core\Cache\CacheableDependencyInterface uses \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait, \Drupal\views\Entity\Render\EntityTranslationRenderTrait implements \Drupal\views\Plugin\views\field\FieldPluginBase
- class \Drupal\views\Plugin\views\field\FieldPluginBase extends \Drupal\views\Plugin\views\field\FieldHandlerInterface implements \Drupal\views\Plugin\views\HandlerBase
- class \Drupal\views\Plugin\views\HandlerBase extends \Drupal\views\Plugin\views\ViewsHandlerInterface implements \Drupal\views\Plugin\views\PluginBase
- class \Drupal\views\Plugin\views\PluginBase extends \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\views\Plugin\views\ViewsPluginInterface, \Drupal\Component\Plugin\DependentPluginInterface, \Drupal\Core\Security\TrustedCallbackInterface implements \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of UserBulkForm
1 file declares its use of UserBulkForm
- UserBulkFormTest.php in core/
modules/ user/ tests/ src/ Unit/ Plugin/ views/ field/ UserBulkFormTest.php
File
-
core/
modules/ user/ src/ Plugin/ views/ field/ UserBulkForm.php, line 14
Namespace
Drupal\user\Plugin\views\fieldView source
class UserBulkForm extends BulkForm {
/**
* {@inheritdoc}
*
* Provide a more useful title to improve the accessibility.
*/
public function viewsForm(&$form, FormStateInterface $form_state) {
parent::viewsForm($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'] = $this->t('Update the user %name', [
'%name' => $account->label(),
]);
}
}
}
}
/**
* {@inheritdoc}
*/
protected function emptySelectedMessage() {
return $this->t('No users selected.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.