function social_content_report_node_links_alter in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 8.5 modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 8.6 modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 8.7 modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 8.8 modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 10.3.x modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 10.1.x modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
- 10.2.x modules/social_features/social_content_report/social_content_report.module \social_content_report_node_links_alter()
Implements hook_node_links_alter().
File
- modules/
social_features/ social_content_report/ social_content_report.module, line 120 - The Social Content Report module file.
Code
function social_content_report_node_links_alter(array &$links, NodeInterface $entity, array &$context) {
if ($context['view_mode'] === 'full') {
$link = \Drupal::service('social_content_report.content_report_service')
->getModalLink($entity, 'report_node', TRUE);
if ($link) {
$links['moderation'] = [
'#theme' => 'links__node__moderation',
'#links' => [
'report' => $link,
],
'#attributes' => [
'class' => [
'links',
'inline',
],
],
];
}
}
}