summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc')
-rw-r--r--kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc48
1 files changed, 46 insertions, 2 deletions
diff --git a/kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc b/kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc
index 2daea99..bec48c8 100644
--- a/kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc
+++ b/kolab.org/www/drupal-7.18/sites/all/modules/views/plugins/views_plugin_pager_mini.inc
@@ -6,7 +6,7 @@
*/
/**
- * The plugin to handle full pager.
+ * The plugin to handle mini pager.
*
* @ingroup views_pager_plugins
*/
@@ -18,9 +18,53 @@ class views_plugin_pager_mini extends views_plugin_pager_full {
return format_plural($this->options['items_per_page'], 'Mini pager, @count item', 'Mini pager, @count items', array('@count' => $this->options['items_per_page']));
}
+ /**
+ * Overrides views_plugin_pager_full::option_definition().
+ *
+ * Overrides the full pager options form by deleting unused settings.
+ */
+ function option_definition() {
+ $options = parent::option_definition();
+
+ unset($options['quantity']);
+ unset($options['tags']['first']);
+ unset($options['tags']['last']);
+ $options['tags']['previous']['default'] = '‹‹';
+ $options['tags']['next']['default'] = '››';
+
+ return $options;
+ }
+
+ /**
+ * Overrides views_plugin_pager_full::options_form().
+ *
+ * Overrides the full pager options form by deleting unused settings.
+ */
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+ unset($form['quantity']);
+ unset($form['tags']['first']);
+ unset($form['tags']['last']);
+ }
+
+ /**
+ * 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('views_mini_pager', $this->view, $this->display);
+ // The 1, 3 index are correct.
+ // @see theme_pager().
+ $tags = array(
+ 1 => $this->options['tags']['previous'],
+ 3 => $this->options['tags']['next'],
+ );
return theme($pager_theme, array(
- 'parameters' => $input, 'element' => $this->options['id']));
+ 'tags' => $tags,
+ 'element' => $this->options['id'],
+ 'parameters' => $input,
+ ));
}
}