Execute a delegate only once
if($Context->SelfUrl == 'comments.php'){
function Render_CommentImage (&$CommentGrid) {
$Comment = &$CommentGrid->DelegateParameters['Comment'];
$Comment->Body = '<div>IMAGE</div>' . $Comment->Body;
}
$Context->AddToDelegate('CommentGrid', 'PostCommentOptionsRender', 'Render_CommentImage');
}
I want this delegate to run just once for the very first comment, and never run again
0
This discussion has been closed.
Comments