Displays go to next and go to last page.
178238
private function displayRightSide()
    {
        if ($this->currentPage != $this->maxPage) {
            echo '<a href="' . $this->buildHref($this->currentPage + 1) . '">&gt;</a>';
            if ($this->currentPage + 4 < $this->maxPage) {
                echo '<a href="' . $this->buildHref($this->maxPage) . '">»</a>';
            }
        }
    }
1228140
protected function calculateDisplayRange()
    {
        $maximumNumberOfLinks = $this->maximumNumberOfLinks;
        if ($maximumNumberOfLinks > $this->numberOfPages) {
            $maximumNumberOfLinks = $this->numberOfPages;
        }
        $delta = floor($maximumNumberOfLinks / 2);
        $this->displayRangeStart = $this->currentPage - $delta;
        $this->displayRangeEnd = $this->currentPage + $delta - ($maximumNumberOfLinks % 2 === 0 ? 1 : 0);
        if ($this->displayRangeStart < 1) {
            $this->displayRangeEnd -= $this->displayRangeStart - 1;
        }
        if ($this->displayRangeEnd > $this->numberOfPages) {
            $this->displayRangeStart -= $this->displayRangeEnd - $this->numberOfPages;
        }
        $this->displayRangeStart = (int)max($this->displayRangeStart, 1);
        $this->displayRangeEnd = (int)min($this->displayRangeEnd, $this->numberOfPages);
    }
492581
public void advancePagination() {
        if (pagination.isPaginated()) {
            pagination = new Pagination(pagination.getStrategy(), pagination.getOffset() + pagination.getLimit(), pagination.getLimit());
        }
    }
582982
function render_last($anchor=true)
	{
	global $PHP_SELF;

		if (!$this->db->pageExecuteCountRows) return;

		if ($anchor) {
		?>
			<a href="<?php echo $PHP_SELF,'?',$this->id,'_next_page=',$this->rs->LastPageNo() ?>"><?php echo $this->last;?></a> &nbsp;
		<?php
		} else {
			print "$this->last &nbsp; ";
		}
	}
167891
function canPageForward () {
    var elements = getElements();
    var lastTab = elements.tabs[ elements.tabs.length - 1 ];

    if (isRtl()) {
      return ctrl.offsetLeft < elements.paging.offsetWidth - elements.canvas.offsetWidth;
    }

    return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canvas.clientWidth +
        ctrl.offsetLeft;
  }
435687
def _next_page(self, offset):
        """"""
        self._log.debug("Iterator c_record={}".format(self.c_record))
        param_dict = self.query_dict.copy()
        param_dict.update(
            {
                'rows': '0',
                'facet': 'true',
                'facet.limit': str(self.page_size),
                'facet.offset': str(offset),
                'facet.zeros': 'false',
            }
        )
        print(param_dict)
        # resp_dict = self.client._get_query(**param_dict)
        resp_dict = self.client._post_query(**param_dict)
        # resp_dict = self.client.search(**param_dict)
        pprint.pprint(resp_dict)
        try:
            self.res = resp_dict['facet_counts']['facet_fields'][self.field]
            self._log.debug(self.res)
        except Exception:
            self.res = []
        self.index = 0
1115100
function MovePages($target_page, $start_page, $end_page = -1)
	{
		// move a page/pages EARLIER in the document
		if ($end_page < 1) {
			$end_page = $start_page;
		}
		$n_toc = $end_page - $start_page + 1;

		// Set/Update PageNumSubstitutions changes before moving anything
		if (count($this->PageNumSubstitutions)) {
			$tp_present = false;
			$sp_present = false;
			$ep_present = false;
			foreach ($this->PageNumSubstitutions as $k => $v) {
				if ($this->PageNumSubstitutions[$k]['from'] == $target_page) {
					$tp_present = true;
					if ($this->PageNumSubstitutions[$k]['suppress'] != 'on' && $this->PageNumSubstitutions[$k]['suppress'] != 1) {
						$this->PageNumSubstitutions[$k]['suppress'] = 'off';
					}
				}
				if ($this->PageNumSubstitutions[$k]['from'] == $start_page) {
					$sp_present = true;
					if ($this->PageNumSubstitutions[$k]['suppress'] != 'on' && $this->PageNumSubstitutions[$k]['suppress'] != 1) {
						$this->PageNumSubstitutions[$k]['suppress'] = 'off';
					}
				}
				if ($this->PageNumSubstitutions[$k]['from'] == ($end_page + 1)) {
					$ep_present = true;
					if ($this->PageNumSubstitutions[$k]['suppress'] != 'on' && $this->PageNumSubstitutions[$k]['suppress'] != 1) {
						$this->PageNumSubstitutions[$k]['suppress'] = 'off';
					}
				}
			}

			if (!$tp_present) {
				list($tp_type, $tp_suppress, $tp_reset) = $this->docPageSettings($target_page);
			}
			if (!$sp_present) {
				list($sp_type, $sp_suppress, $sp_reset) = $this->docPageSettings($start_page);
			}
			if (!$ep_present) {
				list($ep_type, $ep_suppress, $ep_reset) = $this->docPageSettings($start_page - 1);
			}
		}

		$last = [];
		// store pages
		for ($i = $start_page; $i <= $end_page; $i++) {
			$last[] = $this->pages[$i];
		}
		// move pages
		for ($i = $start_page - 1; $i >= ($target_page); $i--) {
			$this->pages[$i + $n_toc] = $this->pages[$i];
		}
		// Put toc pages at insert point
		for ($i = 0; $i < $n_toc; $i++) {
			$this->pages[$target_page + $i] = $last[$i];
		}

		/* -- BOOKMARKS -- */
		// Update Bookmarks
		foreach ($this->BMoutlines as $i => $o) {
			if ($o['p'] >= $target_page) {
				$this->BMoutlines[$i]['p'] += $n_toc;
			}
		}
		/* -- END BOOKMARKS -- */

		// Update Page Links
		if (count($this->PageLinks)) {
			$newarr = [];
			foreach ($this->PageLinks as $i => $o) {
				foreach ($this->PageLinks[$i] as $key => $pl) {
					if (strpos($pl[4], '@') === 0) {
						$p = substr($pl[4], 1);
						if ($p >= $start_page && $p <= $end_page) {
							$this->PageLinks[$i][$key][4] = '@' . ($p + ($target_page - $start_page));
						} elseif ($p >= $target_page && $p < $start_page) {
							$this->PageLinks[$i][$key][4] = '@' . ($p + $n_toc);
						}
					}
				}
				if ($i >= $start_page && $i <= $end_page) {
					$newarr[($i + ($target_page - $start_page))] = $this->PageLinks[$i];
				} elseif ($i >= $target_page && $i < $start_page) {
					$newarr[($i + $n_toc)] = $this->PageLinks[$i];
				} else {
					$newarr[$i] = $this->PageLinks[$i];
				}
			}
			$this->PageLinks = $newarr;
		}

		// OrientationChanges
		if (count($this->OrientationChanges)) {
			$newarr = [];
			foreach ($this->OrientationChanges as $p => $v) {
				if ($p >= $start_page && $p <= $end_page) {
					$newarr[($p + ($target_page - $start_page))] = $this->OrientationChanges[$p];
				} elseif ($p >= $target_page && $p < $start_page) {
					$newarr[$p + $n_toc] = $this->OrientationChanges[$p];
				} else {
					$newarr[$p] = $this->OrientationChanges[$p];
				}
			}
			ksort($newarr);
			$this->OrientationChanges = $newarr;
		}

		// Page Dimensions
		if (count($this->pageDim)) {
			$newarr = [];
			foreach ($this->pageDim as $p => $v) {
				if ($p >= $start_page && $p <= $end_page) {
					$newarr[($p + ($target_page - $start_page))] = $this->pageDim[$p];
				} elseif ($p >= $target_page && $p < $start_page) {
					$newarr[$p + $n_toc] = $this->pageDim[$p];
				} else {
					$newarr[$p] = $this->pageDim[$p];
				}
			}
			ksort($newarr);
			$this->pageDim = $newarr;
		}

		// HTML Headers & Footers
		if (count($this->saveHTMLHeader)) {
			$newarr = [];
			foreach ($this->saveHTMLHeader as $p => $v) {
				if ($p >= $start_page && $p <= $end_page) {
					$newarr[($p + ($target_page - $start_page))] = $this->saveHTMLHeader[$p];
				} elseif ($p >= $target_page && $p < $start_page) {
					$newarr[$p + $n_toc] = $this->saveHTMLHeader[$p];
				} else {
					$newarr[$p] = $this->saveHTMLHeader[$p];
				}
			}
			ksort($newarr);
			$this->saveHTMLHeader = $newarr;
		}
		if (count($this->saveHTMLFooter)) {
			$newarr = [];
			foreach ($this->saveHTMLFooter as $p => $v) {
				if ($p >= $start_page && $p <= $end_page) {
					$newarr[($p + ($target_page - $start_page))] = $this->saveHTMLFooter[$p];
				} elseif ($p >= $target_page && $p < $start_page) {
					$newarr[$p + $n_toc] = $this->saveHTMLFooter[$p];
				} else {
					$newarr[$p] = $this->saveHTMLFooter[$p];
				}
			}
			ksort($newarr);
			$this->saveHTMLFooter = $newarr;
		}

		// Update Internal Links
		if (count($this->internallink)) {
			foreach ($this->internallink as $key => $o) {
				if ($o['PAGE'] >= $start_page && $o['PAGE'] <= $end_page) {
					$this->internallink[$key]['PAGE'] += ($target_page - $start_page);
				} elseif ($o['PAGE'] >= $target_page && $o['PAGE'] < $start_page) {
					$this->internallink[$key]['PAGE'] += $n_toc;
				}
			}
		}

		// Update Links
		if (count($this->links)) {
			foreach ($this->links as $key => $o) {
				if ($o[0] >= $start_page && $o[0] <= $end_page) {
					$this->links[$key][0] += ($target_page - $start_page);
				}
				if ($o[0] >= $target_page && $o[0] < $start_page) {
					$this->links[$key][0] += $n_toc;
				}
			}
		}

		// Update Form fields
		if (count($this->form->forms)) {
			foreach ($this->form->forms as $key => $f) {
				if ($f['page'] >= $start_page && $f['page'] <= $end_page) {
					$this->form->forms[$key]['page'] += ($target_page - $start_page);
				}
				if ($f['page'] >= $target_page && $f['page'] < $start_page) {
					$this->form->forms[$key]['page'] += $n_toc;
				}
			}
		}

		/* -- ANNOTATIONS -- */
		// Update Annotations
		if (count($this->PageAnnots)) {
			$newarr = [];
			foreach ($this->PageAnnots as $p => $anno) {
				if ($p >= $start_page && $p <= $end_page) {
					$np = $p + ($target_page - $start_page);
					foreach ($anno as $o) {
						$newarr[$np][] = $o;
					}
				} elseif ($p >= $target_page && $p < $start_page) {
					$np = $p + $n_toc;
					foreach ($anno as $o) {
						$newarr[$np][] = $o;
					}
				} else {
					$newarr[$p] = $this->PageAnnots[$p];
				}
			}
			$this->PageAnnots = $newarr;
			unset($newarr);
		}
		/* -- END ANNOTATIONS -- */

		// Update TOC pages
		if (count($this->tableOfContents->_toc)) {
			foreach ($this->tableOfContents->_toc as $key => $t) {
				if ($t['p'] >= $start_page && $t['p'] <= $end_page) {
					$this->tableOfContents->_toc[$key]['p'] += ($target_page - $start_page);
				}
				if ($t['p'] >= $target_page && $t['p'] < $start_page) {
					$this->tableOfContents->_toc[$key]['p'] += $n_toc;
				}
			}
		}

		// Update PageNumSubstitutions
		if (count($this->PageNumSubstitutions)) {
			$newarr = [];
			foreach ($this->PageNumSubstitutions as $k => $v) {
				if ($this->PageNumSubstitutions[$k]['from'] >= $start_page && $this->PageNumSubstitutions[$k]['from'] <= $end_page) {
					$this->PageNumSubstitutions[$k]['from'] += ($target_page - $start_page);
					$newarr[$this->PageNumSubstitutions[$k]['from']] = $this->PageNumSubstitutions[$k];
				} elseif ($this->PageNumSubstitutions[$k]['from'] >= $target_page && $this->PageNumSubstitutions[$k]['from'] < $start_page) {
					$this->PageNumSubstitutions[$k]['from'] += $n_toc;
					$newarr[$this->PageNumSubstitutions[$k]['from']] = $this->PageNumSubstitutions[$k];
				} else {
					$newarr[$this->PageNumSubstitutions[$k]['from']] = $this->PageNumSubstitutions[$k];
				}
			}

			if (!$sp_present) {
				$newarr[$target_page] = ['from' => $target_page, 'suppress' => $sp_suppress, 'reset' => $sp_reset, 'type' => $sp_type];
			}
			if (!$tp_present) {
				$newarr[($target_page + $n_toc)] = ['from' => ($target_page + $n_toc), 'suppress' => $tp_suppress, 'reset' => $tp_reset, 'type' => $tp_type];
			}
			if (!$ep_present && $end_page > count($this->pages)) {
				$newarr[($end_page + 1)] = ['from' => ($end_page + 1), 'suppress' => $ep_suppress, 'reset' => $ep_reset, 'type' => $ep_type];
			}
			ksort($newarr);
			$this->PageNumSubstitutions = [];
			foreach ($newarr as $v) {
				$this->PageNumSubstitutions[] = $v;
			}
		}
	}
351992
protected function _offsets()
    {
        if ($display = $this->display) {
            $start  = (int) max($this->current - $display, 1);
            $start  = min($this->count, $start);
            $stop   = (int) min($this->current + $display, $this->count);
        } else { // show all pages
            $start = 1;
            $stop = $this->count;
        }

        $result = array();
        if ($start > 0) {
            foreach (range($start, $stop) as $pagenumber) {
                $result[$pagenumber] =  ($pagenumber-1) * $this->limit;
            }
        }

        return $result;
    }
489582
def end_index(self):
        """"""
        paginator = self.paginator
        # Special case for the last page because there can be orphans.
        if self.number == paginator.num_pages:
            return paginator.count
        return (self.number - 1) * paginator.per_page + paginator.first_page
1209258
protected function displayPrev()
    {
        if ($this->prev_page > 0) {
            $link = $this->getLink();

            $anchor = new SwatHtmlTag('a');
            $anchor->href = sprintf($link, (string) $this->prev_page);
            // this is a non-breaking space
            $anchor->setContent($this->previous_label);
            $anchor->class = 'swat-pagination-nextprev';
            $anchor->display();
        } else {
            $span = new SwatHtmlTag('span');
            $span->class = 'swat-pagination-nextprev';
            $span->setContent($this->previous_label);
            $span->display();
        }
    }
424452
def switch_page(page)
      main.display (@current_page = page)
      @displayed_items = items[current_page * max_items, max_items]
      header_l.draw_path_and_page_number path: current_dir.path, current: current_page + 1, total: total_pages
    end
1112322
public function next()
    {
        $link = $this->_currentPageDoc->navigation('next');
        if ($link && isset($link->pagenum) && $link->pagenum <= $this->_lastPageNumber) {
            $this->_currentPageDoc = $link->follow();
        } else {
            $this->_currentPageDoc = null;
        }
    }
1108257
private function calculateLastItemOnPage()
    {
        // When no limit, the last item is the total amount of items
        if (! $this->hasLimit()) {
            $this->setLastItemOnPage($this->getTotalItems());
            return;
        }

        // Determine the last item on the page
        $lastItem = $this->getOffset() + $this->getLimit();
        if ($this->getTotalItems() !== 0 && $lastItem > $this->getTotalItems()) {
            $lastItem = $this->getTotalItems();
        }

        $this->setLastItemOnPage((int)$lastItem);
    }
939902
function(last) {
            var carousel    = this,
                numItems    = carousel.get("numItems"),
                numVisible  = carousel.get("numVisible"),
                reveal      = carousel.get("revealAmount"),
                first       = carousel._itemsTable.items.length,
                lastVisible = carousel.get("lastVisible");

            // adjust if going backwards
            if(first > last && last+1 >= numVisible){
                // need to get first a bit differently for the last page
                first = last % numVisible || last == lastVisible ? last - last % numVisible : last - numVisible + 1;
            }

            if(reveal && last < numItems - 1){ last++; }

            if (last >= first && (!carousel.getItem(first) || !carousel.getItem(last))) {
                carousel.fireEvent(loadItemsEvent, {
                        ev: loadItemsEvent, first: first, last: last,
                        num: last - first + 1
                });
            }

        }
327593
function moveRender (type) {
    var method = type ? 'down' : 'up'
    
    ui
      .left(lastLen + 2)
      .up(count - cur)
      .write('  ')
    
    // Each time move to right-bottom.
    ui[method]()
      .left(2)
      .write(chalk.blue(pointer))
      .left(2)
      .down(count - (type ? ++cur : --cur))
      .right(lastLen + 2)
  }
1082866
def goto_last_item
      bc = @buttons.count
      f = nil
      @components[bc..-1].each { |c| 
        if c.focusable
          f = c
        end
      }
      if f
        leave_current_component
        @current_component = f
        set_form_row
      end
    end
1322471
public function next()
    {
        // Using isset here because it is way faster than array_key_exists...
        if (isset($this->sheets[$this->currentSheetIndex])) {
            $currentSheet = $this->sheets[$this->currentSheetIndex];
            $currentSheet->getRowIterator()->end();

            $this->currentSheetIndex++;
        }
    }