63 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
64 $this->CommentAlgorithms =
get_package(
'comment::comment_algorithms' ,
'last' , __FILE__ );
65 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
66 $this->String =
get_package(
'string' ,
'last' , __FILE__ );
102 if( isset( $Comments[ 0 ] ) )
106 $TemplatePath = dirname( __FILE__ ).
'/res/templates/default_comment_template.tpl';
108 foreach( $Comments as $i => $Comment )
110 $CommentLine .= $this->CachedMultyFS->file_get_contents( $TemplatePath );
111 $CommentLine = $this->String->print_record( $CommentLine , $Comment );
114 return( $CommentLine );
118 return(
'{lang:comments_were_not_found}' );
121 catch( Exception $e )
153 $MasterId =
$Settings->get_setting(
'master_id' );
154 $MasterType =
$Settings->get_setting(
'master_type' );
156 return( $this->CommentAlgorithms->get_records_for_object( $MasterId , $MasterType ) );
158 catch( Exception $e )
190 $MasterId =
$Settings->get_setting(
'master_id' );
191 $MasterType =
$Settings->get_setting(
'master_type' );
193 $CommentsCount = $this->Link->get_links_count( $MasterId ,
false , $MasterType ,
'comment' );
195 $Page =
$Settings->get_setting(
'page' );
197 $Template = $this->CachedMultyFS->get_template( __FILE__ ,
'comment_link.tpl' );
198 $PlaceHolders = array(
'{page}' ,
'{comment_count}' );
200 return( str_replace( $PlaceHolders , array( $Page , $CommentsCount ) , $Template ) );
202 catch( Exception $e )
234 $this->Settings->load_settings( $Parameters );
236 list( $MasterType , $MasterId )= $this->Settings->get_settings(
'master_type,master_id' );
237 $NeedRun = $this->Settings->get_setting(
'need_run' , 1 );
239 $Code =
'{direct_controller:package_name=comment::comment_controller;meta=meta_create_comment;'.
240 "master_type=$MasterType;master_id=$MasterId;direct_create=1;need_run=$NeedRun}".
241 '{direct_view:package_name=comment::comment_view;meta=meta_create_comment_form;'.
242 "master_type=$MasterType;master_id=$MasterId;direct_create=1;need_run=$NeedRun}";
246 catch( Exception $e )