summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormunavijayalakshmi2017-05-05 16:47:06 -0700
committerPat2017-05-05 16:47:06 -0700
commitdb459ad036825fecea22d33aad230a8609eb2353 (patch)
tree40e05071850067b955d74c720b8661939c107a2c
parent8cddeef4c533351c93e571b7ee63d9c774aaec61 (diff)
Issue #2875658 by Munavijayalakshmi: Use $this->t() instead of t() for object-oriented code8.x-1.x
-rw-r--r--src/Form/AddToAnySettingsForm.php46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/Form/AddToAnySettingsForm.php b/src/Form/AddToAnySettingsForm.php
index 9929679..0f93f66 100644
--- a/src/Form/AddToAnySettingsForm.php
+++ b/src/Form/AddToAnySettingsForm.php
@@ -35,8 +35,8 @@ class AddToAnySettingsForm extends ConfigFormBase {
$button_options = [
'default' => sprintf($button_img, 'a2a_32_32.svg', 32, 32, ' class="addtoany-round-icon"'),
- 'custom' => t('Custom button'),
- 'none' => t('None'),
+ 'custom' => $this->t('Custom button'),
+ 'none' => $this->t('None'),
];
$attributes_for_code = [
@@ -51,13 +51,13 @@ class AddToAnySettingsForm extends ConfigFormBase {
$form['addtoany_button_settings'] = [
'#type' => 'details',
- '#title' => t('Buttons'),
+ '#title' => $this->t('Buttons'),
'#open' => TRUE,
];
$form['addtoany_button_settings']['addtoany_buttons_size'] = [
'#type' => 'number',
- '#title' => t('Icon size'),
- '#field_suffix' => ' ' . t('pixels'),
+ '#title' => $this->t('Icon size'),
+ '#field_suffix' => ' ' . $this->t('pixels'),
'#default_value' => $addtoany_settings->get('buttons_size'),
'#size' => 10,
'#maxlength' => 3,
@@ -67,37 +67,37 @@ class AddToAnySettingsForm extends ConfigFormBase {
];
$form['addtoany_button_settings']['addtoany_service_button_settings'] = [
'#type' => 'details',
- '#title' => t('Service Buttons'),
+ '#title' => $this->t('Service Buttons'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
];
$form['addtoany_button_settings']['addtoany_service_button_settings']['addtoany_additional_html'] = [
'#type' => 'textarea',
- '#title' => t('Service Buttons HTML code'),
+ '#title' => $this->t('Service Buttons HTML code'),
'#default_value' => $addtoany_settings->get('additional_html'),
- '#description' => t('You can add HTML code to display customized <a href="https://www.addtoany.com/buttons/customize/drupal/standalone_services" target="_blank">standalone service buttons</a> next to each universal share button. For example: <br /> <code>&lt;a class=&quot;a2a_button_facebook&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_twitter&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_pinterest&quot;&gt;&lt;/a&gt;</code>
+ '#description' => $this->t('You can add HTML code to display customized <a href="https://www.addtoany.com/buttons/customize/drupal/standalone_services" target="_blank">standalone service buttons</a> next to each universal share button. For example: <br /> <code>&lt;a class=&quot;a2a_button_facebook&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_twitter&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_pinterest&quot;&gt;&lt;/a&gt;</code>
'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_button_settings']['universal_button'] = [
'#type' => 'details',
- '#title' => t('Universal Button'),
+ '#title' => $this->t('Universal Button'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
/* #states workaround in addtoany.admin.js */
];
$form['addtoany_button_settings']['universal_button']['addtoany_universal_button'] = [
'#type' => 'radios',
- '#title' => t('Button'),
+ '#title' => $this->t('Button'),
'#default_value' => $addtoany_settings->get('universal_button'),
'#attributes' => ['class' => ['addtoany-universal-button-option']],
'#options' => $button_options,
];
$form['addtoany_button_settings']['universal_button']['addtoany_custom_universal_button'] = [
'#type' => 'textfield',
- '#title' => t('Custom button URL'),
+ '#title' => $this->t('Custom button URL'),
'#default_value' => $addtoany_settings->get('custom_universal_button'),
- '#description' => t('URL of the button image. Example: http://example.com/share.png'),
+ '#description' => $this->t('URL of the button image. Example: http://example.com/share.png'),
'#states' => [
// Show only if custom button is selected
'visible' => [
@@ -107,11 +107,11 @@ class AddToAnySettingsForm extends ConfigFormBase {
];
$form['addtoany_button_settings']['universal_button']['addtoany_universal_button_placement'] = [
'#type' => 'radios',
- '#title' => t('Button placement'),
+ '#title' => $this->t('Button placement'),
'#default_value' => $addtoany_settings->get('universal_button_placement'),
'#options' => [
- 'after' => t('After the service buttons'),
- 'before' => t('Before the service buttons'),
+ 'after' => $this->t('After the service buttons'),
+ 'before' => $this->t('Before the service buttons'),
],
'#states' => [
// Hide when universal sharing is disabled
@@ -123,29 +123,29 @@ class AddToAnySettingsForm extends ConfigFormBase {
$form['addtoany_additional_settings'] = [
'#type' => 'details',
- '#title' => t('Additional options'),
+ '#title' => $this->t('Additional options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
];
$form['addtoany_additional_settings']['addtoany_additional_js'] = [
'#type' => 'textarea',
- '#title' => t('Additional JavaScript'),
+ '#title' => $this->t('Additional JavaScript'),
'#default_value' => $addtoany_settings->get('additional_js'),
- '#description' => t('You can add special JavaScript code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
+ '#description' => $this->t('You can add special JavaScript code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_additional_settings']['addtoany_additional_css'] = [
'#type' => 'textarea',
- '#title' => t('Additional CSS'),
+ '#title' => $this->t('Additional CSS'),
'#default_value' => $addtoany_settings->get('additional_css'),
- '#description' => t('You can add special CSS code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
+ '#description' => $this->t('You can add special CSS code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_additional_settings']['addtoany_no_3p'] = [
'#type' => 'checkbox',
- '#title' => t('Disable 3rd party cookies'),
+ '#title' => $this->t('Disable 3rd party cookies'),
'#default_value' => $addtoany_settings->get('no_3p'),
- '#description' => t('Disabling may affect analytics and limit some functionality.'),
+ '#description' => $this->t('Disabling may affect analytics and limit some functionality.'),
];
if (\Drupal::moduleHandler()->moduleExists('token')) {
@@ -156,7 +156,7 @@ class AddToAnySettingsForm extends ConfigFormBase {
'#click_insert' => TRUE,
'#show_restricted' => FALSE,
'#recursion_limit' => 3,
- '#text' => t('Browse available tokens'),
+ '#text' => $this->t('Browse available tokens'),
];
}