ultimix
review_markup_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_reviews_for_object (&$Settings)
 compile_review_line (&$Settings)
 compile_review_form (&$Settings)
 compile_review_rank (&$Settings)

Data Fields

 $CachedMultyFS = false
 $ReviewAccess = false
 $ReviewAlgorithms = false
 $String = false

Detailed Description

Class processes macro.

Author
Dodonov A.A.

Definition at line 26 of file review_markup.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 57 of file review_markup.php.

{
try
{
$this->CachedMultyFS = get_package_object( 'cached_multy_fs' , 'last' , __FILE__ );
$this->ReviewAccess = get_package( 'review::review_access' , 'last' , __FILE__ );
$this->ReviewAlgorithms = get_package( 'review::review_algorithms' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_review_form ( $Settings)

Function compiles macro 'review_form'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 184 of file review_markup.php.

{
try
{
$MasterId = $Settings->get_setting( 'master_id' );
$MasterType = $Settings->get_setting( 'master_type' );
$Code = '{direct_controller:package_name=review::review_controller;meta=meta_create_review;'.
"master_type=$MasterType;master_id=$MasterId;direct_create=1}".
'{direct_view:package_name=review::review_view;meta=meta_create_review_form;'.
"master_type=$MasterType;master_id=$MasterId;direct_create=1}";
return( $Code );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_review_line ( $Settings)

Function compiles macro 'review_rank'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 131 of file review_markup.php.

{
try
{
$Reviews = $this->get_reviews_for_object( $Settings );
if( isset( $Reviews[ 0 ] ) )
{
$ReviewLine = '';
$TemplatePath = dirname( __FILE__ ).'/res/templates/default_review_template.tpl';
foreach( $Reviews as $i => $Review )
{
$ReviewLine .= $this->CachedMultyFS->file_get_contents( $TemplatePath );
$ReviewLine = $this->String->print_record( $ReviewLine , $Review );
}
return( $ReviewLine );
}
else
{
return( '{lang:reviews_were_not_found}' );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_review_rank ( $Settings)

Function compiles macro 'review_rank'.

Parameters
$Settings- Parameters.
Returns
HTML code.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 226 of file review_markup.php.

{
try
{
$MasterType = $Settings->get_setting( 'master_type' );
$MasterId = $Settings->get_setting( 'master_id' );
return( $this->RankAccess->get_total_rank( $MasterType , $MasterId ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_reviews_for_object ( $Settings)

Function returns all reviews for the object.

Parameters
$Settings- Parameters.
Returns
Reviews object.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 94 of file review_markup.php.

{
try
{
$MasterId = $Settings->get_setting( 'master_id' );
$MasterType = $Settings->get_setting( 'master_type' );
return( $this->ReviewAlgorithms->get_records_for_object( $MasterId , $MasterType ) );
}
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 review_markup.php.

$ReviewAccess = false

Definition at line 39 of file review_markup.php.

$ReviewAlgorithms = false

Definition at line 40 of file review_markup.php.

$String = false

Definition at line 41 of file review_markup.php.


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