public function DisplayPluginBase::renderMoreLink

Render the 'more' link

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 2438
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

public function renderMoreLink() {
  if ($this
    ->usesMore() && ($this
    ->useMoreAlways() || !empty($this->view->pager) && $this->view->pager
    ->hasMoreRecords())) {
    $path = $this
      ->getPath();
    if ($this
      ->getOption('link_display') == 'custom_url' && ($override_path = $this
      ->getOption('link_url'))) {
      $tokens = $this
        ->getArgumentsTokens();
      $path = strtr($override_path, $tokens);
    }
    if ($path) {
      if (empty($override_path)) {
        $path = $this->view
          ->getUrl(NULL, $path);
      }
      $url_options = array();
      if (!empty($this->view->exposed_raw_input)) {
        $url_options['query'] = $this->view->exposed_raw_input;
      }
      $theme = views_theme_functions('views_more', $this->view, $this->view->display_handler->display);
      $path = check_url(url($path, $url_options));
      return theme($theme, array(
        'more_url' => $path,
        'link_text' => check_plain($this
          ->useMoreText()),
        'view' => $this->view,
      ));
    }
  }
}