public function StepOneForm::buildForm in TacJS 8
Same name and namespace in other branches
- 8.2 src/Form/Steps/StepOneForm.php \Drupal\tacjs\Form\Steps\StepOneForm::buildForm()
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 FormInterface::buildForm
File
- src/
Form/ Steps/ StepOneForm.php, line 25
Class
- StepOneForm
- Class StepOneForm.
Namespace
Drupal\tacjs\Form\StepsCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = \Drupal::getContainer()
->get('config.factory')
->getEditable('tacjs.admin_settings_form');
$form['tarteaucitron'] = [
'#type' => 'details',
'#title' => $this
->t('Configuration Global Tarte au Citron'),
];
// Réseaux Sociaux.
$form['tarteaucitron']['type_social_networks'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service Réseaux Sociaux'),
'#default_value' => $config
->get('type_social_networks'),
'#options' => [
'addthis' => $this
->t('AddThis'),
'addtoany_feed' => $this
->t('AddToAny (feed)'),
'addtoany_share' => $this
->t('AddToAny (share)'),
'ekomi' => $this
->t('eKomi'),
'facebook' => $this
->t('Facebook'),
'facebook_like_box' => $this
->t('Facebook (like box)'),
'facebook_pixel' => $this
->t('Facebook Pixel'),
'googleplus' => $this
->t('Google+'),
'google_plus_badge' => $this
->t('Google+ (badge)'),
'linkedin' => $this
->t('Linkedin'),
'pinterest' => $this
->t('Pinterest'),
'shareaholic' => $this
->t('Shareaholic'),
'shareThis' => $this
->t('ShareThis'),
'twitter' => $this
->t('Twitter'),
'twitter_cards' => $this
->t('Twitter (cards)'),
'twitter_timelines' => $this
->t('Twitter (timelines)'),
],
];
// Videos.
$form['tarteaucitron']['type_video'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service Video'),
'#default_value' => $config
->get('type_video'),
'#options' => [
'calameo' => $this
->t('Calaméo'),
'dailymotion' => $this
->t('Dailymotion'),
'issuu' => $this
->t('Issuu'),
'prezi' => $this
->t('Prezi'),
'slideShare' => $this
->t('SlideShare'),
'vimeo' => $this
->t('Vimeo'),
'youtube' => $this
->t('Youtube'),
],
];
// Type API.
$form['tarteaucitron']['type_apis'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service APIs'),
'#default_value' => $config
->get('type_apis'),
'#options' => [
'google_jsapi' => $this
->t('Google jsapi'),
'google_maps' => $this
->t('Google Maps'),
'google_maps_search_query' => $this
->t('Google Maps (search query)'),
'google_tag_manager' => $this
->t('Google Tag Manager'),
'reCAPTCHA' => $this
->t('reCAPTCHA'),
'timeline_js' => $this
->t('Timeline JS'),
'typekit_adobe' => $this
->t('Typekit (adobe)'),
],
];
// Comment.
$form['tarteaucitron']['type_commentaire'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service Commentaire'),
'#default_value' => $config
->get('type_commentaire'),
'#options' => [
'DisqusInstaller' => $this
->t('Disqus'),
'facebook_commentaire' => $this
->t('Facebook (comment)'),
],
];
// Mesure d'audience.
$form['tarteaucitron']['type_mesure_audience'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service Mesure d audiance'),
'#default_value' => $config
->get('type_mesure_audience'),
'#options' => [
'alexa' => $this
->t('Alexa'),
'clicky' => $this
->t('Clicky'),
'crazyegg' => $this
->t('Crazy Egg'),
'etracker' => $this
->t('eTracker'),
'ferank' => $this
->t('FERank'),
'getplus' => $this
->t('Get+'),
'gajs' => $this
->t('Google Analytics (ga.js)'),
'gtag' => $this
->t('Google Analytics (gtag.js)'),
'multiplegtag' => $this
->t('Google Analytics (gtag.js) [for multiple UA]'),
'analytics' => $this
->t('Google Analytics (universal)'),
'koban' => $this
->t('Koban'),
'mautic' => $this
->t('Mautic'),
'microsoftcampaignanalytics' => $this
->t('Microsoft Campaign Analytics'),
'statcounter' => $this
->t('StatCounter'),
'visualrevenue' => $this
->t('VisualRevenue'),
'webmecanik' => $this
->t('Webmecanik'),
'wysistat' => $this
->t('Wysistat'),
'xiti' => $this
->t('Xiti'),
],
];
// Regie Publicitaire.
$form['tarteaucitron']['type_regie_publicitaire'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service Régie publicitaire'),
'#default_value' => $config
->get('type_regie_publicitaire'),
'#options' => [
'aduptech_ads' => $this
->t('Ad Up Technology (ads)'),
'aduptech_conversion' => $this
->t('Ad Up Technology (conversion)'),
'aduptech_retargeting' => $this
->t('Ad Up Technology (retargeting)'),
'amazon' => $this
->t('Amazon'),
'clicmanager' => $this
->t('Clicmanager'),
'criteo' => $this
->t('Criteo'),
'datingaffiliation' => $this
->t('Dating Affiliation'),
'datingaffiliationpopup' => $this
->t('Dating Affiliation (popup)'),
'ferankpub' => $this
->t('FERank (pub)'),
'adsense' => $this
->t('Google Adsense'),
'adsensesearchform' => $this
->t('Google Adsense Search (form)'),
'adsensesearchresult' => $this
->t('Google Adsense Search (result)'),
'googleadwordsconversion' => $this
->t('Google Adwords (conversion)'),
'googleadwordsremarketing' => $this
->t('Google Adwords (remarketing)'),
'googlepartners' => $this
->t('Google Partners Badge'),
'prelinker' => $this
->t('Prelinker'),
'pubdirecte' => $this
->t('Pubdirecte'),
'shareasale' => $this
->t('ShareASale'),
'twenga' => $this
->t('Twenga'),
'vshop' => $this
->t('vShop'),
],
];
// Support.
$form['tarteaucitron']['type_support'] = [
'#type' => 'select',
'#multiple' => TRUE,
'#title' => $this
->t('Sélectionner le Service support'),
'#default_value' => $config
->get('type_support'),
'#options' => [
'purechat' => $this
->t('PureChat'),
'uservoice' => $this
->t('UserVoice'),
'zopim' => $this
->t('Zopim'),
],
];
// Actions.
$form['actions']['submit']['#value'] = $this
->t('Next');
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Save'),
];
return $form;
}