You are here

public function AdminOverviewForm::buildForm in SMS Framework 8

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 ConfigFormBase::buildForm

File

modules/sms_sendtophone/src/Form/AdminOverviewForm.php, line 24

Class

AdminOverviewForm
Defines admin overview form.

Namespace

Drupal\sms_sendtophone\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $node_types = NodeType::loadMultiple();
  $types = [];
  foreach ($node_types as $type) {
    $types[$type
      ->get('type')] = $type
      ->get('name');
  }
  $form['content_types'] = [
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Content types'),
    '#default_value' => $this
      ->config('sms_sendtophone.settings')
      ->get('content_types'),
    '#options' => $types,
    '#description' => $this
      ->t('Which content types to show the Send To Phone feature.'),
  ];
  return parent::buildForm($form, $form_state);
}