WebformSubmissionBulkForm.php in Webform 6.x
File
src/Form/WebformSubmissionBulkForm.php
View source
<?php
namespace Drupal\webform\Form;
use Drupal\Core\Form\FormStateInterface;
class WebformSubmissionBulkForm extends WebformBulkFormBase {
protected $entityTypeId = 'webform_submission';
protected $submissionDeleteAny = FALSE;
public function buildForm(array $form, FormStateInterface $form_state, $table = [], $submission_delete_any = FALSE) {
$this->submissionDeleteAny = $submission_delete_any;
foreach ($table['#rows'] as $key => $row) {
$table['#rows'][$key] = $row['data'] + [
'#attributes' => [
'data-webform-href' => $row['data-webform-href'],
],
];
}
return parent::buildForm($form, $form_state, $table);
}
protected function getActions() {
$actions = parent::getActions();
if (!$this->submissionDeleteAny) {
unset($actions['webform_submission_delete_action']);
}
return $actions;
}
}