getDisplayLabel example


  public function getDisplayDetails($view$display) {
    $display_title = $this->getDisplayLabel($view$display['id'], FALSE);
    $build = [
      '#theme_wrappers' => ['container'],
      '#attributes' => ['id' => 'edit-display-settings-details'],
    ];

    $is_display_deleted = !empty($display['deleted']);
    // The default display cannot be duplicated.     $is_default = $display['id'] == 'default';
    // @todo: Figure out why getOption doesn't work here.     $is_enabled = $view->getExecutable()->displayHandlers->get($display['id'])->isEnabled();

    
// Get an instance of the display plugin, to make sure it will work in the       // UI.       $display_plugin = $executable->displayHandlers->get($id);
      if (empty($display_plugin)) {
        continue;
      }

      $tabs[$id] = [
        '#theme' => 'menu_local_task',
        '#weight' => $display['position'],
        '#link' => [
          'title' => $this->getDisplayLabel($view$id),
          'localized_options' => [],
          'url' => $view->toUrl('edit-display-form')->setRouteParameter('display_id', $id),
        ],
      ];
      if (!empty($display['deleted'])) {
        $tabs[$id]['#link']['localized_options']['attributes']['class'][] = 'views-display-deleted-link';
      }
      if (isset($display['display_options']['enabled']) && !$display['display_options']['enabled']) {
        $tabs[$id]['#link']['localized_options']['attributes']['class'][] = 'views-display-disabled-link';
      }
    }

    
Home | Imprint | This part of the site doesn't use cookies.