ViewsBulkOperationsFormTrait.php in Views Bulk Operations (VBO) 8
File
src/Form/ViewsBulkOperationsFormTrait.php
View source
<?php
namespace Drupal\views_bulk_operations\Form;
trait ViewsBulkOperationsFormTrait {
protected function getFormData($view_id, $display_id) {
$tempstore_name = 'views_bulk_operations_' . $view_id . '_' . $display_id;
$tempstore = $this->tempStoreFactory
->get($tempstore_name);
$form_data = $tempstore
->get($this
->currentUser()
->id());
$form_data['tempstore_name'] = $tempstore_name;
if (!empty($form_data['entity_labels'])) {
$form_data['selected_count'] = count($form_data['entity_labels']);
}
elseif ($form_data['total_results']) {
$form_data['selected_count'] = $form_data['total_results'];
}
else {
$form_data['selected_count'] = (string) $this
->t('all');
}
return $form_data;
}
}