You are here

public function QuickNodeCloneNodeSettingsForm::buildForm in Quick Node Clone 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 QuickNodeCloneEntitySettingsForm::buildForm

File

src/Form/QuickNodeCloneNodeSettingsForm.php, line 30

Class

QuickNodeCloneNodeSettingsForm
Module settings form.

Namespace

Drupal\quick_node_clone\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['text_to_prepend_to_title'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Text to prepend to title'),
    '#default_value' => $this
      ->getSettings('text_to_prepend_to_title'),
    '#description' => $this
      ->t('Enter text to add to the title of a cloned node to help content editors. A space will be added between this text and the title. Example: "Clone of"'),
  ];
  $form['clone_status'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Clone publication status of original?'),
    '#default_value' => $this
      ->getSettings('clone_status'),
    '#description' => $this
      ->t('If unchecked, the publication status of the clone will be equal to the default of the content type.'),
  ];
  return parent::buildForm($form, $form_state);
}