Elgg  Version 1.9
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')) $offset = abs((int) elgg_extract('offset', $vars, 0))
 
if(! $limit=(int) elgg_extract('limit', $vars, 10)) $count = (int) elgg_extract('count', $vars, 0)
 
 $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
 
 $num_pages = elgg_extract('num_pages', $vars, 10)
 
 $delta = ceil($num_pages / 2)
 
if($count<=$limit && $offset==0) $total_pages = ceil($count / $limit)
 
 $current_page = ceil($offset / $limit) + 1
 
 $pages = new stdClass()
 
$pages prev
 
$pages next
 
$pages items = array()
 
if($current_page > 1) $pages items [] = $current_page
 
 if ( $current_page< $total_pages)
 

Variable Documentation

◆ $count

if (! $limit=(int) elgg_extract( 'limit', $vars, 10)) $count = (int) elgg_extract('count', $vars, 0)

Definition at line 26 of file pagination.php.

◆ $current_page

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

Definition at line 49 of file pagination.php.

◆ $delta

$delta = ceil($num_pages / 2)

Definition at line 41 of file pagination.php.

◆ $num_pages

$num_pages = elgg_extract('num_pages', $vars, 10)

Definition at line 40 of file pagination.php.

◆ $offset

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

Definition at line 20 of file pagination.php.

◆ $offset_key

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

Definition at line 27 of file pagination.php.

◆ $pages

$pages = new stdClass()

Definition at line 51 of file pagination.php.

◆ $total_pages

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

Definition at line 48 of file pagination.php.

◆ else

foreach ( $pages->items as $page) if ( $pages->next[ 'href']) else
Initial value:
{
$base_url
Definition: list.php:24
current_page_url()
Returns the current page's complete URL.
Definition: input.php:106

Definition at line 36 of file pagination.php.

◆ if

if($current_page< $total_pages) ( )

Definition at line 87 of file pagination.php.

◆ items [1/2]

$pages items = array()

Definition at line 62 of file pagination.php.

◆ items [2/2]

if ( $current_page > 1) $pages items[] = $current_page

Definition at line 83 of file pagination.php.

◆ next

$pages next
Initial value:
= array(
'text' => elgg_echo('next'),
'href' => '',
'is_trusted' => true,
)
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 57 of file pagination.php.

◆ prev

$pages prev
Initial value:
= array(
'text' => elgg_echo('previous'),
'href' => '',
'is_trusted' => true,
)

Definition at line 52 of file pagination.php.