function private_node_view in Private 7.2
Same name and namespace in other branches
- 7 private.module \private_node_view()
Implements hook_node_view().
File
- ./
private.module, line 298 - A tremendously simple access control module -- it allows users to mark individual nodes as private; users with 'access private content' perms can read these nodes, while others cannot.
Code
function private_node_view($node, $view_mode) {
if ($node->private) {
$links['private_icon']['title'] = theme('private_node_link');
$links['private_icon']['html'] = TRUE;
$node->content['links']['private'] = array(
'#theme' => 'links__node__private',
'#links' => $links,
'#attributes' => array(
'class' => array(
'links',
'inline',
),
),
);
}
}