function lingotek_comment_view in Lingotek Translation 7.3
Same name and namespace in other branches
- 7.7 lingotek.module \lingotek_comment_view()
- 7.2 lingotek.module \lingotek_comment_view()
- 7.4 lingotek.module \lingotek_comment_view()
- 7.5 lingotek.module \lingotek_comment_view()
- 7.6 lingotek.module \lingotek_comment_view()
Implements hook_comment_view().
File
- ./
lingotek.module, line 1204
Code
function lingotek_comment_view($comment, $view_mode, $langcode) {
if (class_exists('LingotekComment') && user_access('administer comments')) {
$lingotek_comment = LingotekComment::load($comment);
$link_token = drupal_get_token();
if ($document_id = $lingotek_comment
->getMetadataValue('document_id')) {
// This is a Lingotek-associated comment, present the "update translations" link.
$comment->content['links']['comment']['#links']['comment-lingotek-refresh'] = array(
'title' => t('refresh translations'),
'href' => 'lingotek/sync/comment/' . $comment->cid,
'html' => FALSE,
'query' => array_merge(array(
'token' => $link_token,
), drupal_get_destination()),
);
}
}
}