-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnextprev_links.views.inc
58 lines (54 loc) · 1.56 KB
/
nextprev_links.views.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @file
*
* Views plugin implementations for Next Prev Links.
*/
/**
* Implements hook_views_plugins
*/
function nextprev_links_views_plugins() {
return array(
'pager' => array(
'nextprev_links' => array(
'title' => t('Paged output, full pager (with rel next and prev links)'),
'short title' => t('Full (rel links)'),
'help' => t('Paged output, full Drupal style (with rel next and prev links)'),
'handler' => 'nextprev_links_pager',
'help topic' => 'pager-nextprev',
'uses options' => TRUE,
'parent' => 'full',
),
),
);
}
/**
* The plugin to provide the Next Prev Links.
*
* @ingroup views_pager_plugins
*/
class nextprev_links_pager extends views_plugin_pager_full {
/**
* Overrides views_plugin_pager_full::render().
*
* Overrides the full pager renderer by changing the theme function
* and leaving out variables that are not used in the mini pager.
*/
function render($input) {
$pager_theme = views_theme_functions('nextprev_links_pager', $this->view, $this->display);
// The 0, 1, 3, 4 index are correct. See theme_pager documentation.
$tags = array(
0 => $this->options['tags']['first'],
1 => $this->options['tags']['previous'],
3 => $this->options['tags']['next'],
4 => $this->options['tags']['last'],
);
$output = theme($pager_theme, array(
'tags' => $tags,
'element' => $this->get_pager_id(),
'parameters' => $input,
'quantity' => $this->options['quantity'],
));
return $output;
}
}