ultimix
change_history_view_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_grid_header ($id)
 get_grid_lines (&$Changes)
 get_changes_grid ($id, $ObjectType)

Data Fields

 $ChangeHistoryAcces = false

Detailed Description

Class provides records change history manupulation routine.

Author
Dodonov A.A.

Definition at line 26 of file change_history_view.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 54 of file change_history_view.php.

{
try
{
$this->ChangeHistoryAcces = get_package(
'database::change_history::change_history_access' , 'last' , __FILE__
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

get_changes_grid (   $id,
  $ObjectType 
)

Function retrives changes history grid.

Parameters
$id- Id of the saving record.
$ObjectType- Object type.
Returns
HTML code of the changes history.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 220 of file change_history_view.php.

{
try
{
$Changes = $this->ChangeHistoryAcces->get_history( $id , $ObjectType );
if( isset( $Changes[ 0 ] ) )
{
$Code = $this->get_grid_header( $id );
$Code .= $this->get_grid_lines( $Changes );
$Footer = $this->CachedMultyFS->get_template( __FILE__ , 'change_history_footer.tpl' );
$Code .= str_replace( '{code}' , $Code , $Footer );
}
else
{
$NoDataFound = $this->CachedMultyFS->get_template( __FILE__ , 'change_history_no_data_found.tpl' );
$Code = str_replace( '{id}' , $id , $NoDataFound );
}
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_grid_header (   $id)

Function returns grid's header.

Parameters
$id- Record's id.
Returns
HTML code of the grid's header.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 90 of file change_history_view.php.

{
try
{
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'change_history_header.tpl' );
return( str_replace( '{id}' , $id , $Code ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_grid_lines ( $Changes)

Function returns grid's rows.

Parameters
$Changes- Changes.
Returns
HTML code of the grid's rows.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 167 of file change_history_view.php.

{
try
{
$Lines = $Previous = array();
foreach( $Changes as $i => $Change )
{
list( $PlaceHolders , $Data ) = $this->get_replace_parameters();
$Code = $this->CachedMultyFS->get_template( __FILE__ , 'change_history_item.tpl' );
$Code = str_replace( $PlaceHolders , $Data , $Code );
$Previous[ $FieldName ] = $FieldValue;
$Lines [] = $Code;
}
return( implode( '' , array_reverse( $Lines ) ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$ChangeHistoryAcces = false

Cached packages.

Author
Dodonov A.A.

Definition at line 38 of file change_history_view.php.


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