File

themes/engines/xtemplate/xtemplate.engine, line 79
Handles the interface between XTemplate files and the Drupal theme system.

Code

function xtemplate_comment($comment, $links = 0) {
  global $xtemplate;
  $xtemplate->template
    ->assign(array(
    "new" => t("new"),
    "submitted" => t("Submitted by %a on %b.", array(
      "%a" => format_name($comment),
      "%b" => format_date($comment->timestamp),
    )),
    "title" => l($comment->subject, $_GET['q'], NULL, NULL, "comment-{$comment->cid}"),
    "author" => format_name($comment),
    "date" => format_date($comment->timestamp),
    "content" => $comment->comment,
  ));
  if ($comment->new) {
    $xtemplate->template
      ->parse("comment.new");
  }
  if (theme_get_setting('toggle_comment_user_picture') && ($picture = theme('user_picture', $comment))) {
    $xtemplate->template
      ->assign("picture", $picture);
    $xtemplate->template
      ->parse("comment.picture");
  }
  if ($links) {
    $xtemplate->template
      ->assign("links", $links);
    $xtemplate->template
      ->parse("comment.links");
  }
  $xtemplate->template
    ->parse("comment");
  $output = $xtemplate->template
    ->text("comment");
  $xtemplate->template
    ->reset("comment");
  return $output;
}