Elgg  Version 6.2
Variables
pagination.php File Reference

Go to the source code of this file.

Variables

 $count = (int) elgg_extract('count', $vars, 0)
 Elgg pagination. More...
 
if(empty($count)) $offset = abs((int) elgg_extract('offset', $vars, 0))
 
 $limit = (int) elgg_extract('limit', $vars, elgg_get_config('default_limit'), false)
 
 $offset_key = elgg_extract('offset_key', $vars, 'offset')
 
 $url_fragment = elgg_extract('url_fragment', $vars, '')
 
 $use_referer = (bool) elgg_extract('use_referer', $vars, get_input('use_referer', true))
 
if(isset($vars['base_url']) && $vars['base_url']) elseif($use_referer &&elgg_is_xhr() &&!empty($_SERVER['HTTP_REFERER'])) else
 
 $base_url_has_fragment = preg_match('~#.~', $base_url)
 
 $get_href
 
if($count<=$limit && $offset==0) $total_pages = (int) ceil($count / $limit)
 
 $current_page = (int) ceil($offset / $limit) + 1
 
 $pages = []
 
 $start_page = max(min([$current_page - 2, $total_pages - 4]), 1)
 
if((bool) elgg_extract('pagination_show_previous', $vars, true) &&($current_page !==1)) if((bool) elgg_extract('pagination_show_numbers', $vars, true)) if((bool) elgg_extract('pagination_show_next', $vars, true) &&($current_page !==$total_pages)) $list = ''
 
foreach($pages as $page_num=> $page) if(empty($list)) $pagination_class = elgg_extract_class($vars, ['elgg-pagination'], 'pagination_class')
 
 $position = elgg_extract('position', $vars)
 
 if (!empty( $position))
 

Variable Documentation

◆ $base_url_has_fragment

$base_url_has_fragment = preg_match('~#.~', $base_url)

Definition at line 43 of file pagination.php.

◆ $count

$count = (int) elgg_extract('count', $vars, 0)

Elgg pagination.

@uses string $vars['base_url'] Base URL to use in links @uses int $vars['count'] Number of items in list @uses int $vars['limit'] Number of items per page @uses int $vars['offset'] The offset in the list @uses string $vars['offset_key'] The string to use for offet in the URL @uses string[] $vars['pagination_class'] Additional class to add to the pagination @uses string $vars['pagination_next_text'] Text to show on the next link (default: 'next') @uses string $vars['pagination_previous_text'] Text to show on the previous link (default: 'previous') @uses bool $vars['pagination_show_numbers'] Show the 'in between' page numbers (default: true) @uses bool $vars['pagination_show_next'] Show the next link (default: true) @uses bool $vars['pagination_show_previous'] Show the previous link (default: true) @uses string $vars['position'] Where is the pagination being shown ('before'|'after') @uses string $vars['url_fragment'] URL fragment to add to links if not present in base_url (optional) @uses bool $vars['use_referer'] Use HTTP REFERER for base url in case of XHR requests (default: true)

Definition at line 21 of file pagination.php.

◆ $current_page

$current_page = (int) ceil($offset / $limit) + 1

Definition at line 60 of file pagination.php.

◆ $get_href

$get_href
Initial value:
$link .= "#$url_fragment";
}
return $link;
}
if(! $item instanceof ElggEntity) $link
Definition: container.php:16
if(! $pagination && $limit !==false &&!empty($items) &&count($items) >=$limit) $base_url
Definition: list.php:114
elgg_http_add_url_query_elements(string $url, array $elements)
Sets elements in a URL's query string.
Definition: elgglib.php:183
if(empty($count)) $offset
Definition: pagination.php:26
$url_fragment
Definition: pagination.php:31
$base_url_has_fragment
Definition: pagination.php:43
$offset_key
Definition: pagination.php:30

Definition at line 45 of file pagination.php.

◆ $limit

$limit = (int) elgg_extract('limit', $vars, elgg_get_config('default_limit'), false)

Definition at line 28 of file pagination.php.

◆ $list

if ((bool) elgg_extract( 'pagination_show_previous', $vars, true) &&( $current_page !==1)) if ((bool) elgg_extract( 'pagination_show_numbers', $vars, true)) if ((bool) elgg_extract( 'pagination_show_next', $vars, true) &&( $current_page !==$total_pages)) $list = ''

Definition at line 134 of file pagination.php.

◆ $offset

if (empty( $count)) $offset = abs((int) elgg_extract('offset', $vars, 0))
Examples
/root/Elgg/engine/lib/views.php.

Definition at line 26 of file pagination.php.

◆ $offset_key

$offset_key = elgg_extract('offset_key', $vars, 'offset')

Definition at line 30 of file pagination.php.

◆ $pages

$pages = []

Definition at line 62 of file pagination.php.

◆ $pagination_class

foreach ( $pages as $page_num=> $page) if (empty( $list)) $pagination_class = elgg_extract_class($vars, ['elgg-pagination'], 'pagination_class')

Definition at line 174 of file pagination.php.

◆ $position

$position = elgg_extract('position', $vars)

Definition at line 175 of file pagination.php.

◆ $start_page

$start_page = max(min([$current_page - 2, $total_pages - 4]), 1)

Definition at line 65 of file pagination.php.

◆ $total_pages

if ( $count<=$limit &&$offset==0) $total_pages = (int) ceil($count / $limit)

Definition at line 59 of file pagination.php.

◆ $url_fragment

$url_fragment = elgg_extract('url_fragment', $vars, '')

Definition at line 31 of file pagination.php.

◆ $use_referer

$use_referer = (bool) elgg_extract('use_referer', $vars, get_input('use_referer', true))

Definition at line 32 of file pagination.php.

◆ else

if (isset( $vars[ 'base_url']) &&$vars[ 'base_url']) elseif ( $use_referer &&elgg_is_xhr() &&!empty( $_SERVER[ 'HTTP_REFERER'])) else
Initial value:
{
elgg_get_current_url()
Returns the current page's complete URL.

Definition at line 39 of file pagination.php.

◆ if

if(!empty($position)) ( empty $position)

Definition at line 176 of file pagination.php.