You are here

public function GooglePlusSettingsForm::buildForm in Easy Social 8.4

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

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

Overrides ConfigFormBase::buildForm

File

src/Form/GooglePlusSettingsForm.php, line 72
Contains \Drupal\easy_social\GooglePlusSettingsForm.

Class

GooglePlusSettingsForm
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.googleplus');
  $form['help'] = array(
    '#markup' => t('For more information, please check out the official @googleplus share widget <a href="@url" target="_blank">documentation</a>', array(
      '@googleplus' => t('Google+'),
      '@url' => 'https://developers.google.com/+/web/+1button',
    )),
    '#weight' => -99,
  );
  $form['size'] = array(
    '#type' => 'select',
    '#title' => t('Size'),
    '#options' => array(
      'small' => t('Small'),
      'medium' => t('Medium'),
      'large' => t('Large'),
    ),
    '#default_value' => $config
      ->get('size'),
  );
  $form['annotation'] = array(
    '#type' => 'select',
    '#title' => t('Annotation'),
    '#options' => array(
      'inline' => t('Inline'),
      'bubble' => t('Bubble'),
      'vertical-bubble' => t('Vertical Bubble'),
      'none' => t('None'),
    ),
    '#default_value' => $config
      ->get('annotation'),
  );
  $form['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width, valid only for inline (minimum 120)'),
    '#default_value' => $config
      ->get('width'),
    '#size' => 10,
  );
  $form['lang'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#description' => t('Content Default will use either the current content\'s or Drupal\'s language'),
    '#default_value' => $config
      ->get('lang'),
    '#options' => array(
      '' => t('Content Default'),
    ),
  );
  return parent::buildForm($form, $form_state);
}