class EditTexts in TacJS 8.3
Same name and namespace in other branches
- 8.6 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts
- 8.2 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts
- 8.4 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts
- 8.5 src/Form/Steps/EditTexts.php \Drupal\tacjs\Form\Steps\EditTexts
Class EditTexts.
@package Drupal\tacjs\Form
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, LinkGeneratorTrait, RedirectDestinationTrait, UrlGeneratorTrait, StringTranslationTrait
- class \Drupal\Core\Form\ConfigFormBase uses ConfigFormBaseTrait
- class \Drupal\tacjs\Form\Steps\EditTexts
- class \Drupal\Core\Form\ConfigFormBase uses ConfigFormBaseTrait
Expanded class hierarchy of EditTexts
1 string reference to 'EditTexts'
File
- src/
Form/ Steps/ EditTexts.php, line 13
Namespace
Drupal\tacjs\Form\StepsView source
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigFormBase:: |
public static | function |
Instantiates a new instance of this class. Overrides FormBase:: |
13 |
ConfigFormBase:: |
public | function | Constructs a \Drupal\system\ConfigFormBase object. | 11 |
ConfigFormBaseTrait:: |
protected | function | Retrieves a configuration object. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
EditTexts:: |
public | function |
Form constructor. Overrides ConfigFormBase:: |
|
EditTexts:: |
protected | function |
Gets the configuration names that will be editable. Overrides ConfigFormBaseTrait:: |
|
EditTexts:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
EditTexts:: |
public | function |
Form submission handler. Overrides ConfigFormBase:: |
|
FormBase:: |
protected | property | The config factory. | 1 |
FormBase:: |
protected | property | The request stack. | 1 |
FormBase:: |
protected | property | The route match. | |
FormBase:: |
protected | function | Gets the config factory for this form. | 1 |
FormBase:: |
private | function | Returns the service container. | |
FormBase:: |
protected | function | Gets the current user. | |
FormBase:: |
protected | function | Gets the request object. | |
FormBase:: |
protected | function | Gets the route match. | |
FormBase:: |
protected | function | Gets the logger for a specific channel. | |
FormBase:: |
protected | function |
Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait:: |
|
FormBase:: |
public | function | Resets the configuration factory. | |
FormBase:: |
public | function | Sets the config factory for this form. | |
FormBase:: |
public | function | Sets the request stack object to use. | |
FormBase:: |
public | function |
Form validation handler. Overrides FormInterface:: |
62 |
LinkGeneratorTrait:: |
protected | property | The link generator. | 1 |
LinkGeneratorTrait:: |
protected | function | Returns the link generator. | |
LinkGeneratorTrait:: |
protected | function | Renders a link to a route given a route name and its parameters. | |
LinkGeneratorTrait:: |
public | function | Sets the link generator service. | |
LoggerChannelTrait:: |
protected | property | The logger channel factory service. | |
LoggerChannelTrait:: |
protected | function | Gets the logger for a specific channel. | |
LoggerChannelTrait:: |
public | function | Injects the logger channel factory. | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
RedirectDestinationTrait:: |
protected | property | The redirect destination service. | 1 |
RedirectDestinationTrait:: |
protected | function | Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. | |
RedirectDestinationTrait:: |
protected | function | Returns the redirect destination service. | |
RedirectDestinationTrait:: |
public | function | Sets the redirect destination service. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
UrlGeneratorTrait:: |
protected | property | The url generator. | |
UrlGeneratorTrait:: |
protected | function | Returns the URL generator service. | |
UrlGeneratorTrait:: |
public | function | Sets the URL generator service. | |
UrlGeneratorTrait:: |
protected | function | Generates a URL or path for a specific route based on the given parameters. |