ultimix
paginator_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_paginator (&$Settings)

Data Fields

 $CachedMultyFS = false

Detailed Description

Class loads paginator3000 component.

Author
Dodonov A.A.

Definition at line 26 of file paginator.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 54 of file paginator.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_paginator ( $Settings)

Function compiles macro 'paginator3000'.

Parameters
$Settings- Processing options.
Returns
Widget.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 130 of file paginator.php.

{
try
{
$Code = '';
$RecordCount = $this->get_record_count( $Settings );
$RecordsPerPage = $Settings->get_setting( 'records_per_page' , 25 );
$PageField = $Settings->get_setting( 'page_field' , 'page' );
if( $RecordCount > $RecordsPerPage )
{
$Pages = ceil( $RecordCount / $RecordsPerPage );
for( $i = 1 ; $i <= $Pages ; $i++ )
{
$Code .= $this->CachedMultyFS->get_template( __FILE__ , 'paginator_item.tpl' );
$Code .= $i != $Pages ? '&nbsp;' : '';
$Code = str_replace( array( '{i}' , '{field}' ) , array( $i , $PageField ) , $Code );
}
}
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file paginator.php.


The documentation for this class was generated from the following file: