isDefaultDisplay example


  }

  /** * {@inheritdoc} */
  public function validate() {
    $errors = parent::validate();

    // Do not add errors for the default display if it is not displayed in the     // UI.     if ($this->displayHandler->isDefaultDisplay() && !\Drupal::config('views.settings')->get('ui.show.default_display')) {
      return $errors;
    }

    // Ajax errors can cause the plugin to be added without any settings.     $linked_display_id = !empty($this->options['display_id']) ? $this->options['display_id'] : NULL;
    if (!$linked_display_id) {
      $errors[] = $this->t('%current_display: The link in the %area area has no configured display.', [
        '%current_display' => $this->displayHandler->display['display_title'],
        '%area' => $this->areaType,
      ]);
      return $errors;
    }
foreach ($option['links'] as $link_id => $link_value) {
        $option_build['#settings_links'][] = $view->getExecutable()->displayHandlers->get($display['id'])->optionLink($option['setting']$link_id, 'views-button-configure', $link_value);
      }
    }

    if (!empty($view->getExecutable()->displayHandlers->get($display['id'])->options['defaults'][$id])) {
      $display_id = 'default';
      $option_build['#defaulted'] = TRUE;
    }
    else {
      $display_id = $display['id'];
      if (!$view->getExecutable()->displayHandlers->get($display['id'])->isDefaultDisplay()) {
        if ($view->getExecutable()->displayHandlers->get($display['id'])->defaultableSections($id)) {
          $option_build['#overridden'] = TRUE;
        }
      }
    }
    $option_build['#attributes']['class'][] = Html::cleanCssIdentifier($display_id . '-' . $id);
    return $option_build;
  }

  /** * Add information about a section to a display. */
$this->setOptionDefaults($this->options, $this->defineOptions());
    $this->display = &$display;

    // Track changes that the user should know about.     $changed = FALSE;

    if (!isset($options) && isset($display['display_options'])) {
      $options = $display['display_options'];
    }

    if ($this->isDefaultDisplay() && isset($options['defaults'])) {
      unset($options['defaults']);
    }

    $skip_cache = \Drupal::config('views.settings')->get('skip_cache');

    if (!$skip_cache) {
      $cid = 'views:unpack_options:' . hash('sha256', serialize([$this->options, $options])) . ':' . \Drupal::languageManager()->getCurrentLanguage()->getId();
      if (empty(static::$unpackOptions[$cid])) {
        $cache = \Drupal::cache('data')->get($cid);
        if (!empty($cache->data)) {
          $this->options = $cache->data;
        }
Home | Imprint | This part of the site doesn't use cookies.