You are here

EditTexts.php in TacJS 8.3

File

src/Form/Steps/EditTexts.php
View source
<?php

namespace Drupal\tacjs\Form\Steps;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Class EditTexts.
 *
 * @package Drupal\tacjs\Form
 */
class EditTexts extends ConfigFormBase {

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'tacjs_edit_texts';
  }

  /**
   * {@inheritdoc}
   */
  protected function getEditableConfigNames() {
    return [
      'tacjs.settings',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this
      ->config('tacjs.settings');
    $form['middleBarHead'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Middle Bar Head'),
      '#default_value' => $config
        ->get('texts.middleBarHead'),
    ];
    $form['adblock'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Adblock'),
      '#default_value' => $config
        ->get('texts.adblock'),
    ];
    $form['adblock_call'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Adblock Call'),
      '#default_value' => $config
        ->get('texts.adblock_call'),
    ];
    $form['reload'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Reload'),
      '#default_value' => $config
        ->get('texts.reload'),
    ];
    $form['alertBigScroll'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Alert Big Scroll'),
      '#default_value' => $config
        ->get('texts.alertBigScroll'),
    ];
    $form['alertBigClick'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Alert Big Click'),
      '#default_value' => $config
        ->get('texts.alertBigClick'),
    ];
    $form['alertBig'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('AlertBig'),
      '#default_value' => $config
        ->get('texts.alertBig'),
    ];
    $form['alertBigPrivacy'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Alert Big Privacy'),
      '#default_value' => $config
        ->get('texts.alertBigPrivacy'),
    ];
    $form['alertSmall'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Alert Small'),
      '#default_value' => $config
        ->get('texts.alertSmall'),
    ];
    $form['personalize'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Personalize'),
      '#default_value' => $config
        ->get('texts.personalize'),
    ];
    $form['acceptAll'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Accept All'),
      '#default_value' => $config
        ->get('texts.acceptAll'),
    ];
    $form['close'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Close'),
      '#default_value' => $config
        ->get('texts.close'),
    ];
    $form['privacyUrl'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Privacy Url'),
      '#default_value' => $config
        ->get('texts.privacyUrl'),
    ];
    $form['all'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('All'),
      '#default_value' => $config
        ->get('texts.all'),
    ];
    $form['info'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Info'),
      '#default_value' => $config
        ->get('texts.info'),
    ];
    $form['disclaimer'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Disclaimer'),
      '#default_value' => $config
        ->get('texts.disclaimer'),
    ];
    $form['allow'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Allow'),
      '#default_value' => $config
        ->get('texts.allow'),
    ];
    $form['deny'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Deny'),
      '#default_value' => $config
        ->get('texts.deny'),
    ];
    $form['noCookie'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('No Cookie'),
      '#default_value' => $config
        ->get('texts.noCookie'),
    ];
    $form['useCookie'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Use Cookie'),
      '#default_value' => $config
        ->get('texts.useCookie'),
    ];
    $form['useCookieCurrent'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Use Cookie Current'),
      '#default_value' => $config
        ->get('texts.useCookieCurrent'),
    ];
    $form['useNoCookie'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Use No Cookie'),
      '#default_value' => $config
        ->get('texts.useNoCookie'),
    ];
    $form['more'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('More'),
      '#default_value' => $config
        ->get('texts.more'),
    ];
    $form['source'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Source'),
      '#default_value' => $config
        ->get('texts.source'),
    ];
    $form['credit'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Credit'),
      '#default_value' => $config
        ->get('texts.credit'),
    ];
    $form['noServices'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('No Services'),
      '#default_value' => $config
        ->get('texts.noServices'),
    ];
    $form['toggleInfoBox'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Toggle Info Box'),
      '#default_value' => $config
        ->get('texts.toggleInfoBox'),
    ];
    $form['title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Title'),
      '#default_value' => $config
        ->get('texts.title'),
    ];
    $form['cookieDetail'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Cookie Detail'),
      '#default_value' => $config
        ->get('texts.cookieDetail'),
    ];
    $form['ourSite'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Our Site'),
      '#default_value' => $config
        ->get('texts.ourSite'),
    ];
    $form['newWindow'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('New Window'),
      '#default_value' => $config
        ->get('texts.newWindow'),
    ];
    $form['allowAll'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Allow All'),
      '#default_value' => $config
        ->get('texts.allowAll'),
    ];
    $form['denyAll'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Deny All'),
      '#default_value' => $config
        ->get('texts.denyAll'),
    ];
    $form['fallback'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Fallback'),
      '#default_value' => $config
        ->get('texts.fallback'),
    ];
    $form['ads_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Ads Title'),
      '#default_value' => $config
        ->get('texts.ads.title'),
    ];
    $form['ads_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Ads Details'),
      '#default_value' => $config
        ->get('texts.ads.details'),
    ];
    $form['analytic_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Analytic Title'),
      '#default_value' => $config
        ->get('texts.analytic.title'),
    ];
    $form['analytic_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Analytic Details'),
      '#default_value' => $config
        ->get('texts.analytic.details'),
    ];
    $form['social_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Social Title'),
      '#default_value' => $config
        ->get('texts.social.title'),
    ];
    $form['social_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Social Details'),
      '#default_value' => $config
        ->get('texts.social.details'),
    ];
    $form['video_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Video Title'),
      '#default_value' => $config
        ->get('texts.video.title'),
    ];
    $form['video_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Video Details'),
      '#default_value' => $config
        ->get('texts.video.details'),
    ];
    $form['comment_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Comment Title'),
      '#default_value' => $config
        ->get('texts.comment.title'),
    ];
    $form['comment_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Comment Details'),
      '#default_value' => $config
        ->get('texts.comment.details'),
    ];
    $form['support_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Support Title'),
      '#default_value' => $config
        ->get('texts.support.title'),
    ];
    $form['support_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Support Details'),
      '#default_value' => $config
        ->get('texts.support.details'),
    ];
    $form['api_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Api Title'),
      '#default_value' => $config
        ->get('texts.api.title'),
    ];
    $form['api_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Api Details'),
      '#default_value' => $config
        ->get('texts.api.details'),
    ];
    $form['other_title'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Other Title'),
      '#default_value' => $config
        ->get('texts.other.title'),
    ];
    $form['other_details'] = [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Other Details'),
      '#default_value' => $config
        ->get('texts.other.details'),
    ];
    return parent::buildForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $config = $this
      ->config('tacjs.settings');
    $config
      ->set('texts.middleBarHead', $form_state
      ->getValue('middleBarHead'))
      ->set('texts.adblock', $form_state
      ->getValue('adblock'))
      ->set('texts.adblock_call', $form_state
      ->getValue('adblock_call'))
      ->set('texts.reload', $form_state
      ->getValue('reload'))
      ->set('texts.alertBigScroll', $form_state
      ->getValue('alertBigScroll'))
      ->set('texts.alertBigClick', $form_state
      ->getValue('alertBigClick'))
      ->set('texts.alertBig', $form_state
      ->getValue('alertBig'))
      ->set('texts.alertBigPrivacy', $form_state
      ->getValue('alertBigPrivacy'))
      ->set('texts.alertSmall', $form_state
      ->getValue('alertSmall'))
      ->set('texts.personalize', $form_state
      ->getValue('personalize'))
      ->set('texts.acceptAll', $form_state
      ->getValue('acceptAll'))
      ->set('texts.close', $form_state
      ->getValue('close'))
      ->set('texts.privacyUrl', $form_state
      ->getValue('privacyUrl'))
      ->set('texts.all', $form_state
      ->getValue('all'))
      ->set('texts.info', $form_state
      ->getValue('info'))
      ->set('texts.disclaimer', $form_state
      ->getValue('disclaimer'))
      ->set('texts.allow', $form_state
      ->getValue('allow'))
      ->set('texts.deny', $form_state
      ->getValue('deny'))
      ->set('texts.noCookie', $form_state
      ->getValue('noCookie'))
      ->set('texts.useCookie', $form_state
      ->getValue('useCookie'))
      ->set('texts.useCookieCurrent', $form_state
      ->getValue('useCookieCurrent'))
      ->set('texts.useNoCookie', $form_state
      ->getValue('useNoCookie'))
      ->set('texts.more', $form_state
      ->getValue('more'))
      ->set('texts.source', $form_state
      ->getValue('source'))
      ->set('texts.credit', $form_state
      ->getValue('credit'))
      ->set('texts.noServices', $form_state
      ->getValue('noServices'))
      ->set('texts.toggleInfoBox', $form_state
      ->getValue('toggleInfoBox'))
      ->set('texts.title', $form_state
      ->getValue('title'))
      ->set('texts.cookieDetail', $form_state
      ->getValue('cookieDetail'))
      ->set('texts.ourSite', $form_state
      ->getValue('ourSite'))
      ->set('texts.newWindow', $form_state
      ->getValue('newWindow'))
      ->set('texts.allowAll', $form_state
      ->getValue('allowAll'))
      ->set('texts.denyAll', $form_state
      ->getValue('denyAll'))
      ->set('texts.fallback', $form_state
      ->getValue('fallback'))
      ->set('texts.ads.title', $form_state
      ->getValue('ads_title'))
      ->set('texts.ads.details', $form_state
      ->getValue('ads_details'))
      ->set('texts.analytic.title', $form_state
      ->getValue('analytic_title'))
      ->set('texts.analytic.details', $form_state
      ->getValue('analytic_details'))
      ->set('texts.social.title', $form_state
      ->getValue('social_title'))
      ->set('texts.social.details', $form_state
      ->getValue('social_details'))
      ->set('texts.video.title', $form_state
      ->getValue('video_title'))
      ->set('texts.video.details', $form_state
      ->getValue('video_details'))
      ->set('texts.comment.title', $form_state
      ->getValue('comment_title'))
      ->set('texts.comment.details', $form_state
      ->getValue('comment_details'))
      ->set('texts.support.title', $form_state
      ->getValue('support_title'))
      ->set('texts.support.details', $form_state
      ->getValue('support_details'))
      ->set('texts.api.title', $form_state
      ->getValue('api_title'))
      ->set('texts.api.details', $form_state
      ->getValue('api_details'))
      ->set('texts.other.title', $form_state
      ->getValue('other_title'))
      ->set('texts.other.details', $form_state
      ->getValue('other_details'))
      ->save();
    parent::submitForm($form, $form_state);
  }

}

Classes

Namesort descending Description
EditTexts Class EditTexts.