Detailed Description
Class processes macro.
- Author
- Dodonov A.A.
Definition at line 26 of file comment_markup.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 58 of file comment_markup.php.
{
try
{
$this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
$this->CommentAlgorithms =
get_package(
'comment::comment_algorithms' ,
'last' , __FILE__ );
$this->Link =
get_package(
'link' ,
'last' , __FILE__ );
$this->String =
get_package(
'string' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| compile_comment_form |
( |
|
$Parameters | ) |
|
Function compiles macro 'comment_form'.
- Parameters
-
| $Parameters | - Compilation parameters. |
- Returns
- Widget.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 230 of file comment_markup.php.
{
try
{
$this->Settings->load_settings( $Parameters );
list( $MasterType , $MasterId )= $this->Settings->get_settings( 'master_type,master_id' );
$NeedRun = $this->Settings->get_setting( 'need_run' , 1 );
$Code = '{direct_controller:package_name=comment::comment_controller;meta=meta_create_comment;'.
"master_type=$MasterType;master_id=$MasterId;direct_create=1;need_run=$NeedRun}".
'{direct_view:package_name=comment::comment_view;meta=meta_create_comment_form;'.
"master_type=$MasterType;master_id=$MasterId;direct_create=1;need_run=$NeedRun}";
return( $Code );
}
catch( Exception $e )
{
}
}
| compile_comment_link |
( |
& |
$Settings | ) |
|
Function compiles macro 'comment_link'.
- Parameters
-
| $Settings | - Compilation parameters. |
- Returns
- Widget.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 186 of file comment_markup.php.
{
try
{
$MasterId =
$Settings->get_setting(
'master_id' );
$MasterType =
$Settings->get_setting(
'master_type' );
$CommentsCount = $this->Link->get_links_count( $MasterId , false , $MasterType , 'comment' );
$Template = $this->CachedMultyFS->get_template( __FILE__ , 'comment_link.tpl' );
$PlaceHolders = array( '{page}' , '{comment_count}' );
return( str_replace( $PlaceHolders , array( $Page , $CommentsCount ) , $Template ) );
}
catch( Exception $e )
{
}
}
| compile_comments |
( |
& |
$Settings | ) |
|
Function compiles comment list.
- Parameters
-
| $Settings | - Compilation parameters. |
- Returns
- Comment line's HTML code.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 96 of file comment_markup.php.
{
try
{
if( isset( $Comments[ 0 ] ) )
{
$CommentLine = '';
$TemplatePath = dirname( __FILE__ ).'/res/templates/default_comment_template.tpl';
foreach( $Comments as $i => $Comment )
{
$CommentLine .= $this->CachedMultyFS->file_get_contents( $TemplatePath );
$CommentLine = $this->String->print_record( $CommentLine , $Comment );
}
return( $CommentLine );
}
else
{
return( '{lang:comments_were_not_found}' );
}
}
catch( Exception $e )
{
}
}
| get_comments_for_object |
( |
& |
$Settings | ) |
|
Function returns all comments for the object.
- Parameters
-
- Returns
- Comments object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 149 of file comment_markup.php.
{
try
{
$MasterId =
$Settings->get_setting(
'master_id' );
$MasterType =
$Settings->get_setting(
'master_type' );
return( $this->CommentAlgorithms->get_records_for_object( $MasterId , $MasterType ) );
}
catch( Exception $e )
{
}
}
Field Documentation
| $CommentAlgorithms = false |
The documentation for this class was generated from the following file: