Elgg
Version 6.0
|
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)) | |
$base_url_has_fragment = preg_match('~#.~', $base_url) |
Definition at line 43 of file pagination.php.
$count = (int) elgg_extract('count', $vars, 0) |
Elgg pagination.
string $vars['base_url'] Base URL to use in links int $vars['count'] Number of items in list int $vars['limit'] Number of items per page int $vars['offset'] The offset in the list string $vars['offset_key'] The string to use for offet in the URL string[] $vars['pagination_class'] Additional class to add to the pagination string $vars['pagination_next_text'] Text to show on the next link (default: 'next') string $vars['pagination_previous_text'] Text to show on the previous link (default: 'previous') bool $vars['pagination_show_numbers'] Show the 'in between' page numbers (default: true) bool $vars['pagination_show_next'] Show the next link (default: true) bool $vars['pagination_show_previous'] Show the previous link (default: true) string $vars['position'] Where is the pagination being shown ('before'|'after') string $vars['url_fragment'] URL fragment to add to links if not present in base_url (optional) 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 = (int) ceil($offset / $limit) + 1 |
Definition at line 60 of file pagination.php.
$get_href |
Definition at line 45 of file pagination.php.
$limit = (int) elgg_extract('limit', $vars, elgg_get_config('default_limit'), false) |
Definition at line 28 of file pagination.php.
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.
if (empty($count)) $offset = abs((int) elgg_extract('offset', $vars, 0)) |
Definition at line 26 of file pagination.php.
$offset_key = elgg_extract('offset_key', $vars, 'offset') |
Definition at line 30 of file pagination.php.
$pages = [] |
Definition at line 62 of file pagination.php.
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 = elgg_extract('position', $vars) |
Definition at line 175 of file pagination.php.
$start_page = max(min([$current_page - 2, $total_pages - 4]), 1) |
Definition at line 65 of file pagination.php.
if ($count<=$limit &&$offset==0) $total_pages = (int) ceil($count / $limit) |
Definition at line 59 of file pagination.php.
$url_fragment = elgg_extract('url_fragment', $vars, '') |
Definition at line 31 of file pagination.php.
$use_referer = (bool) elgg_extract('use_referer', $vars, get_input('use_referer', true)) |
Definition at line 32 of file pagination.php.
if (isset($vars['base_url'])&&$vars['base_url']) elseif ($use_referer &&elgg_is_xhr()&&!empty($_SERVER['HTTP_REFERER'])) else |
Definition at line 39 of file pagination.php.
if(!empty($position)) |
Definition at line 176 of file pagination.php.