Elgg  Version 1.11
Namespaces | Variables
pagination.php File Reference

Go to the source code of this file.

Namespaces

 Elgg
 Save menu items.
 

Variables

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')
 
if(isset($vars['base_url']) && $vars['base_url']) else if(isset($vars['baseurl']) && $vars['baseurl']) elseif(elgg_is_xhr() &&!empty($_SERVER['HTTP_REFERER'])) else
 
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($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($current_page==$total_pages) $list =""
 
 foreach ( $pages as $page_num=> $page)
 

Variable Documentation

◆ $count

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

Definition at line 20 of file pagination.php.

◆ $current_page

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

Definition at line 50 of file pagination.php.

◆ $list

if ( $current_page==$total_pages) $list =""

Definition at line 121 of file pagination.php.

◆ $max

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

Definition at line 85 of file pagination.php.

◆ $next_offset

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 107 of file pagination.php.

◆ $offset

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

Definition at line 25 of file pagination.php.

◆ $offset_key

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

Definition at line 31 of file pagination.php.

◆ $pages [1/3]

$pages = array()

Definition at line 52 of file pagination.php.

◆ $pages [2/3]

if ( $next_offset >=$count) $pages[ 'next']
Initial value:
= [
'text' => elgg_echo('next'),
]
elgg_http_add_url_query_elements($url, array $elements)
Sets elements in a URL's query string.
Definition: elgglib.php:1107
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(! $limit=(int) elgg_extract('limit', $vars, elgg_get_config('default_limit'))) $offset_key
Definition: pagination.php:31
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
Definition: pagination.php:107

Definition at line 112 of file pagination.php.

◆ $pages [3/3]

if ( $prev_offset< 1) $pages[ 'prev'] ( )
Initial value:
= [
'text' => elgg_echo('previous'),
]
$prev_offset
Definition: pagination.php:58

Definition at line 64 of file pagination.php.

◆ $prev_offset

$prev_offset = $offset - $limit

Definition at line 58 of file pagination.php.

◆ $start_page

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

Definition at line 55 of file pagination.php.

◆ $total_pages

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

Definition at line 49 of file pagination.php.

◆ else

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

Definition at line 40 of file pagination.php.

◆ foreach

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

Definition at line 122 of file pagination.php.