You are here

public function LinkedInSettingsForm::buildForm in Easy Social 8.3

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

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

Overrides ConfigFormBase::buildForm

File

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

Class

LinkedInSettingsForm
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.linkedin');
  $form['help'] = array(
    '#markup' => t('For more information, please check out the official @linkedin share widget <a href="@url" target="_blank">documentation</a>', array(
      '@linkedin' => t('LinkedIn'),
      '@url' => 'http://developer.linkedin.com/plugins/share-plugin-generator',
    )),
    '#weight' => -99,
  );
  $form['counter'] = array(
    '#type' => 'select',
    '#title' => t('Counter'),
    '#default_value' => $config
      ->get('counter'),
    '#options' => array(
      'top' => t('Vertical'),
      'right' => t('Horizontal'),
      'none' => t('No Count'),
    ),
  );
  $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(
      // @TODO map linkedin's language codes to drupal's.
      '' => t('Content Default'),
      'en_US' => t('English'),
      'fr_FR' => t('French'),
      'es_ES' => t('Spanish'),
      'ru_RU' => t('Russian'),
      'de_DE' => t('German'),
      'it_IT' => t('Italian'),
      'pt_BR' => t('Portuguese'),
      'ro_RO' => t('Romanian'),
      'tr_TR' => t('Turkish'),
      'ja_JP' => t('Japanese'),
      'in_ID' => t('Indonesian'),
      'ms_MY' => t('Malay'),
      'ko_KR' => t('Korean'),
      'sv_SE' => t('Swedish'),
      'cs_CZ' => t('Czech'),
      'nl_NL' => t('Dutch'),
      'pl_PL' => t('Polish'),
      'no_NO' => t('Norwegian'),
      'da_DK' => t('Danish'),
    ),
  );
  return parent::buildForm($form, $form_state);
}