Skip to content
Snippets Groups Projects
Commit 446e4f34 authored by Italo Mairo's avatar Italo Mairo
Browse files

Merge branch '1.0.x' into 3154765_translations_support

# Conflicts:
#	src/Plugin/Field/FieldWidget/LayoutParagraphsWidget.php
parents d1f5b5c9 c50917a7
No related branches found
No related tags found
No related merge requests found
...@@ -652,13 +652,21 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi ...@@ -652,13 +652,21 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi
} }
else { else {
// Add the #isTranslating attribute, if in a translation context. // Add the #isTranslating attribute, if in a translation context.
$elements['is_translating_warning'] = [
'#type' => "html_tag",
'#tag' => 'div',
'#value' => t("This is Translation Context (editing a version not in the original language). <b>No new Layout Sections and Paragraphs can be added</b>."),
'#weight' => -1100,
'#attributes' => [
'class' => ['is_translating_warning'],
],
];
$elements['add_more'] = [ $elements['add_more'] = [
'actions' => [ 'actions' => [
'#isTranslating' => TRUE, '#isTranslating' => TRUE,
], ],
]; ];
} }
if ($widget_state['open_form'] !== FALSE) { if ($widget_state['open_form'] !== FALSE) {
$this->entityForm($elements, $form_state, $form); $this->entityForm($elements, $form_state, $form);
} }
...@@ -2062,6 +2070,14 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi ...@@ -2062,6 +2070,14 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi
/** /**
* Field instance settings form. * Field instance settings form.
*
* @param array $form
* The Form element.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array
* The Form array.
*/ */
public function settingsForm(array $form, FormStateInterface $form_state) { public function settingsForm(array $form, FormStateInterface $form_state) {
$entity_type_id = $this->getFieldSetting('target_type'); $entity_type_id = $this->getFieldSetting('target_type');
...@@ -2141,6 +2157,9 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi ...@@ -2141,6 +2157,9 @@ class LayoutParagraphsWidget extends WidgetBase implements ContainerFactoryPlugi
/** /**
* Default settings for widget. * Default settings for widget.
*
* @return array
* The default settings array.
*/ */
public static function defaultSettings() { public static function defaultSettings() {
$defaults = parent::defaultSettings(); $defaults = parent::defaultSettings();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment