You are here

class Link in Views link area 8

Views area Link handler.

Plugin annotation

@ViewsArea("linkarea");

Hierarchy

Expanded class hierarchy of Link

1 string reference to 'Link'
views_linkarea_views_data in ./views_linkarea.views.inc
Implements hook_views_data().

File

src/Plugin/views/area/Link.php, line 24

Namespace

Drupal\views_linkarea\Plugin\views\area
View source
class Link extends TokenizeAreaPluginBase {
  use RedirectDestinationTrait;

  /**
   * The language manager.
   *
   * @var \Drupal\Core\Language\LanguageManagerInterface
   */
  protected $languageManager;

  /**
   * The access manager service.
   *
   * @var \Drupal\Core\Access\AccessManagerInterface
   */
  protected $accessManager;

  /**
   * @var \Symfony\Component\Routing\RequestContext
   */
  protected $context;

  /**
   * Constructs a new Entity instance.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
   *   The language manager.
   * @param \Drupal\Core\Access\AccessManagerInterface $access_manager
   *   The access manager.
   * @param \Symfony\Component\Routing\RequestContext
   *   The request context.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, AccessManagerInterface $access_manager, RequestContext $context) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->languageManager = $language_manager;
    $this->accessManager = $access_manager;
    $this->context = $context;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('language_manager'), $container
      ->get('access_manager'), $container
      ->get('router.request_context'));
  }

  /**
   * {@inheritdoc}
   */
  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['link_text'] = [
      'default' => '',
    ];
    $options['path'] = [
      'default' => '',
    ];
    $options['output_as_action'] = [
      'default' => FALSE,
    ];
    $options['destination'] = [
      'default' => TRUE,
    ];
    $options['prefix'] = [
      'default' => '',
    ];
    $options['suffix'] = [
      'default' => '',
    ];
    $options['external'] = [
      'default' => FALSE,
    ];
    $options['replace_spaces'] = [
      'default' => FALSE,
    ];
    $options['path_case'] = [
      'default' => 'none',
    ];
    $options['alt'] = [
      'default' => '',
    ];
    $options['rel'] = [
      'default' => '',
    ];
    $options['link_class'] = [
      'default' => '',
    ];
    $options['target'] = [
      'default' => '',
    ];
    $options['absolute'] = [
      'default' => FALSE,
    ];
    $options['rewrite_output'] = [
      'default' => '',
    ];
    $options['access_denied_text'] = [
      'default' => '',
    ];
    $options['language'] = [
      'default' => '**auto**',
    ];
    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['link_text'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Link text'),
      '#default_value' => $this->options['link_text'],
      '#description' => $this
        ->t('The text to use for the link. May use tokens.'),
      '#required' => TRUE,
    ];
    $form['path'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Link path'),
      '#default_value' => $this->options['path'],
      '#description' => $this
        ->t('The Drupal path, Drupal URI, or absolute URL for this link. Drupal URIs include the entity: and route: schemes. You may append a query string and fragment. You may use token replacements.'),
      '#maxlength' => 255,
    ];
    $form['output_as_action'] = [
      '#title' => $this
        ->t('Output as action'),
      '#type' => 'checkbox',
      '#default_value' => $this->options['output_as_action'],
      '#description' => $this
        ->t('Outputs the link as an "action button", themed like the links in the "Primary admin actions" block.'),
    ];
    $form['destination'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Include destination'),
      '#default_value' => $this->options['destination'],
      '#description' => $this
        ->t('Include a "destination" parameter in the link to return the user to the original view upon completing the link action.'),
    ];
    $form['replace_spaces'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Replace spaces with dashes'),
      '#default_value' => $this->options['replace_spaces'],
    ];
    $form['external'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('External server URL'),
      '#default_value' => $this->options['external'],
      '#description' => $this
        ->t("Links to an external server using a full URL: e.g. 'http://www.example.com' or 'www.example.com'."),
    ];
    $form['path_case'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('Transform the case'),
      '#description' => $this
        ->t('When printing URL paths, how to transform the case of the filter value.'),
      '#options' => [
        'none' => $this
          ->t('No transform'),
        'upper' => $this
          ->t('Upper case'),
        'lower' => $this
          ->t('Lower case'),
        'ucfirst' => $this
          ->t('Capitalize first letter'),
        'ucwords' => $this
          ->t('Capitalize each word'),
      ],
      '#default_value' => $this->options['path_case'],
    ];
    $form['link_class'] = [
      '#title' => $this
        ->t('Link class'),
      '#type' => 'textfield',
      '#default_value' => $this->options['link_class'],
      '#description' => $this
        ->t('The CSS class to apply to the link. May use tokens.'),
    ];
    $form['alt'] = [
      '#title' => $this
        ->t('Title text'),
      '#type' => 'textfield',
      '#default_value' => $this->options['alt'],
      '#description' => $this
        ->t('Text to place as "title" text which most browsers display as a tooltip when hovering over the link. May use tokens.'),
    ];
    $form['rel'] = [
      '#title' => $this
        ->t('Rel Text'),
      '#type' => 'textfield',
      '#default_value' => $this->options['rel'],
      '#description' => $this
        ->t('Include Rel attribute for use in lightbox2 or other javascript utility. May use tokens.'),
    ];
    $form['prefix'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Prefix'),
      '#default_value' => $this->options['prefix'],
      '#description' => $this
        ->t('Any text to display before this link. You may include HTML and tokens.'),
    ];
    $form['suffix'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Suffix'),
      '#default_value' => $this->options['suffix'],
      '#description' => $this
        ->t('Any text to display after this link. You may include HTML and tokens.'),
    ];
    $form['target'] = [
      '#title' => $this
        ->t('Target'),
      '#type' => 'textfield',
      '#default_value' => $this->options['target'],
      '#description' => $this
        ->t("Target of the link, such as _blank, _parent or an iframe's name. This field is rarely used. May use tokens."),
    ];
    $form['advanced_opts'] = [
      '#type' => 'details',
      '#title' => $this
        ->t('Advanced Options'),
      '#weight' => 50,
    ];
    $form['absolute'] = [
      '#fieldset' => 'advanced_opts',
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Use absolute path'),
      '#default_value' => $this->options['absolute'],
      '#description' => $this
        ->t('Whether to force the output to be an absolute link (beginning with http:). Useful for links that will be displayed outside the site, such as in an RSS feed.'),
    ];
    $form['rewrite_output'] = [
      '#fieldset' => 'advanced_opts',
      '#type' => 'textarea',
      '#title' => $this
        ->t('Rewrite output'),
      '#default_value' => $this->options['rewrite_output'],
      '#description' => $this
        ->t('Use this to output whatever HTML you want with the link created usable via the token {{views_linkarea}}. Global tokens available as well.'),
    ];
    $form['access_denied_text'] = [
      '#fieldset' => 'advanced_opts',
      '#type' => 'textarea',
      '#title' => $this
        ->t('Content when access is denied'),
      '#default_value' => $this->options['access_denied_text'],
      '#description' => $this
        ->t('Use this to output whatever you want to display when access to the link is denied to the user. Tokens allowed.'),
    ];
    $form['language'] = [
      '#fieldset' => 'advanced_opts',
      '#type' => 'radios',
      '#title' => $this
        ->t('Language'),
      '#default_value' => $this->options['language'],
      '#options' => [
        '**auto**' => $this
          ->t('Current language'),
      ] + $this
        ->listLanguages(LanguageInterface::STATE_ALL | LanguageInterface::STATE_SITE_DEFAULT, [
        $this->options['language'],
      ]),
    ];
    if (!$this->languageManager
      ->isMultilingual()) {
      $form['language']['#description'] = $this
        ->t('This will not take effect until you turn on multilingual capabilities');
    }
  }

  /**
   * {@inheritdoc}
   */
  public function validateOptionsForm(&$form, FormStateInterface $form_state) {
    $options = $form_state
      ->getValue('options');

    // @todo validate like \Drupal\link\Plugin\Field\FieldWidget\LinkWidget
    $form_state
      ->setValue('options', $options);
  }

  /**
   * {@inheritdoc}
   */
  public function render($empty = FALSE) {

    // Note: Method adapted from the renderAsLinkmethod from
    // Drupal\views\Plugin\views\field\FieldPluginBase.
    if ($empty && empty($this->options['empty'])) {
      return [];
    }
    $options = [
      'absolute' => !empty($this->options['absolute']) ? TRUE : FALSE,
      'alias' => FALSE,
      'entity' => NULL,
      'entity_type' => NULL,
      'fragment' => NULL,
      'language' => NULL,
      'query' => [],
    ];
    $path = $this->options['path'];
    if ($path != '<front>') {

      // Use strip_tags as there should never be HTML in the path.
      // However, we need to preserve special characters like " that were
      // removed by SafeMarkup::checkPlain().
      $path = Html::decodeEntities($this
        ->tokenizeValue($path));

      // Tokens might contain <front>, so check for <front> again.
      if ($path != '<front>') {
        $path = strip_tags($path);
      }

      // Tokens might have resolved URL's, as is the case for tokens provided by
      // Link fields, so all internal paths will be prefixed by the base url
      // from the request context. For proper further handling reset this to
      // internal:/.
      $base_path = $this->context
        ->getBaseUrl() . '/';
      if (strpos($path, $base_path) === 0) {
        $path = 'internal:/' . substr($path, strlen($base_path));
      }

      // If we have no $path and no $url_info['url'], we have nothing to work
      // with, so we just return the text.
      if (empty($path)) {
        return $this->options['link_text'];
      }

      // If no scheme is provided in the $path, assign the default 'http://'.
      // This allows a url of 'www.example.com' to be converted to
      // 'http://www.example.com'.
      // Only do this when flag for external has been set, $path doesn't contain
      // a scheme and $path doesn't have a leading /.
      if ($this->options['external'] && !parse_url($path, PHP_URL_SCHEME) && strpos($path, '/') !== 0) {

        // There is no scheme, add the default 'http://' to the $path.
        $path = "http://" . $path;
      }
    }
    if (!parse_url($path, PHP_URL_SCHEME)) {
      $url = Url::fromUserInput('/' . ltrim($path, '/'));
    }
    else {
      $url = Url::fromUri($path);
    }
    $options = $url
      ->getOptions() + $options;
    $path = $url
      ->setOptions($options)
      ->toUriString();
    if (!empty($this->options['path_case']) && $this->options['path_case'] != 'none' && !$url
      ->isRouted()) {
      $path = str_replace($this->options['path'], $this
        ->caseTransform($this->options['path'], $this->options['path_case']), $path);
    }
    if (!empty($url_info['replace_spaces'])) {
      $path = str_replace(' ', '-', $path);
    }

    // Parse the URL and move any query and fragment parameters out of the path.
    $url_parts = UrlHelper::parse($path);

    // Seriously malformed URLs may return FALSE or empty arrays.
    if (empty($url_parts)) {
      return $this->options['link_text'];
    }

    // If the path is empty do not build a link around the given text and return
    // it as is.
    if (empty($url_parts['path']) && empty($url_parts['fragment']) && empty($url_parts['url'])) {
      return $this->options['link_text'];
    }

    // If we get to here we have a path from the url parsing. So assign that to
    // $path now so we don't get query strings or fragments in the path.
    $path = $url_parts['path'];
    if (isset($url_parts['query'])) {

      // Remove query parameters that were assigned a query string replacement
      // token for which there is no value available.
      foreach ($url_parts['query'] as $param => $val) {
        if ($val == '%' . $param) {
          unset($url_parts['query'][$param]);
        }

        // Replace any empty query params from URL parsing with NULL. So the
        // query will get built correctly with only the param key.
        // @see \Drupal\Component\Utility\UrlHelper::buildQuery().
        if ($val === '') {
          $url_parts['query'][$param] = NULL;
        }
      }
      $options['query'] = $url_parts['query'];
    }
    if (isset($url_parts['fragment'])) {
      $path = strtr($path, [
        '#' . $url_parts['fragment'] => '',
      ]);

      // If the path is empty we want to have a fragment for the current site.
      if ($path == '') {
        $options['external'] = TRUE;
      }
      $options['fragment'] = $url_parts['fragment'];
    }
    $alt = $this
      ->tokenizeValue($this->options['alt']);

    // Set the title attribute of the link only if it improves accessibility.
    if ($alt && $alt != $this->options['link_text']) {
      $options['attributes']['title'] = Html::decodeEntities($alt);
    }
    $class = $this
      ->tokenizeValue($this->options['link_class']);
    if ($class) {
      $options['attributes']['class'] = [
        $class,
      ];
    }
    if (!empty($this->options['rel']) && ($rel = $this
      ->tokenizeValue($this->options['rel']))) {
      $options['attributes']['rel'] = $rel;
    }
    $target = trim($this
      ->tokenizeValue($this->options['target']));
    if (!empty($target)) {
      $options['attributes']['target'] = $target;
    }
    if (!empty($this->options['destination'])) {
      $options['query'] += \Drupal::destination()
        ->getAsArray();
    }
    if ($this->languageManager
      ->isMultilingual() && $this->options['language'] !== '**auto**') {
      $options['language'] = $this->languageManager
        ->getLanguage($this->options['language']);
    }
    return $this
      ->renderUrl(Url::fromUri($path, $options));
  }

  /**
   * Takes an input \Drupal\Core\Url object and outputs it as needed.
   *
   * @param \Drupal\Core\Url $url
   *   Standard Drupal URL object.
   *
   * @return array
   *   Render array containing the content of this area.
   */
  protected function renderUrl(Url $url) {
    $options = $url
      ->getOptions();
    $url
      ->setOptions($options);
    if ($this
      ->checkUrlAccess($url) == FALSE) {
      return [
        '#markup' => $this
          ->sanitizeValue($this
          ->tokenizeValue($this->options['access_denied_text'])),
      ];
    }
    $link_text = $this
      ->tokenizeValue($this->options['link_text']);
    $link = [
      '#type' => 'link',
      '#url' => $url,
      '#title' => strip_tags(Html::decodeEntities($link_text)),
    ];
    if (($prefix = $this->options['prefix']) !== '') {
      $link['#prefix'] = $this
        ->tokenizeValue($prefix);
    }
    if (($suffix = $this->options['suffix']) !== '') {
      $link['#suffix'] = $this
        ->tokenizeValue($suffix);
    }
    if ($this->options['output_as_action']) {
      $link = $this
        ->outputAsActionLink($link);
    }
    if ($this->options['rewrite_output'] !== '') {
      $rewritten_output = $this
        ->viewsTokenReplace($this->options['rewrite_output'], [
        'views_linkarea' => $link,
      ]);
      return [
        '#markup' => $this
          ->sanitizeValue($this
          ->tokenizeValue($rewritten_output), 'xss_admin'),
      ];
    }
    return $link;
  }

  /**
   * Checks access to the link route.
   *
   * @param \Drupal\Core\Url $url
   *   Standard Drupal URL object.
   *
   * @return bool
   *   Whether the current user has access to the URL.
   */
  protected function checkUrlAccess(Url $url) {
    if ($url
      ->isRouted() == FALSE) {
      return TRUE;
    }
    return $this->accessManager
      ->checkNamedRoute($url
      ->getRouteName(), $url
      ->getRouteParameters());
  }

  /**
   * Takes the generated link and transforms it into a 'local action' link.
   *
   * Wrapping with hard-coded HTML is ugly but basically copied from
   * \Drupal\block\Controller\BlockLibraryController::buildLocalActions()
   *
   * @param array $link
   *   The link to transform.
   *
   * @return array
   *   The render array for the generated action link.
   */
  protected function outputAsActionLink(array $link) {
    $action_link = [
      '#theme' => 'menu_local_action',
      '#link' => [
        'url' => $link['#url'],
        'title' => $link['#title'],
      ],
    ];
    $prefix = isset($link['prefix']) ? $link['prefix'] : '';
    $suffix = isset($link['suffix']) ? $link['suffix'] : '';
    $action_link['#prefix'] = $prefix . '<ul class="action-links">';
    $action_link['#suffix'] = '</ul>' . $suffix;
    return $action_link;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AreaPluginBase::$areaType public property The type of this area handler, i.e. 'header', 'footer', or 'empty'.
AreaPluginBase::adminSummary public function Provide text for the administrative summary. Overrides HandlerBase::adminSummary
AreaPluginBase::init public function Overrides Drupal\views\Plugin\views\HandlerBase::init(). Overrides HandlerBase::init 1
AreaPluginBase::isEmpty public function Does that area have nothing to show. 1
AreaPluginBase::preRender public function Performs any operations needed before full rendering. 1
AreaPluginBase::usesGroupBy public function Provides the handler some groupby. Overrides HandlerBase::usesGroupBy
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
HandlerBase::$field public property With field you can override the realField if the real field is not set.
HandlerBase::$moduleHandler protected property The module handler. 3
HandlerBase::$query public property Where the $query object will reside: 7
HandlerBase::$realField public property The actual field in the database table, maybe different on other kind of query plugins/special handlers.
HandlerBase::$relationship public property The relationship used for this field.
HandlerBase::$table public property The table this handler is attached to.
HandlerBase::$tableAlias public property The alias of the table of this handler which is used in the query.
HandlerBase::$viewsData protected property The views data service.
HandlerBase::acceptExposedInput public function Take input from exposed handlers and assign to this handler, if necessary. 1
HandlerBase::access public function Check whether given user has access to this handler. Overrides ViewsHandlerInterface::access 4
HandlerBase::adminLabel public function Return a string representing this handler's name in the UI. Overrides ViewsHandlerInterface::adminLabel 4
HandlerBase::breakString public static function Breaks x,y,z and x+y+z into an array. Overrides ViewsHandlerInterface::breakString
HandlerBase::broken public function Determines if the handler is considered 'broken', meaning it's a placeholder used when a handler can't be found. Overrides ViewsHandlerInterface::broken
HandlerBase::buildExposedForm public function Render our chunk of the exposed handler form when selecting 1
HandlerBase::buildExposeForm public function Form for exposed handler options. 2
HandlerBase::buildExtraOptionsForm public function Provide a form for setting options. 1
HandlerBase::buildGroupByForm public function Provide a form for aggregation settings. 1
HandlerBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides PluginBase::calculateDependencies 10
HandlerBase::canExpose public function Determine if a handler can be exposed. 2
HandlerBase::caseTransform protected function Transform a string by a certain method.
HandlerBase::defaultExposeOptions public function Set new exposed option defaults when exposed setting is flipped on. 2
HandlerBase::defineExtraOptions public function Provide defaults for the handler.
HandlerBase::displayExposedForm public function Displays the Expose form.
HandlerBase::ensureMyTable public function Ensure the main table for this handler is in the query. This is used a lot. Overrides ViewsHandlerInterface::ensureMyTable 2
HandlerBase::exposedInfo public function Get information about the exposed form for the form renderer. 1
HandlerBase::getDateField public function Creates cross-database SQL dates. 2
HandlerBase::getDateFormat public function Creates cross-database SQL date formatting. 2
HandlerBase::getEntityType public function Determines the entity type used by this handler. Overrides ViewsHandlerInterface::getEntityType
HandlerBase::getField public function Shortcut to get a handler's raw field value. Overrides ViewsHandlerInterface::getField
HandlerBase::getJoin public function Get the join object that should be used for this handler. Overrides ViewsHandlerInterface::getJoin
HandlerBase::getModuleHandler protected function Gets the module handler.
HandlerBase::getTableJoin public static function Fetches a handler to join one table to a primary table from the data cache. Overrides ViewsHandlerInterface::getTableJoin
HandlerBase::getViewsData protected function Gets views data service.
HandlerBase::hasExtraOptions public function If a handler has 'extra options' it will get a little settings widget and another form called extra_options. 1
HandlerBase::isAGroup public function Returns TRUE if the exposed filter works like a grouped filter. 1
HandlerBase::isExposed public function Determine if this item is 'exposed', meaning it provides form elements to let users modify the view.
HandlerBase::multipleExposedInput public function Define if the exposed input has to be submitted multiple times. This is TRUE when exposed filters grouped are using checkboxes as widgets. 1
HandlerBase::placeholder protected function Provides a unique placeholders for handlers.
HandlerBase::postExecute public function Run after the view is executed, before the result is cached. Overrides ViewsHandlerInterface::postExecute
HandlerBase::preQuery public function Run before the view is built. Overrides ViewsHandlerInterface::preQuery 2
HandlerBase::query public function Add anything to the query that we might need to. Overrides PluginBase::query 7
HandlerBase::sanitizeValue public function Sanitize the value for output. Overrides ViewsHandlerInterface::sanitizeValue
HandlerBase::setModuleHandler public function Sets the module handler.
HandlerBase::setRelationship public function Called just prior to query(), this lets a handler set up any relationship it needs. Overrides ViewsHandlerInterface::setRelationship
HandlerBase::setViewsData public function
HandlerBase::showExposeButton public function Shortcut to display the expose/hide button. 2
HandlerBase::showExposeForm public function Shortcut to display the exposed options form. Overrides ViewsHandlerInterface::showExposeForm
HandlerBase::storeExposedInput public function If set to remember exposed input in the session, store it there. 1
HandlerBase::submitExposed public function Submit the exposed handler form
HandlerBase::submitExposeForm public function Perform any necessary changes to the form exposes prior to storage. There is no need for this function to actually store the data.
HandlerBase::submitExtraOptionsForm public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
HandlerBase::submitFormCalculateOptions public function Calculates options stored on the handler 1
HandlerBase::submitGroupByForm public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. 1
HandlerBase::submitTemporaryForm public function A submit handler that is used for storing temporary items when using multi-step changes, such as ajax requests.
HandlerBase::validate public function Validate that the plugin is correct and can be saved. Overrides PluginBase::validate 2
HandlerBase::validateExposed public function Validate the exposed handler form 4
HandlerBase::validateExposeForm public function Validate the options form. 1
HandlerBase::validateExtraOptionsForm public function Validate the options form.
Link::$accessManager protected property The access manager service.
Link::$context protected property
Link::$languageManager protected property The language manager.
Link::buildOptionsForm public function Provide a form to edit options for this plugin. Overrides TokenizeAreaPluginBase::buildOptionsForm
Link::checkUrlAccess protected function Checks access to the link route.
Link::create public static function Creates an instance of the plugin. Overrides PluginBase::create
Link::defineOptions protected function Information about options for all kinds of purposes will be held here. Overrides TokenizeAreaPluginBase::defineOptions
Link::outputAsActionLink protected function Takes the generated link and transforms it into a 'local action' link.
Link::render public function Render the area. Overrides AreaPluginBase::render
Link::renderUrl protected function Takes an input \Drupal\Core\Url object and outputs it as needed.
Link::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm
Link::__construct public function Constructs a new Entity instance. Overrides HandlerBase::__construct
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$renderer protected property Stores the render API renderer. 3
PluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. 8
PluginBase::$view public property The top object of a view. 1
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::destroy public function Clears a plugin. Overrides ViewsPluginInterface::destroy 2
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::submitOptionsForm public function Handle any special handling on the validate form. Overrides ViewsPluginInterface::submitOptionsForm 16
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks 6
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TokenizeAreaPluginBase::tokenForm public function Adds tokenization form elements.
TokenizeAreaPluginBase::tokenizeValue public function Replaces value with special views tokens and global tokens.
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.