class UserBulkForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Plugin/views/field/UserBulkForm.php \Drupal\user\Plugin\views\field\UserBulkForm
- 9 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\views\Plugin\views\field\BulkForm extends \Drupal\views\Plugin\views\field\FieldPluginBase implements CacheableDependencyInterface uses RedirectDestinationTrait, EntityTranslationRenderTrait, UncacheableFieldHandlerTrait
- class \Drupal\user\Plugin\views\field\UserBulkForm
Expanded class hierarchy of UserBulkForm
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.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BulkForm:: |
protected | property | An array of actions that can be executed. | |
BulkForm:: |
protected | property | The action storage. | |
BulkForm:: |
protected | property | The entity repository service. | |
BulkForm:: |
protected | property | The entity type manager. | |
BulkForm:: |
protected | property | The language manager. | |
BulkForm:: |
protected | property | The messenger. | |
BulkForm:: |
public | function | ||
BulkForm:: |
protected | function | Calculates a bulk form key. | |
BulkForm:: |
public | function | ||
BulkForm:: |
public static | function | ||
BulkForm:: |
protected | function | ||
BulkForm:: |
protected | function | Returns the available operations for this form. | |
BulkForm:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
BulkForm:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
BulkForm:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
BulkForm:: |
protected | function | ||
BulkForm:: |
public | function |
Returns the entity type identifier. Overrides EntityTranslationRenderTrait:: |
|
BulkForm:: |
protected | function | ||
BulkForm:: |
protected | function |
Returns the language manager. Overrides EntityTranslationRenderTrait:: |
|
BulkForm:: |
public | function |
Overrides UncacheableFieldHandlerTrait:: |
|
BulkForm:: |
protected | function |
Returns the top object of a view. Overrides EntityTranslationRenderTrait:: |
|
BulkForm:: |
public | function | ||
BulkForm:: |
protected | function | Loads an entity based on a bulk form key. | |
BulkForm:: |
public | function | ||
BulkForm:: |
public | function | ||
BulkForm:: |
public | function | ||
BulkForm:: |
public | function | Submit handler for the bulk form. | |
BulkForm:: |
public | function | ||
BulkForm:: |
public | function | Constructs a new BulkForm object. | |
EntityTranslationRenderTrait:: |
protected | property | The renderer to be used to render the entity row. | |
EntityTranslationRenderTrait:: |
public | function | Returns the entity translation matching the configured row language. | |
EntityTranslationRenderTrait:: |
protected | function | Returns the current renderer. | |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
UncacheableFieldHandlerTrait:: |
protected | function | Actually renders the field markup. | |
UncacheableFieldHandlerTrait:: |
abstract protected | function | ||
UncacheableFieldHandlerTrait:: |
public | function | ||
UncacheableFieldHandlerTrait:: |
public | function | ||
UserBulkForm:: |
protected | function |
Returns the message to be displayed when there are no selected items. Overrides BulkForm:: |
|
UserBulkForm:: |
public | function |
Provide a more useful title to improve the accessibility. Overrides BulkForm:: |