function views_plugin_display::render_more_link

Same name in other branches
  1. 7.x-3.x plugins/views_plugin_display.inc \views_plugin_display::render_more_link()

Render the 'more' link

File

plugins/views_plugin_display.inc, line 2347

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) || strpos($override_path, '!') === FALSE && strpos($override_path, '%') === FALSE) {
                $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, $path, check_plain($this->use_more_text()));
        }
    }
}