ultimix
paging_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 compile_non_ajaxed_left_slider (&$Paging, $Control)
 compile_reorder_field (&$Paging)
 compile_left_slider (&$Paging, $Control)
 compile_controller_options (&$Paging, &$Settings)
 get_records_per_page_control (&$Paging, &$Settings)
 compile_records_per_page_control (&$Paging, $Control)
 compile_non_ajaxed_right_slider (&$Paging, $Control)
 compile_right_slider (&$Paging, $CountOfRecords, $Control)
 set_order_data (&$Paging, $HiddenFields)
 compile_sort_link (&$Paging, $HiddenFields)

Data Fields

 $CachedMultyFS = false
 $Settings = false
 $Security = false

Detailed Description

Definition at line 16 of file paging_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 46 of file paging_markup.php.

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

Member Function Documentation

compile_controller_options ( $Paging,
$Settings 
)

Creating settings set.

Parameters
$Paging- Grid.
$Settings- Compilation parameters.
Returns
HTML код.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 222 of file paging_markup.php.

{
try
{
$Limit = $Settings->get_setting( 'limit' , 1000 );
$Values = array(
1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ,
20 , 30 , 40 , 50 , 100 , 200 , 300 , 400 , 500 , 1000
);
$Options = '';
foreach( $Values as $k => $v )
{
if( $v <= $Limit )
{
$Options .= $this->CachedMultyFS->get_template(
__FILE__ , 'records_per_page_options.tpl'
);
$Options = str_replace(
array( '{value}' , '{title}' , '{selected}' ) ,
array( $v , $v , ( $Paging->RecordsPerPage == $v ? ' selected' : '' ) ) ,
$Options
);
}
}
return( $Options );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_left_slider ( $Paging,
  $Control 
)

Function returns code of the control.

Parameters
$Paging- Grid.
Returns
Left side switching control.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 177 of file paging_markup.php.

{
try
{
if( $Paging->Page > 1 )
{
return( $this->compile_non_ajaxed_left_slider( $Paging , $Control ) );
}
else
{
return( str_replace( '{left_slide}' , '{lang:left_side_switcher}' , $Control ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_non_ajaxed_left_slider ( $Paging,
  $Control 
)

Function returns code of the control.

Parameters
$Paging- Grid.
$CountOfRecords- Count of the selected records.
$Control- Grid's code.
Returns
Right side switching control.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 91 of file paging_markup.php.

{
try
{
$Fields = $_GET;
$Fields[ $Paging->PageField ] = $Paging->Page - 1;
$Fields = $Paging->Utilities->pack_into_url( $Fields , array( 'page_name' ) );
$Fields = str_replace( '=' , '[eq]' , $Fields );
$Code = '{href:form_id='.$Paging->FormId.
";tpl=submit0;text=left_side_switcher;action=./[page_name].html?$Fields}";
return( str_replace( '{left_slide}' , $Code , $Control ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_non_ajaxed_right_slider ( $Paging,
  $Control 
)

Function returns code of the control.

Parameters
$Paging- Grid.
$CountOfRecords- Count of the selected records.
$Control- Grid's code.
Returns
Right side switching control.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 418 of file paging_markup.php.

{
try
{
$Fields = $_GET;
$Fields[ $Paging->PageField ] = $Paging->Page + 1;
$Fields = $Paging->Utilities->pack_into_url( $Fields , array( 'page_name' ) );
$Fields = str_replace( '=' , '[eq]' , $Fields );
return(
str_replace(
'{right_slide}' ,
'{href:form_id='.$Paging->FormId.";tpl=submit0;text=right_side_switcher;action=./".
"[page_name].html?$Fields}" , $Control
)
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_records_per_page_control ( $Paging,
  $Control 
)

Creating settings set.

Parameters
$Paging- Grid.
Returns
HTML code.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 363 of file paging_markup.php.

{
try
{
$Control = str_replace(
'{records_per_page_control}' , '{records_per_page_control:type=default}' , $Control
);
for( ; $Parameters = $Paging->String->get_macro_parameters( $Control , 'records_per_page_control' ) ; )
{
$this->Settings->load_settings( $Parameters );
$Code = $this->get_records_per_page_control( $Paging , $this->Settings );
$Control = str_replace( "{records_per_page_control:$Parameters}" , $Code , $Control );
}
return( $Control );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_reorder_field ( $Paging)

Function returns code of the control.

Parameters
$Paging- Grid.
Returns
Right side switching control.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 133 of file paging_markup.php.

{
try
{
$ReorderField = '';
if( $this->Security->get_gp( 'reorder_field' ) )
{
$Field = $this->Security->get_gp( 'reorder_field' , 'command' );
$Order =
$this->Security->get_gp( 'order' , 'command' ) === 'ascending' ? 'ascending' : 'descending';
$ReorderField = " , 'reorder_field' : '$Field' , 'order' : '$Order'";
}
return( $ReorderField );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_right_slider ( $Paging,
  $CountOfRecords,
  $Control 
)

Function returns code of the control.

Parameters
$Paging- Grid.
$CountOfRecords- Count of the selected records.
$Control- Grid's code.
Returns
Right side switching control.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 471 of file paging_markup.php.

{
try
{
if( $CountOfRecords === $Paging->RecordsPerPage + 1 )
{
return( $this->compile_non_ajaxed_right_slider( $Paging , $Control ) );
}
else
{
return( str_replace( '{right_slide}' , '{lang:right_side_switcher}' , $Control ) );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_sort_link ( $Paging,
  $HiddenFields 
)

Function compiles macro 'sort_link'.

Parameters
$Paging- Grid.
$HiddenFields- Fields.
Returns
Fields.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 566 of file paging_markup.php.

{
try
{
for( ; $Parameters = $Paging->String->get_macro_parameters( $Paging->Header , 'sort_link' ) ; )
{
$this->Settings->load_settings( $Parameters );
$HiddenFields = $this->set_order_data( $Paging , $HiddenFields );
$Paging->Header = str_replace( "{sort_link:$Parameters}" , "{href:style=display:block;text=".
$this->Settings->get_setting( 'text' ).";page=javascript:ultimix.Reorder( '#".$Paging->FormId.
"' , ".( $Paging->Ajaxed ? 'true' : 'false' )." , './[page_name].html' , '".
$this->Settings->get_setting( 'dbfield' )."' )}" , $Paging->Header
);
}
return( $HiddenFields );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_records_per_page_control ( $Paging,
$Settings 
)

Creating settings set.

Parameters
$Paging- Grid.
$Settings- Compilation parameters.
Returns
HTML код.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 318 of file paging_markup.php.

{
try
{
$Fields = $this->get_fields( $Paging );
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'records_per_page_control.tpl' );
$Macro = array( '{reorder_field}' , '{prefix}' , '{fields}' , '{form_id}' , '{options}' );
$Data = array(
$this->Security->get_gp( 'reorder_field' , 'command' , '' ) , $Paging->Prefix , $Fields ,
$Paging->FormId , $this->compile_controller_options( $Paging , $Settings )
);
$Code = str_replace( $Macro , $Data , $Code );
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_order_data ( $Paging,
  $HiddenFields 
)

Function compiles macro 'sort_link'.

Parameters
$Paging- Grid.
$HiddenFields- Fields.
Returns
Fields.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 516 of file paging_markup.php.

{
try
{
$ReorderField = $this->Security->get_gp( 'reorder_field' , 'command' , false );
if( $ReorderField && $this->Settings->get_setting( 'dbfield' ) === $ReorderField )
{
$Order = ( $this->Security->get_gp( 'order' , 'command' ) === 'ascending' ?
'ascending' : 'descending' );
$HiddenFields = str_replace( '{order}' , $Order , $HiddenFields );
$HiddenFields = str_replace(
'{field}' , $this->Settings->get_setting( 'dbfield' ) , $HiddenFields
);
}
return( $HiddenFields );
}
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 28 of file paging_markup.php.

$Security = false

Definition at line 30 of file paging_markup.php.

$Settings = false

Definition at line 29 of file paging_markup.php.


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