summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/views_plugin_display.inc26
1 files changed, 15 insertions, 11 deletions
diff --git a/plugins/views_plugin_display.inc b/plugins/views_plugin_display.inc
index 8cabbe9..6a6194a 100644
--- a/plugins/views_plugin_display.inc
+++ b/plugins/views_plugin_display.inc
@@ -53,31 +53,35 @@ class views_plugin_display extends views_plugin {
$this->unpack_options($this->options, $options);
// Translate changed settings:
- // Check if any of the previous values now managed by
- // pluggable pagers have been changed.
- // If yes, perform the conversion
$items_per_page = $this->get_option('items_per_page');
$offset = $this->get_option('offset');
- $type = $this->get_option('use_pager');
- if ((!empty($items_per_page) && $items_per_page != 10) || !empty($offset) || !empty($type)) {
- if (!$type) {
- $type = $items_per_page ? 'some' : 'none';
- }
-
- if ($type == 1) {
+ $use_pager = $this->get_option('use_pager');
+ $pager = $this->get_option('pager');
+ // Check if the pager options were already converted.
+ if (!empty($pager)) {
+ // Find out the right pager type.
+ // If the view "use pager" it's a normal/full pager.
+ if ($use_pager) {
$type = 'full';
}
+ // If it does not use pager, but 0 items per page it should not page
+ // else it should display just a certain amount of items.
+ else {
+ $type = $items_per_page ? 'some' : 'none';
+ }
+ // Setup the pager options.
$pager = array(
'type' => $type,
'options' => array(
- 'offset' => $offset,
+ 'offset' => intval($offset)
),
);
if ($items_per_page) {
$pager['options']['items_per_page'] = $items_per_page;
}
+ // Setup the pager element.
if ($id = $this->get_option('pager_element')) {
$pager['options']['id'] = $id;
}