1 views_plugin_display.inc views_plugin_display::render_more_link()

Render the 'more' link

File

core/modules/views/plugins/views_plugin_display.inc, line 2569
Contains the base display plugin.

Class

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

Code

function render_more_link() {
  if ($this->use_more() && ($this->use_more_always() || (!empty($this->view->query->pager) && $this->view->query->pager->has_more_records()))) {
    $path = $this->get_path();

    if ($this->get_option('link_display') == 'custom_url' && $override_path = $this->get_option('link_url')) {
      $tokens = $this->get_arguments_tokens();
      $path = strtr($override_path, $tokens);
    }

    if ($path) {
      if (empty($override_path)) {
        $path = $this->view->get_url(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->display);
      $path = check_url(url($path, $url_options));

      return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view));
    }
  }
}