Elgg  Version 2.2
Namespaces | Variables
pagination.php File Reference

Go to the source code of this file.


 Save menu items.


if(elgg_in_context('widget')) $count = (int) elgg_extract('count', $vars, 0)
if(!$count) $offset = abs((int) elgg_extract('offset', $vars, 0))
if(!$limit=(int) elgg_extract('limit', $vars, elgg_get_config('default_limit'))) $offset_key = elgg_extract('offset_key', $vars, 'offset')
 $url_fragment = elgg_extract('url_fragment', $vars, '')
if(isset($vars['base_url'])&&$vars['base_url']) elseif(elgg_is_xhr()&&!empty($_SERVER['HTTP_REFERER'])) else
 $base_url_has_fragment = preg_match('~#.~', $base_url)
if($count<=$limit &&$offset==0) $total_pages = (int) ceil($count / $limit)
 $current_page = (int) ceil($offset / $limit) + 1
 $pages = array()
 $start_page = max(min([$current_page - 2, $total_pages - 4]), 1)
 $prev_offset = $offset - $limit
if($prev_offset< 1) $pages ['prev']
if($prev_offset< 1) if($current_page==1) if(1< $start_page) if(1< ($start_page-2)) elseif($start_page==3) $max = 1
for($page=$start_page;$page<=$total_pages;$page++) if($total_pages >($start_page+6)) elseif(($start_page+5)==($total_pages-1)) if($total_pages >=($start_page+5)) $next_offset = $offset + $limit
if($next_offset >=$count) $pages ['next']
if($next_offset >=$count) if($current_page==$total_pages) $list =""
 foreach ($pages as $page_num=> $page)

Variable Documentation

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

Definition at line 44 of file pagination.php.

if (elgg_in_context('widget')) $count = (int) elgg_extract('count', $vars, 0)

Definition at line 21 of file pagination.php.

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

Definition at line 60 of file pagination.php.

Initial value:
$link = elgg_http_add_url_query_elements($base_url, array($offset_key => $offset));
$link .= "#$url_fragment";
return $link;
elgg_http_add_url_query_elements($url, array $elements)
Sets elements in a URL&#39;s query string.
Definition: elgglib.php:1171
Definition: pagination.php:33
if(!$count) $offset
Definition: pagination.php:26
if(!$limit=(int) elgg_extract('limit', $vars, elgg_get_config('default_limit'))) $offset_key
Definition: pagination.php:32
Definition: pagination.php:44
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:5

Definition at line 46 of file pagination.php.

if ($next_offset >=$count) if ($current_page==$total_pages) $list =""

Definition at line 131 of file pagination.php.

if ($prev_offset< 1) if ($current_page==1) if (1< $start_page) if (1< ($start_page-2)) elseif ($start_page==3) $max = 1

Definition at line 95 of file pagination.php.

for ($page=$start_page;$page<=$total_pages;$page++) if ($total_pages >($start_page+6)) elseif (($start_page+5)==($total_pages-1)) if ($total_pages >=($start_page+5)) $next_offset = $offset + $limit

Definition at line 117 of file pagination.php.

if (!$count) $offset = abs((int) elgg_extract('offset', $vars, 0))

Definition at line 26 of file pagination.php.

if (!$limit=(int) elgg_extract('limit', $vars, elgg_get_config('default_limit'))) $offset_key = elgg_extract('offset_key', $vars, 'offset')

Definition at line 32 of file pagination.php.

$pages = array()

Definition at line 62 of file pagination.php.

if ($prev_offset< 1) $pages['prev']
Initial value:
= [
'text' => elgg_echo('previous')
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21

Definition at line 74 of file pagination.php.

if ($next_offset >=$count) $pages['next']
Initial value:
= [
'text' => elgg_echo('next')
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21

Definition at line 122 of file pagination.php.

$prev_offset = $offset - $limit

Definition at line 68 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 33 of file pagination.php.

if (isset($vars['base_url'])&&$vars['base_url']) elseif (elgg_is_xhr()&&!empty($_SERVER['HTTP_REFERER'])) else
Initial value:
$base_url = current_page_url()
Returns the current page&#39;s complete URL.
Definition: input.php:65

Definition at line 40 of file pagination.php.

foreach($pages as $page_num=> $page)

Definition at line 132 of file pagination.php.