Commit d6dbe637 authored by Chandan Chaudhary's avatar Chandan Chaudhary Committed by frjo
Browse files

Issue #2755773 by Chandan Chaudhary: Replacing t function with $this->t in class file

parent 3f5650bc
......@@ -83,10 +83,10 @@ class ColorboxAttachment implements ElementAttachmentInterface {
else {
$js_settings = array(
'opacity' => '0.85',
'current' => t('{current} of {total}'),
'previous' => t('« Prev'),
'next' => t('Next »'),
'close' => t('Close'),
'current' => $this->t('{current} of {total}'),
'previous' => $this->t('« Prev'),
'next' => $this->t('Next »'),
'close' => $this->t('Close'),
'maxWidth' => '98%',
'maxHeight' => '98%',
'fixed' => TRUE,
......
......@@ -43,214 +43,214 @@ class ColorboxSettingsForm extends ConfigFormBase {
$form['colorbox_custom_settings'] = array(
'#type' => 'details',
'#title' => t('Styles and options'),
'#title' => $this->t('Styles and options'),
'#open' => TRUE,
);
$colorbox_styles = array(
'default' => t('Default'),
'plain' => t('Plain (mainly for images)'),
'stockholmsyndrome' => t('Stockholm Syndrome'),
'example1' => t('Example 1'),
'example2' => t('Example 2'),
'example3' => t('Example 3'),
'example4' => t('Example 4'),
'example5' => t('Example 5'),
'none' => t('None'),
'default' => $this->t('Default'),
'plain' => $this->t('Plain (mainly for images)'),
'stockholmsyndrome' => $this->t('Stockholm Syndrome'),
'example1' => $this->t('Example 1'),
'example2' => $this->t('Example 2'),
'example3' => $this->t('Example 3'),
'example4' => $this->t('Example 4'),
'example5' => $this->t('Example 5'),
'none' => $this->t('None'),
);
$form['colorbox_custom_settings']['colorbox_style'] = array(
'#type' => 'select',
'#title' => t('Style'),
'#title' => $this->t('Style'),
'#options' => $colorbox_styles,
'#default_value' => $config->get('custom.style'),
'#description' => t('Select the style to use for the Colorbox. The example styles are the ones that come with the Colorbox plugin. Select "None" if you have added Colorbox styles to your theme.'),
'#description' => $this->t('Select the style to use for the Colorbox. The example styles are the ones that come with the Colorbox plugin. Select "None" if you have added Colorbox styles to your theme.'),
);
$form['colorbox_custom_settings']['colorbox_custom_settings_activate'] = array(
'#type' => 'radios',
'#title' => t('Options'),
'#options' => array(0 => t('Default'), 1 => t('Custom')),
'#title' => $this->t('Options'),
'#options' => array(0 => $this->t('Default'), 1 => $this->t('Custom')),
'#default_value' => $config->get('custom.activate'),
'#description' => t('Use the default or custom options for Colorbox.'),
'#description' => $this->t('Use the default or custom options for Colorbox.'),
);
$form['colorbox_custom_settings']['colorbox_transition_type'] = array(
'#type' => 'radios',
'#title' => t('Transition type'),
'#options' => array('elastic' => t('Elastic'), 'fade' => t('Fade'), 'none' => t('None')),
'#title' => $this->t('Transition type'),
'#options' => array('elastic' => $this->t('Elastic'), 'fade' => $this->t('Fade'), 'none' => $this->t('None')),
'#default_value' => $config->get('custom.transition_type'),
'#description' => t('The transition type.'),
'#description' => $this->t('The transition type.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_transition_speed'] = array(
'#type' => 'select',
'#title' => t('Transition speed'),
'#title' => $this->t('Transition speed'),
'#options' => $this->optionsRange(100, 600, 50),
'#default_value' => $config->get('custom.transition_speed'),
'#description' => t('Sets the speed of the fade and elastic transitions, in milliseconds.'),
'#description' => $this->t('Sets the speed of the fade and elastic transitions, in milliseconds.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_opacity'] = array(
'#type' => 'select',
'#title' => t('Opacity'),
'#title' => $this->t('Opacity'),
'#options' => $this->optionsRange(0, 1, 0.05),
'#default_value' => $config->get('custom.opacity'),
'#description' => t('The overlay opacity level. Range: 0 to 1.'),
'#description' => $this->t('The overlay opacity level. Range: 0 to 1.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_text_current'] = array(
'#type' => 'textfield',
'#title' => t('Current'),
'#title' => $this->t('Current'),
'#default_value' => $config->get('custom.text_current'),
'#size' => 30,
'#description' => t('Text format for the content group / gallery count. {current} and {total} are detected and replaced with actual numbers while Colorbox runs.'),
'#description' => $this->t('Text format for the content group / gallery count. {current} and {total} are detected and replaced with actual numbers while Colorbox runs.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_text_previous'] = array(
'#type' => 'textfield',
'#title' => t('Previous'),
'#title' => $this->t('Previous'),
'#default_value' => $config->get('custom.text_previous'),
'#size' => 30,
'#description' => t('Text for the previous button in a shared relation group.'),
'#description' => $this->t('Text for the previous button in a shared relation group.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_text_next'] = array(
'#type' => 'textfield',
'#title' => t('Next'),
'#title' => $this->t('Next'),
'#default_value' => $config->get('custom.text_next'),
'#size' => 30,
'#description' => t('Text for the next button in a shared relation group.'),
'#description' => $this->t('Text for the next button in a shared relation group.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_text_close'] = array(
'#type' => 'textfield',
'#title' => t('Close'),
'#title' => $this->t('Close'),
'#default_value' => $config->get('custom.text_close'),
'#size' => 30,
'#description' => t('Text for the close button. The "Esc" key will also close Colorbox.'),
'#description' => $this->t('Text for the close button. The "Esc" key will also close Colorbox.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_maxwidth'] = array(
'#type' => 'textfield',
'#title' => t('Max width'),
'#title' => $this->t('Max width'),
'#default_value' => $config->get('custom.maxwidth'),
'#size' => 30,
'#description' => t('Set a maximum width for loaded content. Example: "100%", 500, "500px".'),
'#description' => $this->t('Set a maximum width for loaded content. Example: "100%", 500, "500px".'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_maxheight'] = array(
'#type' => 'textfield',
'#title' => t('Max height'),
'#title' => $this->t('Max height'),
'#default_value' => $config->get('custom.maxheight'),
'#size' => 30,
'#description' => t('Set a maximum height for loaded content. Example: "100%", 500, "500px".'),
'#description' => $this->t('Set a maximum height for loaded content. Example: "100%", 500, "500px".'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_initialwidth'] = array(
'#type' => 'textfield',
'#title' => t('Initial width'),
'#title' => $this->t('Initial width'),
'#default_value' => $config->get('custom.initialwidth'),
'#size' => 30,
'#description' => t('Set the initial width, prior to any content being loaded. Example: "100%", 500, "500px".'),
'#description' => $this->t('Set the initial width, prior to any content being loaded. Example: "100%", 500, "500px".'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_initialheight'] = array(
'#type' => 'textfield',
'#title' => t('Initial height'),
'#title' => $this->t('Initial height'),
'#default_value' => $config->get('custom.initialheight'),
'#size' => 30,
'#description' => t('Set the initial height, prior to any content being loaded. Example: "100%", 500, "500px".'),
'#description' => $this->t('Set the initial height, prior to any content being loaded. Example: "100%", 500, "500px".'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_overlayclose'] = array(
'#type' => 'checkbox',
'#title' => t('Overlay close'),
'#title' => $this->t('Overlay close'),
'#default_value' => $config->get('custom.overlayclose'),
'#description' => t('Enable closing Colorbox by clicking on the background overlay.'),
'#description' => $this->t('Enable closing Colorbox by clicking on the background overlay.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_fixed'] = array(
'#type' => 'checkbox',
'#title' => t('Fixed'),
'#title' => $this->t('Fixed'),
'#default_value' => $config->get('custom.fixed'),
'#description' => t('If the Colorbox should be displayed in a fixed position within the visitor\'s viewport or relative to the document.'),
'#description' => $this->t('If the Colorbox should be displayed in a fixed position within the visitor\'s viewport or relative to the document.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_scrolling'] = array(
'#type' => 'checkbox',
'#title' => t('Scrollbars'),
'#title' => $this->t('Scrollbars'),
'#default_value' => $config->get('custom.scrolling'),
'#description' => t('If unchecked, Colorbox will hide scrollbars for overflowing content. This could be used on conjunction with the resize method for a smoother transition if you are appending content to an already open instance of Colorbox.'),
'#description' => $this->t('If unchecked, Colorbox will hide scrollbars for overflowing content. This could be used on conjunction with the resize method for a smoother transition if you are appending content to an already open instance of Colorbox.'),
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings'] = array(
'#type' => 'details',
'#title' => t('Slideshow settings'),
'#title' => $this->t('Slideshow settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#states' => $this->getState(static::STATE_CUSTOM_SETTINGS),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshow'] = array(
'#type' => 'radios',
'#title' => t('Slideshow'),
'#options' => array(0 => t('Off'), 1 => t('On')),
'#title' => $this->t('Slideshow'),
'#options' => array(0 => $this->t('Off'), 1 => $this->t('On')),
'#default_value' => $config->get('custom.slideshow.slideshow'),
'#description' => t('An automatic slideshow to a content group / gallery.'),
'#description' => $this->t('An automatic slideshow to a content group / gallery.'),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshowauto'] = array(
'#type' => 'checkbox',
'#title' => t('Slideshow autostart'),
'#title' => $this->t('Slideshow autostart'),
'#default_value' => $config->get('custom.slideshow.auto'),
'#description' => t('If the slideshow should automatically start to play.'),
'#description' => $this->t('If the slideshow should automatically start to play.'),
'#states' => $this->getState(static::STATE_SLIDESHOW_ENABLED),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_slideshowspeed'] = array(
'#type' => 'select',
'#title' => t('Slideshow speed'),
'#title' => $this->t('Slideshow speed'),
'#options' => $this->optionsRange(1000, 6000, 500),
'#default_value' => $config->get('custom.slideshow.speed'),
'#description' => t('Sets the speed of the slideshow, in milliseconds.'),
'#description' => $this->t('Sets the speed of the slideshow, in milliseconds.'),
'#states' => $this->getState(static::STATE_SLIDESHOW_ENABLED),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_text_start'] = array(
'#type' => 'textfield',
'#title' => t('Start slideshow'),
'#title' => $this->t('Start slideshow'),
'#default_value' => $config->get('custom.slideshow.text_start'),
'#size' => 30,
'#description' => t('Text for the slideshow start button.'),
'#description' => $this->t('Text for the slideshow start button.'),
'#states' => $this->getState(static::STATE_SLIDESHOW_ENABLED),
);
$form['colorbox_custom_settings']['colorbox_slideshow_settings']['colorbox_text_stop'] = array(
'#type' => 'textfield',
'#title' => t('Stop slideshow'),
'#title' => $this->t('Stop slideshow'),
'#default_value' => $config->get('custom.slideshow.text_stop'),
'#size' => 30,
'#description' => t('Text for the slideshow stop button.'),
'#description' => $this->t('Text for the slideshow stop button.'),
'#states' => $this->getState(static::STATE_SLIDESHOW_ENABLED),
);
$form['colorbox_advanced_settings'] = array(
'#type' => 'details',
'#title' => t('Advanced settings'),
'#title' => $this->t('Advanced settings'),
);
$form['colorbox_advanced_settings']['colorbox_unique_token'] = array(
'#type' => 'radios',
'#title' => t('Unique per-request gallery token'),
'#options' => array(1 => t('On'), 0 => t('Off')),
'#title' => $this->t('Unique per-request gallery token'),
'#options' => array(1 => $this->t('On'), 0 => $this->t('Off')),
'#default_value' => $config->get('advanced.unique_token'),
'#description' => t('If On (default), Colorbox will add a unique per-request token to the gallery id to avoid images being added manually to galleries. The token was added as a security fix but some see the old behavoiur as an feature and this settings makes it possible to remove the token.'),
'#description' => $this->t('If On (default), Colorbox will add a unique per-request token to the gallery id to avoid images being added manually to galleries. The token was added as a security fix but some see the old behavoiur as an feature and this settings makes it possible to remove the token.'),
);
$form['colorbox_advanced_settings']['colorbox_mobile_detect'] = array(
'#type' => 'radios',
'#title' => t('Mobile detection'),
'#options' => array(1 => t('On'), 0 => t('Off')),
'#title' => $this->t('Mobile detection'),
'#options' => array(1 => $this->t('On'), 0 => $this->t('Off')),
'#default_value' => $config->get('advanced.mobile_detect'),
'#description' => t('If on (default) Colorbox will not be active for devices with a the max width set below.'),
'#description' => $this->t('If on (default) Colorbox will not be active for devices with a the max width set below.'),
);
$form['colorbox_advanced_settings']['colorbox_mobile_device_width'] = array(
'#type' => 'textfield',
'#title' => t('Device with'),
'#title' => $this->t('Device with'),
'#default_value' => $config->get('advanced.mobile_device_width'),
'#size' => 30,
'#description' => t('Set the mobile device max with. Default: 480px.'),
'#description' => $this->t('Set the mobile device max with. Default: 480px.'),
'#states' => array(
'visible' => array(
':input[name="colorbox_mobile_detect"]' => array('value' => '1'),
......@@ -259,14 +259,14 @@ class ColorboxSettingsForm extends ConfigFormBase {
);
$form['colorbox_advanced_settings']['colorbox_caption_trim'] = array(
'#type' => 'radios',
'#title' => t('Caption shortening'),
'#options' => array(0 => t('Default'), 1 => t('Yes')),
'#title' => $this->t('Caption shortening'),
'#options' => array(0 => $this->t('Default'), 1 => $this->t('Yes')),
'#default_value' => $config->get('advanced.caption_trim'),
'#description' => t('If the caption should be made shorter in the Colorbox to avoid layout problems. The default is to shorten for the example styles, they need it, but not for other styles.'),
'#description' => $this->t('If the caption should be made shorter in the Colorbox to avoid layout problems. The default is to shorten for the example styles, they need it, but not for other styles.'),
);
$form['colorbox_advanced_settings']['colorbox_caption_trim_length'] = array(
'#type' => 'select',
'#title' => t('Caption max length'),
'#title' => $this->t('Caption max length'),
'#options' => $this->optionsRange(40, 120, 5),
'#default_value' => $config->get('advanced.caption_trim_length'),
'#states' => array(
......@@ -277,10 +277,10 @@ class ColorboxSettingsForm extends ConfigFormBase {
);
$form['colorbox_advanced_settings']['colorbox_compression_type'] = array(
'#type' => 'radios',
'#title' => t('Choose Colorbox compression level'),
'#title' => $this->t('Choose Colorbox compression level'),
'#options' => array(
'minified' => t('Production (Minified)'),
'source' => t('Development (Uncompressed Code)'),
'minified' => $this->t('Production (Minified)'),
'source' => $this->t('Development (Uncompressed Code)'),
),
'#default_value' => $config->get('advanced.compression_type'),
);
......
......@@ -99,53 +99,53 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
public function settingsForm(array $form, FormStateInterface $form_state) {
$image_styles = image_style_options(FALSE);
$image_styles_hide = $image_styles;
$image_styles_hide['hide'] = t('Hide (do not display image)');
$image_styles_hide['hide'] = $this->t('Hide (do not display image)');
$element['colorbox_node_style'] = array(
'#title' => t('Content image style'),
'#title' => $this->t('Content image style'),
'#type' => 'select',
'#default_value' => $this->getSetting('colorbox_node_style'),
'#empty_option' => t('None (original image)'),
'#empty_option' => $this->t('None (original image)'),
'#options' => $image_styles_hide,
'#description' => t('Image style to use in the content.'),
'#description' => $this->t('Image style to use in the content.'),
);
$element['colorbox_node_style_first'] = array(
'#title' => t('Content image style for first image'),
'#title' => $this->t('Content image style for first image'),
'#type' => 'select',
'#default_value' => $this->getSetting('colorbox_node_style_first'),
'#empty_option' => t('No special style.'),
'#empty_option' => $this->t('No special style.'),
'#options' => $image_styles,
'#description' => t('Image style to use in the content for the first image.'),
'#description' => $this->t('Image style to use in the content for the first image.'),
);
$element['colorbox_image_style'] = array(
'#title' => t('Colorbox image style'),
'#title' => $this->t('Colorbox image style'),
'#type' => 'select',
'#default_value' => $this->getSetting('colorbox_image_style'),
'#empty_option' => t('None (original image)'),
'#empty_option' => $this->t('None (original image)'),
'#options' => $image_styles,
'#description' => t('Image style to use in the Colorbox.'),
'#description' => $this->t('Image style to use in the Colorbox.'),
);
$gallery = array(
'post' => t('Per post gallery'),
'page' => t('Per page gallery'),
'field_post' => t('Per field in post gallery'),
'field_page' => t('Per field in page gallery'),
'custom' => t('Custom (with tokens)'),
'none' => t('No gallery'),
'post' => $this->t('Per post gallery'),
'page' => $this->t('Per page gallery'),
'field_post' => $this->t('Per field in post gallery'),
'field_page' => $this->t('Per field in page gallery'),
'custom' => $this->t('Custom (with tokens)'),
'none' => $this->t('No gallery'),
);
$element['colorbox_gallery'] = array(
'#title' => t('Gallery (image grouping)'),
'#title' => $this->t('Gallery (image grouping)'),
'#type' => 'select',
'#default_value' => $this->getSetting('colorbox_gallery'),
'#options' => $gallery,
'#description' => t('How Colorbox should group the image galleries.'),
'#description' => $this->t('How Colorbox should group the image galleries.'),
);
$element['colorbox_gallery_custom'] = array(
'#title' => t('Custom gallery'),
'#title' => $this->t('Custom gallery'),
'#type' => 'textfield',
'#default_value' => $this->getSetting('colorbox_gallery_custom'),
'#description' => t('All images on a page with the same gallery value (rel attribute) will be grouped together. It must only contain lowercase letters, numbers, and underscores.'),
'#description' => $this->t('All images on a page with the same gallery value (rel attribute) will be grouped together. It must only contain lowercase letters, numbers, and underscores.'),
'#required' => FALSE,
'#states' => array(
'visible' => array(
......@@ -155,8 +155,8 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
);
$element['colorbox_token_gallery'] = array(
'#type' => 'fieldset',
'#title' => t('Replacement patterns'),
'#description' => '<strong class="error">' . t('For token support the <a href="@token_url">token module</a> must be installed.', array('@token_url' => 'http://drupal.org/project/token')) . '</strong>',
'#title' => $this->t('Replacement patterns'),
'#description' => '<strong class="error">' . $this->t('For token support the <a href="@token_url">token module</a> must be installed.', array('@token_url' => 'http://drupal.org/project/token')) . '</strong>',
'#states' => array(
'visible' => array(
':input[name$="[settings_edit_form][settings][colorbox_gallery]"]' => array('value' => 'custom'),
......@@ -165,22 +165,22 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
);
$caption = array(
'auto' => t('Automatic'),
'title' => t('Title text'),
'alt' => t('Alt text'),
'entity_title' => t('Content title'),
'custom' => t('Custom (with tokens)'),
'none' => t('None'),
'auto' => $this->t('Automatic'),
'title' => $this->t('Title text'),
'alt' => $this->t('Alt text'),
'entity_title' => $this->t('Content title'),
'custom' => $this->t('Custom (with tokens)'),
'none' => $this->t('None'),
);
$element['colorbox_caption'] = array(
'#title' => t('Caption'),
'#title' => $this->t('Caption'),
'#type' => 'select',
'#default_value' => $this->getSetting('colorbox_caption'),
'#options' => $caption,
'#description' => t('Automatic will use the first none empty value of the title, the alt text and the content title.'),
'#description' => $this->t('Automatic will use the first none empty value of the title, the alt text and the content title.'),
);
$element['colorbox_caption_custom'] = array(
'#title' => t('Custom caption'),
'#title' => $this->t('Custom caption'),
'#type' => 'textfield',
'#default_value' => $this->getSetting('colorbox_caption_custom'),
'#states' => array(
......@@ -191,8 +191,8 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
);
$element['colorbox_token_caption'] = array(
'#type' => 'fieldset',
'#title' => t('Replacement patterns'),
'#description' => '<strong class="error">' . t('For token support the <a href="@token_url">token module</a> must be installed.', array('@token_url' => 'http://drupal.org/project/token')) . '</strong>',
'#title' => $this->t('Replacement patterns'),
'#description' => '<strong class="error">' . $this->t('For token support the <a href="@token_url">token module</a> must be installed.', array('@token_url' => 'http://drupal.org/project/token')) . '</strong>',
'#states' => array(
'visible' => array(
':input[name$="[settings_edit_form][settings][colorbox_caption]"]' => array('value' => 'custom'),
......@@ -215,49 +215,49 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl
// Styles could be lost because of enabled/disabled modules that defines
// their styles in code.
if (isset($image_styles[$this->getSetting('colorbox_node_style')])) {
$summary[] = t('Content image style: @style', array('@style' => $image_styles[$this->getSetting('colorbox_node_style')]));
$summary[] = $this->t('Content image style: @style', array('@style' => $image_styles[$this->getSetting('colorbox_node_style')]));
}
elseif ($this->getSetting('colorbox_node_style') == 'hide') {
$summary[] = t('Content image style: Hide');
$summary[] = $this->t('Content image style: Hide');
}
else {
$summary[] = t('Content image style: Original image');
$summary[] = $this->t('Content image style: Original image');
}
if (isset($image_styles[$this->getSetting('colorbox_node_style_first')])) {
$summary[] = t('Content image style of first image: @style', array('@style' => $image_styles[$this->getSetting('colorbox_node_style_first')]));
$summary[] = $this->t('Content image style of first image: @style', array('@style' => $image_styles[$this->getSetting('colorbox_node_style_first')]));
}
if (isset($image_styles[$this->getSetting('colorbox_image_style')])) {
$summary[] = t('Colorbox image style: @style', array('@style' => $image_styles[$this->getSetting('colorbox_image_style')]));
$summary[] = $this->t('Colorbox image style: @style', array('@style' => $image_styles[$this->getSetting('colorbox_image_style')]));
}
else {
$summary[] = t('Colorbox image style: Original image');
$summary[] = $this->t('Colorbox image style: Original image');
}
$gallery = array(
'post' => t('Per post gallery'),
'page' => t('Per page gallery'),
'field_post' => t('Per field in post gallery'),
'field_page' => t('Per field in page gallery'),
'custom' => t('Custom (with tokens)'),
'none' => t('No gallery'),
'post' => $this->t('Per post gallery'),
'page' => $this->t('Per page gallery'),
'field_post' => $this->t('Per field in post gallery'),
'field_page' => $this->t('Per field in page gallery'),
'custom' => $this->t('Custom (with tokens)'),
'none' => $this->t('No gallery'),
);
if ($this->getSetting('colorbox_gallery')) {
$summary[] = t('Colorbox gallery type: @type', array('@type' => $gallery[$this->getSetting('colorbox_gallery')])) . ($this->getSetting('colorbox_gallery') == 'custom' ? ' (' . $this->getSetting('colorbox_gallery_custom') . ')' : '');
$summary[] = $this->t('Colorbox gallery type: @type', array('@type' => $gallery[$this->getSetting('colorbox_gallery')])) . ($this->getSetting('colorbox_gallery') == 'custom' ? ' (' . $this->getSetting('colorbox_gallery_custom') . ')' : '');
}
$caption = array(
'auto' => t('Automatic'),
'title' => t('Title text'),
'alt' => t('Alt text'),
'entity_title' => t('Content title'),
'custom' => t('Custom (with tokens)'),
'none' => t('None'),
'auto' => $this->t('Automatic'),
'title' => $this->t('Title text'),
'alt' => $this->t('Alt text'),
'entity_title' => $this->t('Content title'),
'custom' => $this->t('Custom (with tokens)'),
'none' => $this->t('None'),
);
if ($this->getSetting('colorbox_caption')) {
$summary[] = t('Colorbox caption: @type', array('@type' => $caption[$this->getSetting('colorbox_caption')]));
$summary[] = $this->t('Colorbox caption: @type', array('@type' => $caption[$this->getSetting('colorbox_caption')]));
}
return $summary;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment