You are here

public function PinterestSettingsForm::buildForm in Easy Social 8.4

Same name and namespace in other branches
  1. 8.3 src/Form/PinterestSettingsForm.php \Drupal\easy_social\Form\PinterestSettingsForm::buildForm()

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfigFormBase::buildForm

File

src/Form/PinterestSettingsForm.php, line 73
Contains \Drupal\easy_social\PinterestSettingsForm.

Class

PinterestSettingsForm
Configure user settings for this site.

Namespace

Drupal\easy_social\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $type = 'new') {
  $config = $this
    ->config('easy_social.pinterest');
  $form['help'] = array(
    '#markup' => t('For more information, please check out the official @pinterest share widget <a href="@url" target="_blank">documentation</a>', array(
      '@pinterest' => t('Pinterest'),
      '@url' => 'http://business.pinterest.com/widget-builder/#do_pin_it_button',
    )),
    '#weight' => -99,
  );
  $form['config'] = array(
    '#type' => 'select',
    '#title' => t('Pin Count'),
    '#options' => array(
      'above' => t('Above the Button'),
      'beside' => t('Beside the Button'),
      'none' => t('Not Shown'),
    ),
    '#default_value' => $config
      ->get('config'),
  );
  $form['image'] = array(
    //provide a list of images?
    '#type' => 'textfield',
    '#title' => t('Image'),
    '#default_value' => $config
      ->get('image'),
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#default_value' => $config
      ->get('description'),
  );
  return parent::buildForm($form, $form_state);
}