The plugin to handle full pager.
@Plugin(
id = "full",
title = @Translation("Paged output, full pager"),
short_title = @Translation("Full"),
help = @Translation("Paged output, full Drupal style")
)
Expanded class hierarchy of Full
class Full extends SqlBase {
/**
* Overrides \Drupal\views\Plugin\views\SqlBase::defineOptions().
*/
protected function defineOptions() {
$options = parent::defineOptions();
// Use the same default quantity that core uses by default.
$options['quantity'] = array(
'default' => 9,
);
$options['tags']['contains']['first'] = array(
'default' => '« first',
'translatable' => TRUE,
);
$options['tags']['contains']['last'] = array(
'default' => 'last »',
'translatable' => TRUE,
);
return $options;
}
/**
* Overrides \Drupal\views\Plugin\views\SqlBase::buildOptionsForm().
*/
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$form['quantity'] = array(
'#type' => 'number',
'#title' => t('Number of pager links visible'),
'#description' => t('Specify the number of links to pages to display in the pager.'),
'#default_value' => $this->options['quantity'],
);
$form['tags']['first'] = array(
'#type' => 'textfield',
'#title' => t('First page link text'),
'#default_value' => $this->options['tags']['first'],
'#weight' => -10,
);
$form['tags']['last'] = array(
'#type' => 'textfield',
'#title' => t('Last page link text'),
'#default_value' => $this->options['tags']['last'],
'#weight' => 10,
);
}
/**
* Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::summaryTitle().
*/
public function summaryTitle() {
if (!empty($this->options['offset'])) {
return format_plural($this->options['items_per_page'], '@count item, skip @skip', 'Paged, @count items, skip @skip', array(
'@count' => $this->options['items_per_page'],
'@skip' => $this->options['offset'],
));
}
return format_plural($this->options['items_per_page'], '@count item', 'Paged, @count items', array(
'@count' => $this->options['items_per_page'],
));
}
/**
* Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::render().
*/
function render($input) {
$pager_theme = views_theme_functions('pager', $this->view, $this->view->display_handler->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->options['id'],
'parameters' => $input,
'quantity' => $this->options['quantity'],
));
return $output;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContainerFactoryPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
11 |
PluginBase:: |
public | function | Initialize the plugin. | 8 |
PluginBase:: |
public | function | Returns the usesOptions property. | 8 |
PluginBase:: |
public | function | Validate that the plugin is correct and can be saved. | 4 |
PagerPluginBase:: |
public | function | Determine if a pager needs a count query. | 3 |
PagerPluginBase:: |
public | function | Determine if this pager actually uses a pager. | 2 |
PagerPluginBase:: |
public | function | Perform any needed actions just after the query executing. | 2 |
PluginBase:: |
public | function | Clears a plugin. | 2 |
SqlBase:: |
public | function |
Modify the query for paging Overrides PagerPluginBase:: |
1 |
PagerPluginBase:: |
public | function | Get how many items per page this pager will display. | 1 |
PagerPluginBase:: |
public | function | Execute the count query, which will be done just prior to the query itself being executed. | 1 |
PluginBase:: |
public | function | Provide a full list of possible theme templates used by this style. | 1 |
PluginBase:: |
public | property | The top object of a view. | 1 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
Full:: |
protected | function |
Overrides \Drupal\views\Plugin\views\SqlBase::defineOptions(). Overrides SqlBase:: |
|
Full:: |
public | function |
Overrides \Drupal\views\Plugin\views\SqlBase::buildOptionsForm(). Overrides SqlBase:: |
|
Full:: |
public | function |
Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::summaryTitle(). Overrides PagerPluginBase:: |
|
Full:: |
function |
Overrides \Drupal\views\Plugin\views\pager\PagerPluginBase::render(). Overrides PagerPluginBase:: |
||
SqlBase:: |
public | function |
Provide the default form form for validating options Overrides PagerPluginBase:: |
|
SqlBase:: |
public | function |
Set the current page. Overrides PagerPluginBase:: |
|
SqlBase:: |
public | function | ||
SqlBase:: |
public | function |
Update global paging info. Overrides PagerPluginBase:: |
|
SqlBase:: |
public | function |
Overrides PagerPluginBase:: |
|
SqlBase:: |
protected | function |
Overrides PagerPluginBase:: |
|
SqlBase:: |
protected | function |
Overrides PagerPluginBase:: |
|
SqlBase:: |
public | function |
Overrides PagerPluginBase:: |
|
SqlBase:: |
public | function |
Overrides PagerPluginBase:: |
|
PagerPluginBase:: |
public | function | Set how many items per page this pager will display. | |
PagerPluginBase:: |
public | function | Get the page offset, or how many items to skip. | |
PagerPluginBase:: |
public | function | Set the page offset, or how many items to skip. | |
PagerPluginBase:: |
public | function | Get the current page. | |
PagerPluginBase:: |
public | function | Get the total number of items. | |
PagerPluginBase:: |
public | function | Get the pager id, if it exists | |
PagerPluginBase:: |
public | function |
Provide the default form form for submitting options Overrides PluginBase:: |
|
PagerPluginBase:: |
public | function | Perform any needed actions just prior to the query executing. | |
PagerPluginBase:: |
function | Perform any needed actions just before rendering. | ||
PagerPluginBase:: |
public | function | Determine if there are more records available. | |
PagerPluginBase:: |
public | function | ||
PluginBase:: |
public | function |
Constructs a Plugin object. Overrides PluginBase:: |
|
PluginBase:: |
protected | function | Fills up the options of the plugin with defaults. | |
PluginBase:: |
public | function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | |
PluginBase:: |
public | function | Return the human readable name of the display. | |
PluginBase:: |
public | function | Returns a string with any core tokens replaced. | |
PluginBase:: |
public | function | Returns an array of available token replacements. | |
PluginBase:: |
public | function | Adds elements for available core tokens to a form. | |
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PagerPluginBase:: |
property | |||
PagerPluginBase:: |
property | |||
PagerPluginBase:: |
protected | property |
Overrides Drupal\views\Plugin\Plugin::$usesOptions. Overrides PluginBase:: |
|
PluginBase:: |
public | property | Options for this plugin will be held here. | |
PluginBase:: |
public | property | The display object this plugin is for. | |
PluginBase:: |
public | property | Plugins's definition | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
protected | property | The plugin implementation definition. |