Commit 4eb249ae authored by Volodymyr Mostepaniuk's avatar Volodymyr Mostepaniuk
Browse files

Issue #3295753 by mostepaniukvm: Labels correction.

parent cff7854b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -44,9 +44,9 @@ function custom_elements_ui_form_entity_view_display_edit_form_alter(&$form, For
  $route_name = "entity.entity_ce_display.{$display_entity->getTargetEntityTypeId()}.{$mode_component}";
  $ce_builder_url = Url::fromRoute($route_name, $route_parameters);

  $form['manage_custom_elements'] = [
  $form['manage_custom_element'] = [
    '#type' => 'link',
    '#title' => t('Manage custom elements'),
    '#title' => t('Manage custom element'),
    '#weight' => -10,
    '#attributes' => ['class' => ['button']],
    '#url' => $ce_builder_url,
@@ -56,7 +56,7 @@ function custom_elements_ui_form_entity_view_display_edit_form_alter(&$form, For
  $form['custom_elements'] = [
    '#type' => 'details',
    '#open' => TRUE,
    '#title' => t('Custom Elements'),
    '#title' => t('Custom Element'),
    '#tree' => TRUE,
  ];

+5 −5
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ use Drupal\field_ui\Form\EntityDisplayFormBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a form containing the Custom elements display UI for defaults.
 * Provides a form containing the Custom element display configuration.
 *
 * @internal
 *   Form classes are internal.
@@ -60,7 +60,7 @@ class EntityCustomElementsDisplayForm extends EntityDisplayFormBase {
    $label = [
      'label' => [
        '#type' => 'textfield',
        '#title' => $this->t('CE name'),
        '#title' => $this->t('Name'),
        '#title_display' => 'invisible',
        '#default_value' => $display_options['label'] ?? '',
        '#placeholder' => str_replace('_', '-', substr($field_name, 6)),
@@ -84,7 +84,7 @@ class EntityCustomElementsDisplayForm extends EntityDisplayFormBase {
    $field_row = array_slice($field_row, 0, $label_position + 1, TRUE) + $is_slot + array_slice($field_row, $label_position, count($field_row) - 1, TRUE);

    // Update the (invisible) title of the 'plugin' column.
    $field_row['plugin']['#title'] = $this->t('CE Formatter for @title', ['@title' => $field_definition->getLabel()]);
    $field_row['plugin']['#title'] = $this->t('Formatter for @title', ['@title' => $field_definition->getLabel()]);
    // @todo Activate when implemented.
    $field_row['plugin']['#disabled'] = TRUE;
    $field_row["settings_edit"]['#access'] = FALSE;
@@ -161,9 +161,9 @@ class EntityCustomElementsDisplayForm extends EntityDisplayFormBase {
      $this->t('Weight'),
      $this->t('Parent'),
      $this->t('Region'),
      $this->t('CE name'),
      $this->t('Name'),
      $this->t('Is Slot'),
      ['data' => $this->t('CE Format(coming...)'), 'colspan' => 3],
      ['data' => $this->t('Formatter'), 'colspan' => 3],
    ];
  }

+2 −2
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class RouteSubscriber extends RouteSubscriberBase {
          "$path/display/ce",
          [
            '_entity_form' => 'entity_view_display.custom_elements_builder',
            '_title' => 'Manage CE',
            '_title' => 'Manage custom element',
            'view_mode_name' => 'default',
          ] + $defaults,
          // @todo Own access checking.
@@ -87,7 +87,7 @@ class RouteSubscriber extends RouteSubscriberBase {
          [
            '_entity_form' => 'entity_view_display.custom_elements_builder',
            // @todo Title callback.
            '_title' => 'Manage CE',
            '_title' => 'Manage custom element',
          ] + $defaults,
          // @todo Own access checking.
          ['_field_ui_view_mode_access' => 'administer ' . $entity_type_id . ' display'],