You are here

public function VudAdminAdvancedSettings::buildForm in Vote Up/Down 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

src/Form/VudAdminAdvancedSettings.php, line 41

Class

VudAdminAdvancedSettings
Configures Vote Up/Down settings for this site.

Namespace

Drupal\vud\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $vud_settings = $this
    ->config('vud.settings');
  $form['vud_tag'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Voting API tag'),
    '#default_value' => $vud_settings
      ->get('tag'),
    '#description' => $this
      ->t('Since Vote Up/Down uses Voting API, all votes will be tagged with this term. (default: vote)<br />This tag is useful if you have deployed various modules that use Voting API. It should always be a unique value. Usually, there is NO need to change this.'),
  ];
  $form['vud_message_on_deny'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Message on denied permission'),
    '#default_value' => $vud_settings
      ->get('message_on_deny'),
    '#description' => $this
      ->t('When this flag is active, a modal window will be shown to the end user instead of avoid showing the voting links'),
  ];
  return parent::buildForm($form, $form_state);
}