You are here

public function ModuleMissingMessageFixerForm::buildForm in Module Missing Message Fixer 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/ModuleMissingMessageFixerForm.php \Drupal\module_missing_message_fixer\Form\ModuleMissingMessageFixerForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

src/Form/ModuleMissingMessageFixerForm.php, line 89

Class

ModuleMissingMessageFixerForm
Class ModuleMissingMessageFixerForm.

Namespace

Drupal\module_missing_message_fixer\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // Fancy title string.
  $title = $this
    ->t('This list comes from the system table and is checked against the drupal_get_filename() function. See <a href="@link" target="_blank">this issue</a> for more information.', [
    '@link' => 'https://www.drupal.org/node/2487215',
  ]);

  // Title.
  $form['title'] = [
    '#type' => 'item',
    '#markup' => '<h4>' . $title . '</h4>',
  ];

  // Fancy submit buttons to win this.
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Remove These Errors!'),
  ];

  // Set the tables select to make this more granular.
  $form['table'] = [
    '#type' => 'tableselect',
    '#header' => $this->mmmf
      ->getTableHeader(),
    '#options' => $this->mmmf
      ->getTableRows(),
    '#empty' => $this
      ->t('No Missing Modules Found!!!'),
  ];
  return $form;
}